From 7fb32b51d2a94b5354924ea2d45d1e198b4d79cf Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Fri, 31 Jan 2020 21:51:40 -0800 Subject: [PATCH 01/28] deps --- CHANGELOG.md | 4 + npm-shrinkwrap.json | 1531 +++++++++++++++++++++++-------------------- package.json | 14 +- 3 files changed, 847 insertions(+), 702 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a6f4fcce..63d615f27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ - Fix keyboard shortcuts, e.g. "alt+(" or "alt+v" - Fix #354: The argument of `\operatorname` is of type 'math', not 'text'. This means that using the '\text' command inside the argument is valid and that spaces should be ignored by default (but the `~` character can be used to insert a space in that context). +### Features / Improvements + +- Documented `suppressChangeNotifications` options for `$insert()` + ## 0.33 (December 16, 2019) ### Bug Fixes diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ee04965d5..c00298313 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@babel/cli": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.8.3.tgz", - "integrity": "sha512-K2UXPZCKMv7KwWy9Bl4sa6+jTNP7JyDiHKzoOiUUygaEDbC60vaargZDnO9oFMvlq8pIKOOyUUgeMYrsaN9djA==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.8.4.tgz", + "integrity": "sha512-XXLgAm6LBbaNxaGhMAznXXaxtCWfuv6PIDJ9Alsy9JYTOh+j2jJz+L/162kkfU1j/pTSxK1xGmlwI4pdIMkoag==", "dev": true, "requires": { "chokidar": "^2.1.8", @@ -54,43 +54,43 @@ } }, "@babel/compat-data": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.8.1.tgz", - "integrity": "sha512-Z+6ZOXvyOWYxJ50BwxzdhRnRsGST8Y3jaZgxYig575lTjVSs3KtJnmESwZegg6e2Dn0td1eDhoWlp1wI4BTCPw==", + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.8.5.tgz", + "integrity": "sha512-jWYUqQX/ObOhG1UiEkbH5SANsE/8oKXiQWjj7p7xgj9Zmnt//aUvyz4dBkK0HNsS8/cbyC5NmmH87VekW+mXFg==", "dev": true, "requires": { - "browserslist": "^4.8.2", + "browserslist": "^4.8.5", "invariant": "^2.2.4", "semver": "^5.5.0" }, "dependencies": { "browserslist": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.3.tgz", - "integrity": "sha512-iU43cMMknxG1ClEZ2MDKeonKE1CCrFVkQK2AqO2YWFmvIrx4JWrvQ4w4hQez6EpVI8rHTtqh/ruHHDHSOKxvUg==", + "version": "4.8.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.6.tgz", + "integrity": "sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001017", - "electron-to-chromium": "^1.3.322", - "node-releases": "^1.1.44" + "caniuse-lite": "^1.0.30001023", + "electron-to-chromium": "^1.3.341", + "node-releases": "^1.1.47" } }, "caniuse-lite": { - "version": "1.0.30001021", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001021.tgz", - "integrity": "sha512-wuMhT7/hwkgd8gldgp2jcrUjOU9RXJ4XxGumQeOsUr91l3WwmM68Cpa/ymCnWEDqakwFXhuDQbaKNHXBPgeE9g==", + "version": "1.0.30001023", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001023.tgz", + "integrity": "sha512-C5TDMiYG11EOhVOA62W1p3UsJ2z4DsHtMBQtjzp3ZsUglcQn62WOUgW0y795c7A5uZ+GCEIvzkMatLIlAsbNTA==", "dev": true }, "electron-to-chromium": { - "version": "1.3.337", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.337.tgz", - "integrity": "sha512-uJ+wLjslYQ/2rAusDg+6FlK8DLhHWTLCe7gkofBehTifW7KCkPVTn5rhKSCncWYNq34Iy/o4OfswuEkAO2RBaw==", + "version": "1.3.344", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.344.tgz", + "integrity": "sha512-tvbx2Wl8WBR+ym3u492D0L6/jH+8NoQXqe46+QhbWH3voVPauGuZYeb1QAXYoOAWuiP2dbSvlBx0kQ1F3hu/Mw==", "dev": true }, "node-releases": { - "version": "1.1.46", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.46.tgz", - "integrity": "sha512-YOjdx+Uoh9FbRO7yVYbnbt1puRWPQMemR3SutLeyv2XfxKs1ihpe0OLAUwBPEP2ImNH/PZC7SEiC6j32dwRZ7g==", + "version": "1.1.47", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.47.tgz", + "integrity": "sha512-k4xjVPx5FpwBUj0Gw7uvFOTF4Ep8Hok1I6qjwL3pLfwe7Y0REQSAqOwwv9TWBCUtMHxcXfY4PgRLRozcChvTcA==", "dev": true, "requires": { "semver": "^6.3.0" @@ -107,17 +107,17 @@ } }, "@babel/core": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.3.tgz", - "integrity": "sha512-4XFkf8AwyrEG7Ziu3L2L0Cv+WyY47Tcsp70JFmpftbAA1K7YL/sgE9jh9HyNj08Y/U50ItUchpN0w6HxAoX1rA==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.4.tgz", + "integrity": "sha512-0LiLrB2PwrVI+a2/IEskBopDYSd8BCb3rOvH7D5tzoWd696TBEduBvuLVm4Nx6rltrLZqvI3MCalB2K2aVzQjA==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.3", - "@babel/helpers": "^7.8.3", - "@babel/parser": "^7.8.3", + "@babel/generator": "^7.8.4", + "@babel/helpers": "^7.8.4", + "@babel/parser": "^7.8.4", "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", + "@babel/traverse": "^7.8.4", "@babel/types": "^7.8.3", "convert-source-map": "^1.7.0", "debug": "^4.1.0", @@ -139,9 +139,9 @@ } }, "@babel/generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.3.tgz", - "integrity": "sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", + "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", "dev": true, "requires": { "@babel/types": "^7.8.3", @@ -191,9 +191,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", "dev": true }, "@babel/template": { @@ -208,16 +208,16 @@ } }, "@babel/traverse": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.3.tgz", - "integrity": "sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", + "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.3", + "@babel/generator": "^7.8.4", "@babel/helper-function-name": "^7.8.3", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.3", + "@babel/parser": "^7.8.4", "@babel/types": "^7.8.3", "debug": "^4.1.0", "globals": "^11.1.0", @@ -330,9 +330,9 @@ } }, "@babel/generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.3.tgz", - "integrity": "sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", + "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", "dev": true, "requires": { "@babel/types": "^7.8.3", @@ -382,9 +382,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", "dev": true }, "@babel/template": { @@ -399,16 +399,16 @@ } }, "@babel/traverse": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.3.tgz", - "integrity": "sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", + "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.3", + "@babel/generator": "^7.8.4", "@babel/helper-function-name": "^7.8.3", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.3", + "@babel/parser": "^7.8.4", "@babel/types": "^7.8.3", "debug": "^4.1.0", "globals": "^11.1.0", @@ -444,45 +444,45 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.3.tgz", - "integrity": "sha512-JLylPCsFjhLN+6uBSSh3iYdxKdeO9MNmoY96PE/99d8kyBFaXLORtAVhqN6iHa+wtPeqxKLghDOZry0+Aiw9Tw==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.4.tgz", + "integrity": "sha512-3k3BsKMvPp5bjxgMdrFyq0UaEO48HciVrOVF0+lon8pp95cyJ2ujAh0TrBHNMnJGT2rr0iKOJPFFbSqjDyf/Pg==", "dev": true, "requires": { - "@babel/compat-data": "^7.8.1", - "browserslist": "^4.8.2", + "@babel/compat-data": "^7.8.4", + "browserslist": "^4.8.5", "invariant": "^2.2.4", - "levenary": "^1.1.0", + "levenary": "^1.1.1", "semver": "^5.5.0" }, "dependencies": { "browserslist": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.3.tgz", - "integrity": "sha512-iU43cMMknxG1ClEZ2MDKeonKE1CCrFVkQK2AqO2YWFmvIrx4JWrvQ4w4hQez6EpVI8rHTtqh/ruHHDHSOKxvUg==", + "version": "4.8.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.6.tgz", + "integrity": "sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001017", - "electron-to-chromium": "^1.3.322", - "node-releases": "^1.1.44" + "caniuse-lite": "^1.0.30001023", + "electron-to-chromium": "^1.3.341", + "node-releases": "^1.1.47" } }, "caniuse-lite": { - "version": "1.0.30001021", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001021.tgz", - "integrity": "sha512-wuMhT7/hwkgd8gldgp2jcrUjOU9RXJ4XxGumQeOsUr91l3WwmM68Cpa/ymCnWEDqakwFXhuDQbaKNHXBPgeE9g==", + "version": "1.0.30001023", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001023.tgz", + "integrity": "sha512-C5TDMiYG11EOhVOA62W1p3UsJ2z4DsHtMBQtjzp3ZsUglcQn62WOUgW0y795c7A5uZ+GCEIvzkMatLIlAsbNTA==", "dev": true }, "electron-to-chromium": { - "version": "1.3.337", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.337.tgz", - "integrity": "sha512-uJ+wLjslYQ/2rAusDg+6FlK8DLhHWTLCe7gkofBehTifW7KCkPVTn5rhKSCncWYNq34Iy/o4OfswuEkAO2RBaw==", + "version": "1.3.344", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.344.tgz", + "integrity": "sha512-tvbx2Wl8WBR+ym3u492D0L6/jH+8NoQXqe46+QhbWH3voVPauGuZYeb1QAXYoOAWuiP2dbSvlBx0kQ1F3hu/Mw==", "dev": true }, "node-releases": { - "version": "1.1.46", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.46.tgz", - "integrity": "sha512-YOjdx+Uoh9FbRO7yVYbnbt1puRWPQMemR3SutLeyv2XfxKs1ihpe0OLAUwBPEP2ImNH/PZC7SEiC6j32dwRZ7g==", + "version": "1.1.47", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.47.tgz", + "integrity": "sha512-k4xjVPx5FpwBUj0Gw7uvFOTF4Ep8Hok1I6qjwL3pLfwe7Y0REQSAqOwwv9TWBCUtMHxcXfY4PgRLRozcChvTcA==", "dev": true, "requires": { "semver": "^6.3.0" @@ -560,9 +560,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", "dev": true }, "@babel/template": { @@ -609,9 +609,9 @@ } }, "@babel/generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.3.tgz", - "integrity": "sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", + "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", "dev": true, "requires": { "@babel/types": "^7.8.3", @@ -661,9 +661,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", "dev": true }, "@babel/template": { @@ -678,16 +678,16 @@ } }, "@babel/traverse": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.3.tgz", - "integrity": "sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", + "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.3", + "@babel/generator": "^7.8.4", "@babel/helper-function-name": "^7.8.3", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.3", + "@babel/parser": "^7.8.4", "@babel/types": "^7.8.3", "debug": "^4.1.0", "globals": "^11.1.0", @@ -852,9 +852,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", "dev": true }, "@babel/template": { @@ -941,9 +941,9 @@ } }, "@babel/generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.3.tgz", - "integrity": "sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", + "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", "dev": true, "requires": { "@babel/types": "^7.8.3", @@ -993,9 +993,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", "dev": true }, "@babel/template": { @@ -1010,16 +1010,16 @@ } }, "@babel/traverse": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.3.tgz", - "integrity": "sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", + "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.3", + "@babel/generator": "^7.8.4", "@babel/helper-function-name": "^7.8.3", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.3", + "@babel/parser": "^7.8.4", "@babel/types": "^7.8.3", "debug": "^4.1.0", "globals": "^11.1.0", @@ -1076,9 +1076,9 @@ } }, "@babel/generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.3.tgz", - "integrity": "sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", + "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", "dev": true, "requires": { "@babel/types": "^7.8.3", @@ -1128,9 +1128,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", "dev": true }, "@babel/template": { @@ -1145,16 +1145,16 @@ } }, "@babel/traverse": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.3.tgz", - "integrity": "sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", + "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.3", + "@babel/generator": "^7.8.4", "@babel/helper-function-name": "^7.8.3", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.3", + "@babel/parser": "^7.8.4", "@babel/types": "^7.8.3", "debug": "^4.1.0", "globals": "^11.1.0", @@ -1220,9 +1220,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", "dev": true }, "@babel/template": { @@ -1280,9 +1280,9 @@ } }, "@babel/generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.3.tgz", - "integrity": "sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", + "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", "dev": true, "requires": { "@babel/types": "^7.8.3", @@ -1332,9 +1332,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", "dev": true }, "@babel/template": { @@ -1349,16 +1349,16 @@ } }, "@babel/traverse": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.3.tgz", - "integrity": "sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", + "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.3", + "@babel/generator": "^7.8.4", "@babel/helper-function-name": "^7.8.3", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.3", + "@babel/parser": "^7.8.4", "@babel/types": "^7.8.3", "debug": "^4.1.0", "globals": "^11.1.0", @@ -1394,13 +1394,13 @@ } }, "@babel/helpers": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.3.tgz", - "integrity": "sha512-LmU3q9Pah/XyZU89QvBgGt+BCsTPoQa+73RxAQh8fb8qkDyIfeQnmgs+hvzhTCKTzqOyk7JTkS3MS1S8Mq5yrQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz", + "integrity": "sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w==", "dev": true, "requires": { "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", + "@babel/traverse": "^7.8.4", "@babel/types": "^7.8.3" }, "dependencies": { @@ -1414,9 +1414,9 @@ } }, "@babel/generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.3.tgz", - "integrity": "sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", + "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", "dev": true, "requires": { "@babel/types": "^7.8.3", @@ -1466,9 +1466,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", "dev": true }, "@babel/template": { @@ -1483,16 +1483,16 @@ } }, "@babel/traverse": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.3.tgz", - "integrity": "sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", + "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.3", + "@babel/generator": "^7.8.4", "@babel/helper-function-name": "^7.8.3", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.3", + "@babel/parser": "^7.8.4", "@babel/types": "^7.8.3", "debug": "^4.1.0", "globals": "^11.1.0", @@ -1802,9 +1802,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", "dev": true }, "@babel/template": { @@ -1879,9 +1879,9 @@ } }, "@babel/plugin-transform-for-of": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.8.3.tgz", - "integrity": "sha512-ZjXznLNTxhpf4Q5q3x1NsngzGA38t9naWH8Gt+0qYZEJAcvPI9waSStSh56u19Ofjr7QmD0wUsQ8hw8s/p1VnA==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.8.4.tgz", + "integrity": "sha512-iAXNlOWvcYUYoV8YIxwS7TxGRJcxyl8eQCfT+A5j8sKUzRFvJdcyjp97jL2IghWSRDaL2PU2O2tX8Cu9dTBq5A==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.8.3" @@ -1938,9 +1938,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", + "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", "dev": true }, "@babel/template": { @@ -2059,9 +2059,9 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.8.3.tgz", - "integrity": "sha512-/pqngtGb54JwMBZ6S/D3XYylQDFtGjWrnoCF4gXZOUpFV/ujbxnoNGNvDGu6doFWRPBveE72qTx/RRU44j5I/Q==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.8.4.tgz", + "integrity": "sha512-IsS3oTxeTsZlE5KqzTbcC2sV0P9pXdec53SU+Yxv7o/6dvGM5AkTotQKhoSffhNgZ/dftsSiOoxy7evCYJXzVA==", "dev": true, "requires": { "@babel/helper-call-delegate": "^7.8.3", @@ -2157,9 +2157,9 @@ } }, "@babel/plugin-transform-typeof-symbol": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.3.tgz", - "integrity": "sha512-3TrkKd4LPqm4jHs6nPtSDI/SV9Cm5PRJkHLUgTcqRQQTMAZ44ZaAdDZJtvWFSaRcvT0a1rTmJ5ZA5tDKjleF3g==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz", + "integrity": "sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.8.3" @@ -2176,13 +2176,13 @@ } }, "@babel/preset-env": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.8.3.tgz", - "integrity": "sha512-Rs4RPL2KjSLSE2mWAx5/iCH+GC1ikKdxPrhnRS6PfFVaiZeom22VFKN4X8ZthyN61kAaR05tfXTbCvatl9WIQg==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.8.4.tgz", + "integrity": "sha512-HihCgpr45AnSOHRbS5cWNTINs0TwaR8BS8xIIH+QwiW8cKL0llV91njQMpeMReEPVs+1Ao0x3RLEBLtt1hOq4w==", "dev": true, "requires": { - "@babel/compat-data": "^7.8.0", - "@babel/helper-compilation-targets": "^7.8.3", + "@babel/compat-data": "^7.8.4", + "@babel/helper-compilation-targets": "^7.8.4", "@babel/helper-module-imports": "^7.8.3", "@babel/helper-plugin-utils": "^7.8.3", "@babel/plugin-proposal-async-generator-functions": "^7.8.3", @@ -2211,7 +2211,7 @@ "@babel/plugin-transform-dotall-regex": "^7.8.3", "@babel/plugin-transform-duplicate-keys": "^7.8.3", "@babel/plugin-transform-exponentiation-operator": "^7.8.3", - "@babel/plugin-transform-for-of": "^7.8.3", + "@babel/plugin-transform-for-of": "^7.8.4", "@babel/plugin-transform-function-name": "^7.8.3", "@babel/plugin-transform-literals": "^7.8.3", "@babel/plugin-transform-member-expression-literals": "^7.8.3", @@ -2222,7 +2222,7 @@ "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", "@babel/plugin-transform-new-target": "^7.8.3", "@babel/plugin-transform-object-super": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.8.4", "@babel/plugin-transform-property-literals": "^7.8.3", "@babel/plugin-transform-regenerator": "^7.8.3", "@babel/plugin-transform-reserved-words": "^7.8.3", @@ -2230,13 +2230,13 @@ "@babel/plugin-transform-spread": "^7.8.3", "@babel/plugin-transform-sticky-regex": "^7.8.3", "@babel/plugin-transform-template-literals": "^7.8.3", - "@babel/plugin-transform-typeof-symbol": "^7.8.3", + "@babel/plugin-transform-typeof-symbol": "^7.8.4", "@babel/plugin-transform-unicode-regex": "^7.8.3", "@babel/types": "^7.8.3", - "browserslist": "^4.8.2", + "browserslist": "^4.8.5", "core-js-compat": "^3.6.2", "invariant": "^2.2.2", - "levenary": "^1.1.0", + "levenary": "^1.1.1", "semver": "^5.5.0" }, "dependencies": { @@ -2252,32 +2252,32 @@ } }, "browserslist": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.3.tgz", - "integrity": "sha512-iU43cMMknxG1ClEZ2MDKeonKE1CCrFVkQK2AqO2YWFmvIrx4JWrvQ4w4hQez6EpVI8rHTtqh/ruHHDHSOKxvUg==", + "version": "4.8.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.6.tgz", + "integrity": "sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001017", - "electron-to-chromium": "^1.3.322", - "node-releases": "^1.1.44" + "caniuse-lite": "^1.0.30001023", + "electron-to-chromium": "^1.3.341", + "node-releases": "^1.1.47" } }, "caniuse-lite": { - "version": "1.0.30001021", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001021.tgz", - "integrity": "sha512-wuMhT7/hwkgd8gldgp2jcrUjOU9RXJ4XxGumQeOsUr91l3WwmM68Cpa/ymCnWEDqakwFXhuDQbaKNHXBPgeE9g==", + "version": "1.0.30001023", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001023.tgz", + "integrity": "sha512-C5TDMiYG11EOhVOA62W1p3UsJ2z4DsHtMBQtjzp3ZsUglcQn62WOUgW0y795c7A5uZ+GCEIvzkMatLIlAsbNTA==", "dev": true }, "electron-to-chromium": { - "version": "1.3.337", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.337.tgz", - "integrity": "sha512-uJ+wLjslYQ/2rAusDg+6FlK8DLhHWTLCe7gkofBehTifW7KCkPVTn5rhKSCncWYNq34Iy/o4OfswuEkAO2RBaw==", + "version": "1.3.344", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.344.tgz", + "integrity": "sha512-tvbx2Wl8WBR+ym3u492D0L6/jH+8NoQXqe46+QhbWH3voVPauGuZYeb1QAXYoOAWuiP2dbSvlBx0kQ1F3hu/Mw==", "dev": true }, "node-releases": { - "version": "1.1.46", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.46.tgz", - "integrity": "sha512-YOjdx+Uoh9FbRO7yVYbnbt1puRWPQMemR3SutLeyv2XfxKs1ihpe0OLAUwBPEP2ImNH/PZC7SEiC6j32dwRZ7g==", + "version": "1.1.47", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.47.tgz", + "integrity": "sha512-k4xjVPx5FpwBUj0Gw7uvFOTF4Ep8Hok1I6qjwL3pLfwe7Y0REQSAqOwwv9TWBCUtMHxcXfY4PgRLRozcChvTcA==", "dev": true, "requires": { "semver": "^6.3.0" @@ -2556,13 +2556,6 @@ "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==", "dev": true }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true, - "optional": true - }, "acorn": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", @@ -2613,9 +2606,9 @@ } }, "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { @@ -2665,30 +2658,12 @@ "default-require-extensions": "^3.0.0" } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true, - "optional": true - }, "archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -2924,7 +2899,8 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base": { "version": "0.11.2", @@ -3009,6 +2985,16 @@ "dev": true, "optional": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "bluebird": { "version": "3.5.5", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", @@ -3025,6 +3011,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3514,13 +3501,6 @@ } } }, - "chownr": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", - "dev": true, - "optional": true - }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", @@ -3577,46 +3557,11 @@ "string-width": "^1.0.1" }, "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, "slice-ansi": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } } } }, @@ -3796,14 +3741,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true, - "optional": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "convert-source-map": { "version": "1.7.0", @@ -3838,32 +3777,32 @@ }, "dependencies": { "browserslist": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.3.tgz", - "integrity": "sha512-iU43cMMknxG1ClEZ2MDKeonKE1CCrFVkQK2AqO2YWFmvIrx4JWrvQ4w4hQez6EpVI8rHTtqh/ruHHDHSOKxvUg==", + "version": "4.8.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.6.tgz", + "integrity": "sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001017", - "electron-to-chromium": "^1.3.322", - "node-releases": "^1.1.44" + "caniuse-lite": "^1.0.30001023", + "electron-to-chromium": "^1.3.341", + "node-releases": "^1.1.47" } }, "caniuse-lite": { - "version": "1.0.30001021", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001021.tgz", - "integrity": "sha512-wuMhT7/hwkgd8gldgp2jcrUjOU9RXJ4XxGumQeOsUr91l3WwmM68Cpa/ymCnWEDqakwFXhuDQbaKNHXBPgeE9g==", + "version": "1.0.30001023", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001023.tgz", + "integrity": "sha512-C5TDMiYG11EOhVOA62W1p3UsJ2z4DsHtMBQtjzp3ZsUglcQn62WOUgW0y795c7A5uZ+GCEIvzkMatLIlAsbNTA==", "dev": true }, "electron-to-chromium": { - "version": "1.3.337", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.337.tgz", - "integrity": "sha512-uJ+wLjslYQ/2rAusDg+6FlK8DLhHWTLCe7gkofBehTifW7KCkPVTn5rhKSCncWYNq34Iy/o4OfswuEkAO2RBaw==", + "version": "1.3.344", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.344.tgz", + "integrity": "sha512-tvbx2Wl8WBR+ym3u492D0L6/jH+8NoQXqe46+QhbWH3voVPauGuZYeb1QAXYoOAWuiP2dbSvlBx0kQ1F3hu/Mw==", "dev": true }, "node-releases": { - "version": "1.1.46", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.46.tgz", - "integrity": "sha512-YOjdx+Uoh9FbRO7yVYbnbt1puRWPQMemR3SutLeyv2XfxKs1ihpe0OLAUwBPEP2ImNH/PZC7SEiC6j32dwRZ7g==", + "version": "1.1.47", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.47.tgz", + "integrity": "sha512-k4xjVPx5FpwBUj0Gw7uvFOTF4Ep8Hok1I6qjwL3pLfwe7Y0REQSAqOwwv9TWBCUtMHxcXfY4PgRLRozcChvTcA==", "dev": true, "requires": { "semver": "^6.3.0" @@ -4147,13 +4086,6 @@ "regexp.prototype.flags": "^1.2.0" } }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "optional": true - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -4244,26 +4176,12 @@ "dev": true, "optional": true }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true, - "optional": true - }, "dependency-graph": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.8.1.tgz", "integrity": "sha512-g213uqF8fyk40W8SBjm079n3CZB4qSpCrA2ye1fLGzH/4HEgB6tzuW2CbLE7leb4t45/6h44Ud59Su1/ROTfqw==", "dev": true }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "dev": true, - "optional": true - }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -4592,9 +4510,9 @@ } }, "eslint-config-prettier": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.9.0.tgz", - "integrity": "sha512-k4E14HBtcLv0uqThaI6I/n1LEqROp8XaPu6SO9Z32u5NlGRC07Enu1Bh2KEFw4FNHbekH8yzbIU9kUGxbiGmCA==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.10.0.tgz", + "integrity": "sha512-AtndijGte1rPILInUdHjvKEGbIV06NuvPrqlIEaEaWtbtvJh464mDeyGMdZEQMsGvC0ZVkiex1fSNcC4HAbRGg==", "dev": true, "requires": { "get-stdin": "^6.0.0" @@ -5237,6 +5155,13 @@ "flat-cache": "^2.0.1" } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -5460,16 +5385,6 @@ "universalify": "^0.1.0" } }, - "fs-minipass": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, "fs-readdir-recursive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", @@ -5479,143 +5394,579 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz", + "integrity": "sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw==", "dev": true, "optional": true, "requires": { + "bindings": "^1.5.0", "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" + "node-pre-gyp": "*" }, "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "bundled": true, + "dev": true, + "optional": true }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "dev": true, + "optional": true, "requires": { - "ms": "^2.1.1" + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" } }, - "is-fullwidth-code-point": { + "balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "bundled": true, + "dev": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "optional": true, "requires": { - "number-is-nan": "^1.0.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "chownr": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "optional": true }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "requires": { - "glob": "^7.1.3" - } + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true, + "optional": true }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" - } - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "3.2.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.6.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "bundled": true, + "dev": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true, + "optional": true + }, + "minipass": { + "version": "2.9.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.3.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.9.0" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.14.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4.4.2" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.7.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.7.1", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, "dev": true, "optional": true }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "tar": { + "version": "4.4.13", + "bundled": true, "dev": true, "optional": true, "requires": { - "number-is-nan": "^1.0.0" + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" } }, - "string-width": { + "util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "bundled": true, "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } + "optional": true }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "wide-align": { + "version": "1.1.3", + "bundled": true, "dev": true, "optional": true, "requires": { - "ansi-regex": "^2.0.0" + "string-width": "^1.0.2 || 2" } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "yallist": { + "version": "3.1.1", + "bundled": true, + "dev": true, + "optional": true } } }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "gensync": { "version": "1.0.0-beta.1", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", @@ -5670,6 +6021,7 @@ "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -5800,13 +6152,6 @@ "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true, - "optional": true - }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -6130,16 +6475,6 @@ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, - "ignore-walk": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, "image-size": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", @@ -6197,6 +6532,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -6205,14 +6541,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true, - "optional": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "inquirer": { "version": "7.0.1", @@ -6991,9 +7321,9 @@ "dev": true }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true, "optional": true }, @@ -7039,9 +7369,9 @@ "dev": true }, "levenary": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.0.tgz", - "integrity": "sha512-VHcwhO0UTpUW7rLPN2/OiWJdgA1e9BqEDALhrgCe/F+uUJnep6CoUsTzMeP8Rh0NGr9uKquXxqe7lwLZo509nQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz", + "integrity": "sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ==", "dev": true, "requires": { "leven": "^3.1.0" @@ -7073,9 +7403,9 @@ } }, "lint-staged": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.0.2.tgz", - "integrity": "sha512-ZldhtIfT7bynVa7nmU/1jbK05r9hYQXbIQqZSotqdBCAcGJDEUqaUB7kG3ZCdoe9Qkj6HUM3x2yjCGJRxPUQLA==", + "version": "10.0.7", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.0.7.tgz", + "integrity": "sha512-Byj0F4l7GYUpYYHEqyFH69NiI6ICTg0CeCKbhRorL+ickbzILKUlZLiyCkljZV02wnoh7yH7PmFyYm9PRNwk9g==", "dev": true, "requires": { "chalk": "^3.0.0", @@ -7364,12 +7694,6 @@ "strip-ansi": "^3.0.1" }, "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -7414,15 +7738,6 @@ "chalk": "^1.0.0" } }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -7604,6 +7919,12 @@ "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", "dev": true }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", @@ -7638,6 +7959,25 @@ "signal-exit": "^3.0.2" } }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, "wrap-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz", @@ -7796,6 +8136,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -7806,36 +8147,6 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, - "minipass": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - }, - "dependencies": { - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "optional": true - } - } - }, - "minizlib": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, "mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", @@ -7914,37 +8225,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "needle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz", - "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", - "dev": true, - "optional": true, - "requires": { - "debug": "^4.1.0", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true, - "optional": true - } - } - }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -7957,37 +8237,6 @@ "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", "dev": true }, - "node-pre-gyp": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz", - "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - }, - "dependencies": { - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, "node-preload": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", @@ -8006,17 +8255,6 @@ "semver": "^5.3.0" } }, - "nopt": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -8047,24 +8285,6 @@ "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", "dev": true }, - "npm-bundled": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", - "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz", - "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, "npm-run-all": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", @@ -8099,19 +8319,6 @@ } } }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, "nth-check": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", @@ -8130,7 +8337,8 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true }, "nyc": { "version": "15.0.0", @@ -8523,6 +8731,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1" } @@ -8580,30 +8789,12 @@ "wordwrap": "~1.0.0" } }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true, - "optional": true - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, "p-finally": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-2.0.1.tgz", @@ -8711,7 +8902,8 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-key": { "version": "2.0.1", @@ -9563,35 +9755,6 @@ "integrity": "sha512-Cxm7/SS/y/Z3MHWSxXb8lIFqgqBowP5JMlTUFyJN88y0SGQhVmZnqFK/PeuMX9LzUyWsqqhNxIyg0jlzq946yA==", "dev": true }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true, - "optional": true - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, - "optional": true - } - } - }, "re-emitter": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/re-emitter/-/re-emitter-1.1.3.tgz", @@ -9961,18 +10124,18 @@ "dev": true }, "rimraf": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", - "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.1.tgz", + "integrity": "sha512-IQ4ikL8SjBiEDZfk+DFVwqRK8md24RWMEJkdSlgNLkyyAImcjf8SWvU1qFMDOb4igBClbTQ/ugPqXcRwdFTxZw==", "dev": true, "requires": { "glob": "^7.1.3" } }, "rollup": { - "version": "1.29.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.29.1.tgz", - "integrity": "sha512-dGQ+b9d1FOX/gluiggTAVnTvzQZUEkCi/TwZcax7ujugVRHs0nkYJlV9U4hsifGEMojnO+jvEML2CJQ6qXgbHA==", + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.31.0.tgz", + "integrity": "sha512-9C6ovSyNeEwvuRuUUmsTpJcXac1AwSL1a3x+O5lpmQKZqi5mmrjauLeqIjvREC+yNRR8fPdzByojDng+af3nVw==", "dev": true, "requires": { "@types/estree": "*", @@ -10364,13 +10527,13 @@ "dev": true }, "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", "dev": true, "optional": true, "requires": { - "atob": "^2.1.1", + "atob": "^2.1.2", "decode-uri-component": "^0.2.0", "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", @@ -10553,13 +10716,25 @@ "dev": true }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + } } }, "string.prototype.padend": { @@ -10678,12 +10853,12 @@ } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^2.0.0" } }, "strip-bom": { @@ -10991,31 +11166,6 @@ } } }, - "tar": { - "version": "4.4.8", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", - "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - }, - "dependencies": { - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "optional": true - } - } - }, "terser": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.2.tgz", @@ -11360,9 +11510,9 @@ } }, "upath": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", - "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", "dev": true, "optional": true }, @@ -11473,16 +11623,6 @@ "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", "dev": true }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -11574,7 +11714,8 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "write": { "version": "1.0.3", diff --git a/package.json b/package.json index 1dc76d06d..dd3bebfca 100644 --- a/package.json +++ b/package.json @@ -99,29 +99,29 @@ ], "bugs": "https://github.com/arnog/mathlive/issues/", "devDependencies": { - "@babel/cli": "^7.8.3", - "@babel/core": "^7.8.3", - "@babel/preset-env": "^7.8.3", + "@babel/cli": "^7.8.4", + "@babel/core": "^7.8.4", + "@babel/preset-env": "^7.8.4", "@babel/register": "^7.8.3", "@cortex-js/prettier-config": "^1.0.0", "autoprefixer": "^9.7.4", "chokidar-cli": "^2.1.0", "cssnano": "^4.1.10", "eslint": "^6.8.0", - "eslint-config-prettier": "^6.7.0", + "eslint-config-prettier": "^6.10.0", "eslint-plugin-prettier": "^3.1.2", "eslint-watch": "^6.0.1", "http-server": "^0.12.1", "husky": "^4.2.1", "jsdoc": "^3.6.3", "less": "^3.10.3", - "lint-staged": "^10.0.2", + "lint-staged": "^10.0.7", "npm-run-all": "^4.1.5", "nyc": "^15.0.0", "postcss-cli": "^7.1.0", "prettier": "^1.19.1", - "rimraf": "^3.0.0", - "rollup": "^1.29.1", + "rimraf": "^3.0.1", + "rollup": "^1.31.0", "rollup-plugin-copy": "^3.3.0", "rollup-plugin-terser": "^5.2.0", "sutro-jsdoc-theme": "^1.0", From e0f2315a9b87960b438552d7f691e26690d66a42 Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Sat, 1 Feb 2020 15:13:01 -0800 Subject: [PATCH 02/28] chore: update README for 2020 --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9f32b759d..701e766fa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ math live -[![Maintenance](https://img.shields.io/maintenance/yes/2019.svg)]() +[![Maintenance](https://img.shields.io/maintenance/yes/2020.svg)]() [![GitHub license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://raw.githubusercontent.com/arnog/mathlive/master/LICENSE.txt) [![Build Status](https://travis-ci.org/arnog/mathlive.svg?branch=master)](https://travis-ci.org/arnog/mathlive) @@ -8,12 +8,14 @@ Screenshot -MathLive is a JavaScript library to render and edit math. +MathLive: Math Input Made Easy -- [x] TeX-quality typesetting -- [x] Easy to use interface for math editing -- [x] Fast and small -- [x] Works great on desktop and on mobile devices thanks to an extensive set of virtual keyboards +- [x] JavaScript library easy to integrate in your project +- [x] Beautiful, TeX-quality typesetting +- [x] Easy to use interface for formula editing +- [x] Designed for mobile devices with an extensive set of virtual keyboards +- [x] Accessility support: screen reader compatible, and includes custom + math-to-speech support - [x] Outputs **LaTeX**, **MathML** and **MathJSON** (Abstract Syntax Tree) - [x] And it is easy to customize to your needs! From b528b8bf1f7aebfac28f31ede8b80172a1962f31 Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Mon, 3 Feb 2020 09:12:39 -0800 Subject: [PATCH 03/28] bug: adjust lineheight of text to display correctly in some cases --- css/mathlive.core.less | 92 ++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/css/mathlive.core.less b/css/mathlive.core.less index 90e0271fb..64b775cdc 100644 --- a/css/mathlive.core.less +++ b/css/mathlive.core.less @@ -1,6 +1,5 @@ @math_main: KaTeX_Main; - .ML__mathlive { // font: 400 100% @math_main,'times new roman',serif; line-height: 0; @@ -25,7 +24,7 @@ width: min-content; - // Encourage browsers to consider allocating a hardware accelerated + // Encourage browsers to consider allocating a hardware accelerated // layer for this element. transform: translateZ(0); } @@ -36,7 +35,8 @@ cursor: text; } -.ML__strut, .ML__strut--bottom { +.ML__strut, +.ML__strut--bottom { display: inline-block; min-height: 1em; } @@ -77,22 +77,32 @@ /* Text mode */ .ML__text { + line-height: 1; white-space: pre; } .ML__focused .ML__text { - background: hsla(var(--hue), 40%, 50%, .1); + background: hsla(var(--hue), 40%, 50%, 0.1); } -@keyframes ML__caret-command-blink { - from, to { opacity: 1; } - 50% { opacity: 0; } +@keyframes ML__caret-command-blink { + from, + to { + opacity: 1; + } + 50% { + opacity: 0; + } } - -@keyframes ML__caret-blink { - from, to { border-color: var(--caret); } - 50% { border-color: transparent; } +@keyframes ML__caret-blink { + from, + to { + border-color: var(--caret); + } + 50% { + border-color: transparent; + } } /* Style for the invisible textarea element which is used @@ -114,13 +124,12 @@ to make sure it doesn't show. */ font-size: 16px; } - .ML__fieldcontainer { display: flex; flex-flow: row; justify-content: space-between; align-items: flex-end; - min-height: 39px; /* Need some room for the virtual keyboard toggle */ + min-height: 39px; /* Need some room for the virtual keyboard toggle */ /* Prevent the browser from trying to interpret touch gestures in the field */ /* "Disabling double-tap to zoom removes the need for browsers to @@ -129,7 +138,7 @@ to make sure it doesn't show. */ width: 100%; --hue: 212; - --highlight: hsl(var(--hue),97%,85%); + --highlight: hsl(var(--hue), 97%, 85%); // --highlight: Highlight; // Highlight color defined in https://www.w3.org/TR/REC-CSS2/ui.html // // It has been deprectated in https://www.w3.org/TR/css-color-3/ :( // --on-highlight: HighlightText; @@ -137,26 +146,26 @@ to make sure it doesn't show. */ --highlight-inactive: #ccc; --primary: hsl(var(--hue), 40%, 50%); - --secondary: hsl(var(--hue),19%,26%); - --on-secondary: hsl(var(--hue),19%,26%); + --secondary: hsl(var(--hue), 19%, 26%); + --on-secondary: hsl(var(--hue), 19%, 26%); } @media (prefers-color-scheme: dark) { - body:not([theme="light"]) .ML__fieldcontainer { + body:not([theme='light']) .ML__fieldcontainer { --highlight: hsl(var(--hue), 40%, 49%); --highlight-inactive: hsl(var(--hue), 10%, 35%); - --caret: hsl(var(--hue),97%,85%); - --secondary: hsl(var(--hue),25%,35%); - --on-secondary: hsl(0,0%,98%); + --caret: hsl(var(--hue), 97%, 85%); + --secondary: hsl(var(--hue), 25%, 35%); + --on-secondary: hsl(0, 0%, 98%); } } -body[theme="dark"] .ML__fieldcontainer { +body[theme='dark'] .ML__fieldcontainer { --highlight: hsl(var(--hue), 40%, 49%); --highlight-inactive: hsl(var(--hue), 10%, 35%); - --caret: hsl(var(--hue),97%,85%); - --secondary: hsl(var(--hue),25%,35%); - --on-secondary: hsl(0,0%,98%); + --caret: hsl(var(--hue), 97%, 85%); + --secondary: hsl(var(--hue), 25%, 35%); + --on-secondary: hsl(0, 0%, 98%); } .ML__fieldcontainer:focus { @@ -165,7 +174,7 @@ body[theme="dark"] .ML__fieldcontainer { } /* This is the actual field content (formula) */ -.ML__fieldcontainer__field { +.ML__fieldcontainer__field { align-self: center; position: relative; overflow: hidden; @@ -174,8 +183,6 @@ body[theme="dark"] .ML__fieldcontainer { width: 100%; } - - .ML__virtual-keyboard-toggle { display: flex; align-self: center; @@ -193,28 +200,27 @@ body[theme="dark"] .ML__fieldcontainer { /* Avoid some weird blinking with :hover */ border-radius: 50%; border: 1px solid transparent; - transition: background 0.2s cubic-bezier(.64,.09,.08,1); + transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); color: var(--primary); fill: currentColor; background: transparent; &:hover { - background: hsl(var(--hue),25%,35%); - color: hsl(0,0%,98%); + background: hsl(var(--hue), 25%, 35%); + color: hsl(0, 0%, 98%); fill: currentColor; border-radius: 50%; // border: 1px solid rgba(255, 255, 255, .9); - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), + 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); } } - - /* The element that display info while in command mode */ .ML__popover { visibility: hidden; min-width: 160px; - background-color: rgba(97, 97, 97, .95); + background-color: rgba(97, 97, 97, 0.95); color: #fff; text-align: center; border-radius: 6px; @@ -226,23 +232,23 @@ body[theme="dark"] .ML__fieldcontainer { flex-direction: column; justify-content: center; - box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22); - transition: all 0.2s cubic-bezier(.64,.09,.08,1); + box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); + transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); /* The 'tip' of the popover panel */ &::after { - content: ""; + content: ''; position: absolute; top: -5px; left: calc(50% - 3px); - width: 0; - height: 0; + width: 0; + height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; - + font-size: 1rem; - - border-bottom: 5px solid rgba(97, 97, 97, .9); + + border-bottom: 5px solid rgba(97, 97, 97, 0.9); } } @@ -250,7 +256,7 @@ body[theme="dark"] .ML__fieldcontainer { &::after { top: auto; bottom: -5px; - border-top: 5px solid rgba(97, 97, 97, .9); + border-top: 5px solid rgba(97, 97, 97, 0.9); border-bottom: 0; } } From e67ea4d44610c74998e32180afaf417054eb48dc Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Mon, 3 Feb 2020 09:13:23 -0800 Subject: [PATCH 04/28] bug: correctly parse \mathop and double-minus --- src/addons/mathJson.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/addons/mathJson.js b/src/addons/mathJson.js index 35d607641..70fd94dcd 100644 --- a/src/addons/mathJson.js +++ b/src/addons/mathJson.js @@ -591,6 +591,7 @@ const SUPER_ASSOCIATIVE_FUNCTION = { }; function getString(atom) { + if (typeof atom === 'string') return atom; if (Array.isArray(atom)) { let result = ''; for (const subAtom of atom) { @@ -1078,9 +1079,7 @@ function parseDigraph(expr) { } else { const digraph = expr.atoms[expr.index].latex + expr.atoms[expr.index + 1].latex; - const result = /^(>=|<=|>>|<<|:=|!=|\*\*|\+\+|--)$/.test(digraph) - ? digraph - : ''; + const result = /^(>=|<=|>>|<<|:=|!=)$/.test(digraph) ? digraph : ''; if (result) { expr.index += 1; } From a29430bb014fb38be8cfeda86e565785f5d1cff1 Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Mon, 3 Feb 2020 10:52:14 -0800 Subject: [PATCH 05/28] bug: correctly parse roots when generating MathJSON --- src/addons/mathJson.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/addons/mathJson.js b/src/addons/mathJson.js index 70fd94dcd..a30496fbe 100644 --- a/src/addons/mathJson.js +++ b/src/addons/mathJson.js @@ -1733,7 +1733,7 @@ MathAtom.MathAtom.prototype.toAST = function(options) { result = wrapFn( 'pow', parse(this.body, options), - wrapFn('divide', 1, parse(this.index, options)) + wrapFn('divide', wrapNum(1), parse(this.index, options)) ); } else { result = wrapFn('sqrt', parse(this.body, options)); From 32a747b82f2ce7b5c49d53bff48318fd2ba9891b Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Mon, 3 Feb 2020 10:59:00 -0800 Subject: [PATCH 06/28] dist --- dist/mathlive.core.css | 222 +- dist/mathlive.js | 21029 +++++++++++++++++++++++++++++++++- dist/mathlive.mjs | 2 +- dist/src/addons/mathJson.js | 7 +- 4 files changed, 21253 insertions(+), 7 deletions(-) diff --git a/dist/mathlive.core.css b/dist/mathlive.core.css index ee7e1ef2e..99667cad6 100644 --- a/dist/mathlive.core.css +++ b/dist/mathlive.core.css @@ -1 +1,221 @@ -.ML__mathlive{line-height:0;direction:ltr;text-align:left;text-indent:0;text-rendering:auto;font-style:normal;font-size-adjust:none;letter-spacing:normal;word-wrap:normal;word-spacing:normal;white-space:nowrap;display:inline-block;text-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:-webkit-min-content;width:-moz-min-content;width:min-content;transform:translateZ(0)}.ML__base{display:inline-block;position:relative;cursor:text}.ML__strut,.ML__strut--bottom{display:inline-block;min-height:1em}.ML__caret:after{content:"";border:none;border-radius:2px;border-right:2px solid var(--caret);margin-right:-2px;position:relative;left:-1px;-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__text-caret:after{content:"";border:none;border-radius:1px;border-right:1px solid var(--caret);margin-right:-1px;position:relative;left:0;-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__command-caret:after{content:"_";border:none;margin-right:-1ex;position:relative;color:var(--caret);-webkit-animation:ML__caret-command-blink 1.05s step-end infinite forwards;animation:ML__caret-command-blink 1.05s step-end infinite forwards}.ML__text{white-space:pre}.ML__focused .ML__text{background:hsla(var(--hue),40%,50%,.1)}@-webkit-keyframes ML__caret-command-blink{0%,to{opacity:1}50%{opacity:0}}@keyframes ML__caret-command-blink{0%,to{opacity:1}50%{opacity:0}}@-webkit-keyframes ML__caret-blink{0%,to{border-color:var(--caret)}50%{border-color:transparent}}@keyframes ML__caret-blink{0%,to{border-color:var(--caret)}50%{border-color:transparent}}.ML__textarea__textarea{transform:scale(0);resize:none;position:absolute;clip:rect(0 0 0 0);width:1px;height:1px;font-size:16px}.ML__fieldcontainer{display:flex;flex-flow:row;justify-content:space-between;align-items:flex-end;min-height:39px;touch-action:none;width:100%;--hue:212;--highlight:hsl(var(--hue),97%,85%);--caret:hsl(var(--hue),40%,49%);--highlight-inactive:#ccc;--primary:hsl(var(--hue),40%,50%);--secondary:hsl(var(--hue),19%,26%);--on-secondary:hsl(var(--hue),19%,26%)}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__fieldcontainer{--highlight:hsl(var(--hue),40%,49%);--highlight-inactive:hsl(var(--hue),10%,35%);--caret:hsl(var(--hue),97%,85%);--secondary:hsl(var(--hue),25%,35%);--on-secondary:#fafafa}}body[theme=dark] .ML__fieldcontainer{--highlight:hsl(var(--hue),40%,49%);--highlight-inactive:hsl(var(--hue),10%,35%);--caret:hsl(var(--hue),97%,85%);--secondary:hsl(var(--hue),25%,35%);--on-secondary:#fafafa}.ML__fieldcontainer:focus{outline:2px solid var(--primary);outline-offset:3px}.ML__fieldcontainer__field{align-self:center;position:relative;overflow:hidden;line-height:0;padding:2px;width:100%}.ML__virtual-keyboard-toggle{display:flex;align-self:center;align-items:center;flex-shrink:0;flex-direction:column;justify-content:center;width:34px;height:34px;padding:0;margin-right:4px;cursor:pointer;box-sizing:border-box;border-radius:50%;border:1px solid transparent;transition:background .2s cubic-bezier(.64,.09,.08,1);color:var(--primary);fill:currentColor;background:transparent}.ML__virtual-keyboard-toggle:hover{background:hsl(var(--hue),25%,35%);color:#fafafa;fill:currentColor;border-radius:50%;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.ML__popover{visibility:hidden;min-width:160px;background-color:rgba(97,97,97,.95);color:#fff;text-align:center;border-radius:6px;position:fixed;z-index:1;display:flex;flex-direction:column;justify-content:center;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);transition:all .2s cubic-bezier(.64,.09,.08,1)}.ML__popover:after{content:"";position:absolute;top:-5px;left:calc(50% - 3px);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;font-size:1rem;border-bottom:5px solid rgba(97,97,97,.9)}.reverse-direction:after{top:auto;bottom:-5px;border-top:5px solid rgba(97,97,97,.9);border-bottom:0} \ No newline at end of file +.ML__mathlive { + line-height: 0; + direction: ltr; + text-align: left; + text-indent: 0; + text-rendering: auto; + font-style: normal; + font-size-adjust: none; + letter-spacing: normal; + word-wrap: normal; + word-spacing: normal; + white-space: nowrap; + display: inline-block; + text-shadow: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + width: -webkit-min-content; + width: -moz-min-content; + width: min-content; + transform: translateZ(0); +} +.ML__base { + display: inline-block; + position: relative; + cursor: text; +} +.ML__strut, +.ML__strut--bottom { + display: inline-block; + min-height: 1em; +} +.ML__caret:after { + content: ''; + border: none; + border-radius: 2px; + border-right: 2px solid var(--caret); + margin-right: -2px; + position: relative; + left: -1px; + -webkit-animation: ML__caret-blink 1.05s step-end infinite forwards; + animation: ML__caret-blink 1.05s step-end infinite forwards; +} +.ML__text-caret:after { + content: ''; + border: none; + border-radius: 1px; + border-right: 1px solid var(--caret); + margin-right: -1px; + position: relative; + left: 0; + -webkit-animation: ML__caret-blink 1.05s step-end infinite forwards; + animation: ML__caret-blink 1.05s step-end infinite forwards; +} +.ML__command-caret:after { + content: '_'; + border: none; + margin-right: -1ex; + position: relative; + color: var(--caret); + -webkit-animation: ML__caret-command-blink 1.05s step-end infinite forwards; + animation: ML__caret-command-blink 1.05s step-end infinite forwards; +} +.ML__text { + line-height: 1; + white-space: pre; +} +.ML__focused .ML__text { + background: hsla(var(--hue), 40%, 50%, 0.1); +} +@-webkit-keyframes ML__caret-command-blink { + 0%, + to { + opacity: 1; + } + 50% { + opacity: 0; + } +} +@keyframes ML__caret-command-blink { + 0%, + to { + opacity: 1; + } + 50% { + opacity: 0; + } +} +@-webkit-keyframes ML__caret-blink { + 0%, + to { + border-color: var(--caret); + } + 50% { + border-color: transparent; + } +} +@keyframes ML__caret-blink { + 0%, + to { + border-color: var(--caret); + } + 50% { + border-color: transparent; + } +} +.ML__textarea__textarea { + transform: scale(0); + resize: none; + position: absolute; + clip: rect(0 0 0 0); + width: 1px; + height: 1px; + font-size: 16px; +} +.ML__fieldcontainer { + display: flex; + flex-flow: row; + justify-content: space-between; + align-items: flex-end; + min-height: 39px; + touch-action: none; + width: 100%; + --hue: 212; + --highlight: hsl(var(--hue), 97%, 85%); + --caret: hsl(var(--hue), 40%, 49%); + --highlight-inactive: #ccc; + --primary: hsl(var(--hue), 40%, 50%); + --secondary: hsl(var(--hue), 19%, 26%); + --on-secondary: hsl(var(--hue), 19%, 26%); +} +@media (prefers-color-scheme: dark) { + body:not([theme='light']) .ML__fieldcontainer { + --highlight: hsl(var(--hue), 40%, 49%); + --highlight-inactive: hsl(var(--hue), 10%, 35%); + --caret: hsl(var(--hue), 97%, 85%); + --secondary: hsl(var(--hue), 25%, 35%); + --on-secondary: #fafafa; + } +} +body[theme='dark'] .ML__fieldcontainer { + --highlight: hsl(var(--hue), 40%, 49%); + --highlight-inactive: hsl(var(--hue), 10%, 35%); + --caret: hsl(var(--hue), 97%, 85%); + --secondary: hsl(var(--hue), 25%, 35%); + --on-secondary: #fafafa; +} +.ML__fieldcontainer:focus { + outline: 2px solid var(--primary); + outline-offset: 3px; +} +.ML__fieldcontainer__field { + align-self: center; + position: relative; + overflow: hidden; + line-height: 0; + padding: 2px; + width: 100%; +} +.ML__virtual-keyboard-toggle { + display: flex; + align-self: center; + align-items: center; + flex-shrink: 0; + flex-direction: column; + justify-content: center; + width: 34px; + height: 34px; + padding: 0; + margin-right: 4px; + cursor: pointer; + box-sizing: border-box; + border-radius: 50%; + border: 1px solid transparent; + transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); + color: var(--primary); + fill: currentColor; + background: transparent; +} +.ML__virtual-keyboard-toggle:hover { + background: hsl(var(--hue), 25%, 35%); + color: #fafafa; + fill: currentColor; + border-radius: 50%; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), + 0 3px 1px -2px rgba(0, 0, 0, 0.2); +} +.ML__popover { + visibility: hidden; + min-width: 160px; + background-color: rgba(97, 97, 97, 0.95); + color: #fff; + text-align: center; + border-radius: 6px; + position: fixed; + z-index: 1; + display: flex; + flex-direction: column; + justify-content: center; + box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); + transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); +} +.ML__popover:after { + content: ''; + position: absolute; + top: -5px; + left: calc(50% - 3px); + width: 0; + height: 0; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + font-size: 1rem; + border-bottom: 5px solid rgba(97, 97, 97, 0.9); +} +.reverse-direction:after { + top: auto; + bottom: -5px; + border-top: 5px solid rgba(97, 97, 97, 0.9); + border-bottom: 0; +} diff --git a/dist/mathlive.js b/dist/mathlive.js index 536c70204..97616a4cf 100644 --- a/dist/mathlive.js +++ b/dist/mathlive.js @@ -1 +1,21028 @@ -var global,factory;global=this,factory=function(){function t(t,e){e=e||0;const i=t.charCodeAt(e);if(55296<=i&&i<=56319&&e=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return K[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return K[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(N[e]?this.classes+=" "+N[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function I(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return B(i[0],e)}return new L(t,e)}function O(t,e,i){const s=B(e,i);return s.type=t,s}function R(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const K={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},N={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var $={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,I(c)||0),c.height=Math.max(-o,P(c)||0),c},makeHlist:R,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=R(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:P,depth:I,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=$.makeSymbol,Ct=$.makeSpan,_t=$.makeVlist;function Tt(t,e,i,s,a,o){const n=Mt("Size"+i+"-Regular",At.getValue("math",e)),r=$.makeStyleWrap(t,Ct(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+i)}function Ft(t,e,i,s,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Bt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Ot(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return Rt(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?Pt:Dt.includes(e)?Bt:It;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(At.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=$.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Tt(t,e,r.size,s,a,o):Ft(t,e,i,s,a,o)}function Rt(t,e,i){return $.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Kt={makeSizedDelim:function(t,e,i,s,a){return"."===e?Rt(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,i,!1,s,a):zt.includes(e)?Ft(t,e,qt[i],!1,s,a):null)},makeCustomSizedDelim:Ot,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return Rt(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Ot(t,e,h,!0,a,o)}};const Nt=$.makeSpan,$t=$.makeOrd,Wt=$.makeInner,Ht=$.makeHlist,Vt=$.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=$t(Qt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);t$.height(i)+$.depth(i)+o&&(o=(o+l-($.height(i)+$.depth(i)))/2),r.setTop(r.height-$.height(i)-(o+s));const c=Nt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Vt(t,[i,o,c,s]);if(!this.index)return this.bind(t,$t([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Nt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,$t([Nt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,$t(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=$.skew(i));const a=Math.min($.height(i),e.metrics.xHeight),o=$.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Nt(Nt(o),"accent-body"+n);return r=Vt(t,[i,-a,r]),r.children[1].setLeft(2*s),$t(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Qt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=Nt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[i,3*s,a,s]);else{const e=Nt(i);o=Vt(t,[s,a,3*s,e],"top",$.height(e))}return $t(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?Nt(Qt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?Nt(Qt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Yt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Nt(Qt(t,this.body),"inner");return $t([e,Nt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=$t("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=$.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=$.makeOp(Qt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=$t(Qt(t,this.body)),i=Nt();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=Nt([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=$t(Qt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",($.height(e)+$.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=Nt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Nt(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Nt(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=$.height(e)-s.metrics.supDrop,l=$.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-$.depth(a)-($.height(o)-l)<4*i){l=4*i-(r-a.depth)+$.height(o);const t=.8*s.metrics.xHeight-(r-$.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-$.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,$.height(o)-.8*s.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-$.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Nt(p,"msubsup");return this.caret&&(m.caret=this.caret),$.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?Nt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Nt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=$.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Xt(t){const e=Nt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,i,s){const a=[];for(const o of e){const e=Nt(Qt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Vt(t,a,"individualShift")}function Yt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=Nt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+$.height(o)+$.depth(o)+l+$.depth(e)+i;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=$.height(e)-i;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=$.depth(e)+i;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return $.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const i=new Zt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Zt("","first")),i},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},ie={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var se=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in ie)if(ie[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return se(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new re("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=At.getInfo("\\"+i.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new re(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=At.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=se(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=At.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new re(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=At.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new re(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[i])return ue[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=fe[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=xe(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(i.test(xe(ue[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ce(t,e){let i;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Be()),i}function _e(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Te(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new te.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function Le(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ce(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(De(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||De(t[i],e)})))return!0;if(t.array)for(let i=_e(t.array);i>=0;i--)if(De(Ce(t.array,i),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Pe(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=qe(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Pe(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Pe(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Pe(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=qe(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=Ie(i[1],e),t+=qe(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Pe(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=qe(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=Ie(i[1],e),t+=qe(i[2],e),s=!0)),!s)if(i=Pe(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Pe(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+qe(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+qe(i.rest,e):i.match+qe(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+qe(i[2],e),s=!0)),t}function Pe(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=ve.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function Ie(t,e){let i=ve.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Be(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},we.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new we;s.path=me.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},we.prototype.setRange=function(t,e,i){i=i||{};const s=me.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),s)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Be()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&At.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=_e(e.array);i>=0;i--)t(Ce(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},we.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=_e(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=Se(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},we.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},we.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},we.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=At.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new te.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Be()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Be()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Be()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Be()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Be()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Me(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=Ae(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=At.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Oe={EditableMathlist:we,parseMathString:Ee};const Re={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Ke={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ne={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function $e(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=Ne[t.target.value]||t.target.value),e||(Re[t.key]?(e=Re[t.key],i=!1):e=Ke[t.key],e||(e=Ne[t.key.toLowerCase()])),!e&&t.code&&(e=Ke[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function We(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke($e(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke($e(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:$e,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
equal to","\\supseteq":"superset of or
equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
natural numbers","\\Z":"set of
integers","\\Q":"set of
rational numbers","\\C":"set of
complex numbers","\\R":"set of
real numbers","\\P":"set of
prime numbers","\\lesseqqgtr":"less than, equal to or
greater than","\\gnapprox":"greater than and
not approximately","\\lnapprox":"lesser than and
not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
")),e}function Ge(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&Ze(t,i),t.popover.classList.add("is-visible")}function Ze(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Xe(t);const s=e,a=function(t,e){const i=he.parseTokens(n(t),"math",null,e.config.macros),s=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=$.makeSpan(s,"ML__base"),o=$.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=$.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),$.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[s]||e,t),o=je(s),r=ve.forCommand(s);let l=i?'
':"";l+='',l+='
'+a+"
",o&&(l+='
'+o+"
"),r&&(l+='
'+r+"
"),l+="
",l+=i?'
':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Ye(this,this.array[s][e],t);s1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Ye(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Ye(this,this.shift,t)}em]`),i+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Ye(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ae(this.backgroundcolor)}}`),i+=`{${Ye(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Qe.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Qe.locale.substring(0,2),a="ordinal"===i.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[s]&&(o=Qe.strings[s][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const i=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ti={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ei={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ii={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let si={};const ai={math:"\n
\n
    \n
  • x
  • \n
  • n
  • \n
  • \n \n
  • \n
  • e
  • \n
  • i
  • \n
  • \n
\n
    \n
  • <
  • \n
  • >
  • \n
  • \n \n
  • \n
  • x ²
  • \n
  • x
  • \n
  • \n
\n
    \n
  • (
  • \n
  • )
  • \n
  • \n \n
  • \n
  • \n
  • \n
\n \n
    \n
  • \n
  • \n
  • \n \n
  • \n \n
\n
\n ","lower-roman":"\n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n
  • ∞≠
  • \n
  • ,
  • \n
  •  
  • \n \n
\n
","upper-roman":"\n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n
  • ∞≠
  • \n
  • ;
  • \n
  •  
  • \n \n
\n
",symbols:"\n
\n
    \n \n
  • {
  • \n
  • }
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • o
  • \n
  • \n
  • \n\n
\n
    \n \n
  • [
  • \n
  • ]
  • \n
  • \n
  • \n
  • \n
  • !
  • \n
  • o
  • \n
  • o
  • \n
  • \n
  • \n\n
\n
    \n \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n\n
  • \n
\n
    \n \n
  • abc
  • \n
  • \n
  • :
  • \n
  • \n
  • \n
  • \n
  • ±
  • \n \n
\n
","lower-greek":"\n
\n
  • φ
  • \n
  • ς
  • \n
  • ϵ
  • \n
  • ρ
  • \n
  • τ
  • \n
  • υ
  • \n
  • θ
  • \n
  • ι
  • \n
  • ο
  • \n
  • π
  • \n
\n
  • α
  • \n
  • σ
  • \n
  • δ
  • \n
  • ϕ
  • \n
  • γ
  • \n
  • η
  • \n
  • ξ
  • \n
  • κ
  • \n
  • λ
  • \n
\n
  • \n
  • ζ
  • \n
  • χ
  • \n
  • ψ
  • \n
  • ω
  • \n
  • β
  • \n
  • ν
  • \n
  • μ
  • \n
  • \n
\n
    \n
  •  
  • \n
  • ,
  • \n
  • ε
  • \n
  • ϑ
  • \n
  • ϰ
  • \n
  • ϖ
  • \n
  • ϱ
  • \n \n
\n
","upper-greek":"\n
\n
  • Φ
  • \n
  • Σ
  • \n
  • Ɛ
  • \n
  • Ρ
  • \n
  • Τ
  • \n
  • Υ
  • \n
  • Θ
  • \n
  • Ι
  • \n
  • Ο
  • \n
  • Π
\n
  • Α
  • \n
  • Σ
  • \n
  • Δ
  • \n
  • Φ
  • \n
  • Γ
  • \n
  • Η
  • \n
  • Ξ
  • \n
  • Κ
  • \n
  • Λ
\n
  • \n
  • Ζ
  • \n
  • Χ
  • \n
  • Ψ
  • \n
  • Ω
  • \n
  • Β
  • \n
  • Ν
  • \n
  • Μ
  • \n
\n
    \n
  •  
  • \n
  • .
  • \n
  •  
  • \n \n
\n
","lower-command":"\n
\n
\n
\n
\n
    \n
  • 01#
  • \n
  • {
  • \n
  • }
  • \n
  • ^
  • \n
  • _
  • \n
  •  
  • \n \n
\n
","upper-command":"\n
\n
\n
\n
\n
    \n
  • \n
  • [
  • \n
  • ]
  • \n
  • (
  • \n
  • )
  • \n
  •  
  • \n \n
\n
","symbols-command":"\n
\n
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 0
\n
  • !
  • @
  • #
  • $
  • %
  • ^
  • &
  • *
  • +
  • =
\n
    \n
  • \\
  • \n
  • |
  • \n
  • /
  • \n
  • `
  • \n
  • ;
  • \n
  • :
  • \n
  • ?
  • \n
  • '
  • \n
  • \"
  • \n
  • \n
\n
    \n
  • abc
  • \n
  • <
  • \n
  • >
  • \n
  • ~
  • \n
  • ,
  • \n
  • .
  • \n
  •  
  • \n \n
\n
",functions:"\n
\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
  • \n
  • (
  • \n
  • )
  • \n
  • \n
  • \n
  •  
  • \n \n
\n
",style:"\n
\n
    \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
    \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
    \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
    \n
  • \n
  • \n
  • \n\n
  • \n
  • \n
  • \n
  • \n
\n
"};function oi(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=he.parseTokens(n(t),"math",e,i.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=$.makeSpan(a,"ML__base"),r=$.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=$.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),$.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ni(t,e,i){let s="
";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ti,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
"+e[t].label+"
"}}return s+="
",s+=`\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n `,""}function ri(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ei[n]&&(a.setAttribute("data-shifted",ei[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ei[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=si[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function li(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ci={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ii["foreground-color"]=[];for(const t of ne)ii["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ii["background-color"]=[];for(const t of oe)ii["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});si={...ii},Object.keys(si).forEach(t=>{si[t]=si[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),si[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),si[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),si[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ai,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ti,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ni(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=li(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,ri(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:ri};const hi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},di={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},pi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function mi(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ui(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,gi(t)&&(n=t.index,t.index+=1),yi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=Si(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,gi(t)){const e=Si(t.atoms[n].superscript,0,0,i).mathML,s=Si(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=Si(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function gi(t){return t.index"+t,a+=Si(o.subscript,0,0,i).mathML,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=Si(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function xi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&gi(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Si(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function vi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Ai(t.atoms[l],i),a+=Si(t.atoms,l+1,c,i).mathML,a+=Ai(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function wi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Mi(e.body)+"":Ai(e,i);a+=r,t.index+=1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function Si(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Ai(t,e){let i="";const s=Mi(t.body);return s&&(i=""+s+""),i}function Mi(t){if(!t)return"";if("string"==typeof t)return mi(t);if(!Array.isArray(t)&&"string"==typeof t.body)return mi(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return mi(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Si(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(pi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+Si(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(pi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Si(this.numer,0,0,t).mathML||" ",c+=Si(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Si(this.numer,0,0,t).mathML+"",c+=""+Si(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Si(this.body,0,0,t).mathML,c+=Si(this.index,0,0,t).mathML,c+=""):(c+="",c+=Si(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Si(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(pi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Si(this.body,0,0,t).mathML,c+=""+(pi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):r?(c+=""+Si(l,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):n&&(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+ui(this.id,t)+">"+mi(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&pi[p]?""+pi[p]+"":Ai(this,t);break;case"mpunct":c='"+(pi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Si(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Si(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Si(t,0,0,e).mathML};const Ci={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_i={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ti={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Li={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fi(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Di(t){return t&&Li[t]||-1}function zi(t){return/=|=>/.test(t)?"right":"left"}function Ei(t){if("f"===t||"g"===t)return!0;const e=Ti[t];return!!e&&!!/%[^01_^]?/.test(e)}function qi(t){t=(t||"").trim();let e=Ci[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=At.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Pi(t){if(!t)return null;const e=qi(Ni(t)),i=[Di(e),zi(e)];return i[0]<=0?null:i}function Ii(t){return null!==Pi(t)}const Bi={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Oi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Ri={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Ki={",":"list",";":"list2"};function Ni(t){if(Array.isArray(t)){let e="";for(const i of t)e+=Ni(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=Ni(i);return e}return""}function $i(t){return"string"==typeof t.sym?function(t){let e=Ti[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=At.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Wi(t){return parseFloat(t.num)}function Hi(t){return"object"==typeof t&&void 0!==t.num}function Vi(t){let e=0;return Hi(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hs(t.num.re):0:parseFloat(t.num)),e}function Ui(t){let e=0;return Hi(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hs(t.num.im):0),e}function ji(t){return t&&void 0!==t.sup}function Gi(t){return t&&void 0!==t.sub}function Zi(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||Ni(a)===i),s}function Xi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Ji(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Yi(t){if(Hi(t)){const e=Vi(t),i=Ui(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Xi("negate",t)}function Qi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ts(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=rs(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test(Ni(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test(Ni(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ni(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=rs(i.superscript,e)):t.ast.sup=rs(i.superscript,e))):t.index+=1,t}function es(t,e){const i=t.ast;if(ss(t,"!!"))return t.index+=1,t.ast=Xi("factorial2",i),es(t=ts(t,e),e);if(ss(t,"++"))return t.index+=1,t.ast=Xi("increment",i),es(t=ts(t,e),e);if(ss(t,"--"))return t.index+=1,t.ast=Xi("decrement",i),es(t=ts(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Oi[s.latex.trim()]&&(t.ast=Xi(Oi[s.latex.trim()],i),t=es(t=ts(t,e),e)),t}function is(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ni(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"mclose"===o.type&&Ni(o)===i&&(Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s));else if("textord"===o.type&&Ni(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"textord"===o.type&&Ni(o)===i&&(t.index+=1,t=es(t=ts(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=os(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=es(t=ts(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=es(t=ts(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=rs(o.body,s),Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=At.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=At.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=is(t,e,i))return s&&(t.index+=1),t.ast={fn:Bi[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function ss(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ni(t.atoms[t.index])+Ni(t.atoms[t.index+1])}function as(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zi(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=|\*\*|\+\+|--)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,Zi(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zi(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function os(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qi(Ni(s));if(as(e))e.ast=Xi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Yi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Xi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ns(t)))),e=[t])}return e}function rs(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=os(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Xi("text",...i):i[0]||void 0}({atoms:ns(t)},e)}function ls(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function cs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hs(t){return parseFloat(parseFloat(t).toPrecision(15))}function ds(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=cs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=cs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=cs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=hs(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=cs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=cs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}te.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=he.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=he.parseTokens(n(s),"math",null,t.macros),o=Xi("divide",rs(i,t),rs(s,t))):o.fn="divide"):o.group=rs(this.body,t);break;case"genfrac":o=Xi("divide",rs(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Ji(1):rs(this.denom,t));break;case"surd":o=this.index?Xi("pow",rs(this.body,t),Xi("divide",1,rs(this.index,t))):Xi("sqrt",rs(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qi(Ni(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=rs(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xi("card",rs(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>rs(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(rs(e[0],t));let s=rs(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return rs(t,e)};var ps=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hi(e)){const i=Wi(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":ds(e.num,s);else{const t=Vi(e),i=Ui(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ds(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?ds(i,s):"")+"\\imaginaryI "))}ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Hi(e.group)||$i(e.group)?0!==Ui(e.group)&&(a=ls(e.fence||"(),",a)):a=ls(e.fence||"(),",a),ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fi(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Fi(e,1));else{let i="";for(let s=1;s=2)a=t(Fi(e,0),s),Hi(Fi(e,0))||$i(Fi(e,0))||(a=ls(e.fence||"(),",a)),a+="^{"+t(Fi(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ti[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ls(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fi(e,0),s),r=t(Fi(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ls(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ls(e.fence||"(),","");a=ji(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Gi(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ls("() ",t(a,s))):0!==Vi(o=a)&&0!==Ui(o)?i.push(ls("() ",t(a,s))):ji(e)&&0!==Ui(a)&&1!==Ui(a)?i.push(ls("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hi(e.arg[0])&&"divide"!==e.arg[0].fn||Hi(e.arg[1])&&(0!==Vi(e.arg[1])||1!==Ui(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hi(e.arg[0])&&Wi(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function us(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function fs(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function gs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function ys(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function bs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function xs(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ks(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let i=te.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else us(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ms[t.leftDelim]||t.leftDelim,s+=te.toSpeakableFragment(t.body,e),s+=ms[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ms[a]||(o?ms[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ms[t.body]||ms[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),us(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(us(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),us(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},te.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=te.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=te.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class vs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gs(this.element,"focus",this),gs(this.element,"blur",this),gs(this.textarea,"cut",this),gs(this.textarea,"copy",this),gs(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gs(this.field,"pointerdown",this):gs(this.field,"touchstart:active mousedown",this),gs(window,"resize",this);const o={...e};o.onSelectionDidChange=vs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Oe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ks(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ys(this.textarea,"cut",this),ys(this.textarea,"copy",this),ys(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xs(this.popover),xs(this.keystrokeCaption),xs(this.virtualKeyboard),xs(document.getElementById("mathlive-alternate-keys-panel")),ys(this.element,"pointerdown",this),ys(this.element,"touchstart:active mousedown",this),ys(this.element,"focus",this),ys(this.element,"blur",this),ys(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=me.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){if(this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,i=this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=me.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||Ss>2?(n(t),3!==t.detail&&3!==Ss||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(gs(e.field,"pointermove",h),gs(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gs(window,"blur",n),t.touches?(gs(t.target,"touchmove",h),gs(t.target,"touchend",n)):(gs(window,"mousemove",h),gs(window,"mouseup",n))),2!==t.detail&&2!==Ss||(a=!0,this.mathlist.selectGroup_()))}}else ws=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return As(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=As(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=ve.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=At.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;iks(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1});const e=this.$hasFocus();this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0});const i=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=$.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=$.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=$.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=$.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=hi[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&hi[a]?hi[a]:a&&di[a]?di[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=di[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=te.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const i=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=he.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Je.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gs(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),gs(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gs(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ci.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xs(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=te.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ws,Ss=0;function As(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(i,s)}function Ms(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=As(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=As(t,"",t.mathlist.sibling(0)):"line"===e?(a=As(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?As(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vs.prototype.undo_=vs.prototype.undo,vs.prototype.redo_=vs.prototype.redo,vs.prototype.scrollIntoView_=vs.prototype.scrollIntoView,vs.prototype.scrollToStart_=vs.prototype.scrollToStart,vs.prototype.scrollToEnd_=vs.prototype.scrollToEnd,vs.prototype.insert_=vs.prototype.$insert;var Cs={isValidMathfield:ks,MathField:vs};function _s(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_s(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ds(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Fs(t,void 0,e,!0));else{const s=Ls(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Os(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function Rs(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Ks(t,e){Es&&((e=e||{}).renderToMarkup=e.renderToMarkup||qs,e.renderToMathML=e.renderToMathML||Ps,e.renderToSpeakableText=e.renderToSpeakableText||Is,e.macros=e.macros||At.MACROS,Es.renderMathInElement(Rs(t),e))}function Ns(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}return{latexToMarkup:qs,latexToMathML:Ps,latexToSpeakableText:Is,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const i=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(i,e)},astToLatex:function(t,e){return ps(t,e)},makeMathField:function(t,e){if(!Cs)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Bs,e.handleReadAloud=e.handleReadAloud||Os,new Cs.MathField(Rs(t),e)},renderMathInDocument:function(t){Ks(document.body,t)},renderMathInElement:Ks,revertToOriginalContent:function(t,e){(t=(t=Rs(t)).children[1])instanceof Cs.MathField?t.revertToOriginalContent():(Ns(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Rs(t)).children[1])instanceof Cs.MathField?t.originalContent:(Ns(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Os,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s= 1) { + const s = t.charCodeAt(e - 1), + a = i; + return 55296 <= s && s <= 56319 + ? 1024 * (s - 55296) + (a - 56320) + 65536 + : a; + } + return i; + } + function e(e, s) { + if ((s = s || 0) < 0) return 0; + if (s >= e.length - 1) return e.length; + let a = i(t(e, s)); + for (let r = s + 1; r < e.length; r++) { + if ( + 55296 <= e.charCodeAt(r - 1) && + e.charCodeAt(r - 1) <= 56319 && + 56320 <= e.charCodeAt(r) && + e.charCodeAt(r) <= 57343 + ) + continue; + const s = i(t(e, r)); + if ( + ((n = s), + !( + (11 === (o = a) && 12 === n) || + (3 === o && 11 === n) || + (11 === o && 3 === n) || + (0 === o && 1 === n) || + (2 !== o && + 0 !== o && + 1 !== o && + 2 !== n && + 0 !== n && + 1 !== n && + ((6 === o && + (6 === n || 7 === n || 9 === n || 10 === n)) || + !( + (9 !== o && 7 !== o) || + (7 !== n && 8 !== n) + ) || + ((10 === o || 8 === o) && 8 === n) || + (4 === o && 4 === n) || + 3 === n || + 5 === n)) + )) + ) + return r; + a = s; + } + var o, n; + return e.length; + } + function i(t) { + return 13 === t + ? 0 + : 10 === t + ? 1 + : (0 <= t && t <= 9) || + (11 <= t && t <= 12) || + (14 <= t && t <= 31) || + (127 <= t && t <= 159) || + 173 === t || + (1536 <= t && t <= 1541) || + 1564 === t || + 1757 === t || + 1807 === t || + 6158 === t || + 8203 === t || + (8206 <= t && t <= 8207) || + 8232 === t || + 8233 === t || + (8234 <= t && t <= 8238) || + (8288 <= t && t <= 8292) || + 8293 === t || + (8294 <= t && t <= 8303) || + (55296 <= t && t <= 57343) || + 65279 === t || + (65520 <= t && t <= 65528) || + (65529 <= t && t <= 65531) || + 69821 === t || + (113824 <= t && t <= 113827) || + (119155 <= t && t <= 119162) || + 917504 === t || + 917505 === t || + (917506 <= t && t <= 917535) || + (917536 <= t && t <= 917631) || + (917632 <= t && t <= 917759) || + (918e3 <= t && t <= 921599) + ? 2 + : (768 <= t && t <= 879) || + (1155 <= t && t <= 1159) || + (1160 <= t && t <= 1161) || + (1425 <= t && t <= 1469) || + 1471 === t || + (1473 <= t && t <= 1474) || + (1476 <= t && t <= 1477) || + 1479 === t || + (1552 <= t && t <= 1562) || + (1611 <= t && t <= 1631) || + 1648 === t || + (1750 <= t && t <= 1756) || + (1759 <= t && t <= 1764) || + (1767 <= t && t <= 1768) || + (1770 <= t && t <= 1773) || + 1809 === t || + (1840 <= t && t <= 1866) || + (1958 <= t && t <= 1968) || + (2027 <= t && t <= 2035) || + (2070 <= t && t <= 2073) || + (2075 <= t && t <= 2083) || + (2085 <= t && t <= 2087) || + (2089 <= t && t <= 2093) || + (2137 <= t && t <= 2139) || + (2275 <= t && t <= 2306) || + 2362 === t || + 2364 === t || + (2369 <= t && t <= 2376) || + 2381 === t || + (2385 <= t && t <= 2391) || + (2402 <= t && t <= 2403) || + 2433 === t || + 2492 === t || + 2494 === t || + (2497 <= t && t <= 2500) || + 2509 === t || + 2519 === t || + (2530 <= t && t <= 2531) || + (2561 <= t && t <= 2562) || + 2620 === t || + (2625 <= t && t <= 2626) || + (2631 <= t && t <= 2632) || + (2635 <= t && t <= 2637) || + 2641 === t || + (2672 <= t && t <= 2673) || + 2677 === t || + (2689 <= t && t <= 2690) || + 2748 === t || + (2753 <= t && t <= 2757) || + (2759 <= t && t <= 2760) || + 2765 === t || + (2786 <= t && t <= 2787) || + 2817 === t || + 2876 === t || + 2878 === t || + 2879 === t || + (2881 <= t && t <= 2884) || + 2893 === t || + 2902 === t || + 2903 === t || + (2914 <= t && t <= 2915) || + 2946 === t || + 3006 === t || + 3008 === t || + 3021 === t || + 3031 === t || + 3072 === t || + (3134 <= t && t <= 3136) || + (3142 <= t && t <= 3144) || + (3146 <= t && t <= 3149) || + (3157 <= t && t <= 3158) || + (3170 <= t && t <= 3171) || + 3201 === t || + 3260 === t || + 3263 === t || + 3266 === t || + 3270 === t || + (3276 <= t && t <= 3277) || + (3285 <= t && t <= 3286) || + (3298 <= t && t <= 3299) || + 3329 === t || + 3390 === t || + (3393 <= t && t <= 3396) || + 3405 === t || + 3415 === t || + (3426 <= t && t <= 3427) || + 3530 === t || + 3535 === t || + (3538 <= t && t <= 3540) || + 3542 === t || + 3551 === t || + 3633 === t || + (3636 <= t && t <= 3642) || + (3655 <= t && t <= 3662) || + 3761 === t || + (3764 <= t && t <= 3769) || + (3771 <= t && t <= 3772) || + (3784 <= t && t <= 3789) || + (3864 <= t && t <= 3865) || + 3893 === t || + 3895 === t || + 3897 === t || + (3953 <= t && t <= 3966) || + (3968 <= t && t <= 3972) || + (3974 <= t && t <= 3975) || + (3981 <= t && t <= 3991) || + (3993 <= t && t <= 4028) || + 4038 === t || + (4141 <= t && t <= 4144) || + (4146 <= t && t <= 4151) || + (4153 <= t && t <= 4154) || + (4157 <= t && t <= 4158) || + (4184 <= t && t <= 4185) || + (4190 <= t && t <= 4192) || + (4209 <= t && t <= 4212) || + 4226 === t || + (4229 <= t && t <= 4230) || + 4237 === t || + 4253 === t || + (4957 <= t && t <= 4959) || + (5906 <= t && t <= 5908) || + (5938 <= t && t <= 5940) || + (5970 <= t && t <= 5971) || + (6002 <= t && t <= 6003) || + (6068 <= t && t <= 6069) || + (6071 <= t && t <= 6077) || + 6086 === t || + (6089 <= t && t <= 6099) || + 6109 === t || + (6155 <= t && t <= 6157) || + 6313 === t || + (6432 <= t && t <= 6434) || + (6439 <= t && t <= 6440) || + 6450 === t || + (6457 <= t && t <= 6459) || + (6679 <= t && t <= 6680) || + 6683 === t || + 6742 === t || + (6744 <= t && t <= 6750) || + 6752 === t || + 6754 === t || + (6757 <= t && t <= 6764) || + (6771 <= t && t <= 6780) || + 6783 === t || + (6832 <= t && t <= 6845) || + 6846 === t || + (6912 <= t && t <= 6915) || + 6964 === t || + (6966 <= t && t <= 6970) || + 6972 === t || + 6978 === t || + (7019 <= t && t <= 7027) || + (7040 <= t && t <= 7041) || + (7074 <= t && t <= 7077) || + (7080 <= t && t <= 7081) || + (7083 <= t && t <= 7085) || + 7142 === t || + (7144 <= t && t <= 7145) || + 7149 === t || + (7151 <= t && t <= 7153) || + (7212 <= t && t <= 7219) || + (7222 <= t && t <= 7223) || + (7376 <= t && t <= 7378) || + (7380 <= t && t <= 7392) || + (7394 <= t && t <= 7400) || + 7405 === t || + 7412 === t || + (7416 <= t && t <= 7417) || + (7616 <= t && t <= 7669) || + (7676 <= t && t <= 7679) || + (8204 <= t && t <= 8205) || + (8400 <= t && t <= 8412) || + (8413 <= t && t <= 8416) || + 8417 === t || + (8418 <= t && t <= 8420) || + (8421 <= t && t <= 8432) || + (11503 <= t && t <= 11505) || + 11647 === t || + (11744 <= t && t <= 11775) || + (12330 <= t && t <= 12333) || + (12334 <= t && t <= 12335) || + (12441 <= t && t <= 12442) || + 42607 === t || + (42608 <= t && t <= 42610) || + (42612 <= t && t <= 42621) || + (42654 <= t && t <= 42655) || + (42736 <= t && t <= 42737) || + 43010 === t || + 43014 === t || + 43019 === t || + (43045 <= t && t <= 43046) || + 43204 === t || + (43232 <= t && t <= 43249) || + (43302 <= t && t <= 43309) || + (43335 <= t && t <= 43345) || + (43392 <= t && t <= 43394) || + 43443 === t || + (43446 <= t && t <= 43449) || + 43452 === t || + 43493 === t || + (43561 <= t && t <= 43566) || + (43569 <= t && t <= 43570) || + (43573 <= t && t <= 43574) || + 43587 === t || + 43596 === t || + 43644 === t || + 43696 === t || + (43698 <= t && t <= 43700) || + (43703 <= t && t <= 43704) || + (43710 <= t && t <= 43711) || + 43713 === t || + (43756 <= t && t <= 43757) || + 43766 === t || + 44005 === t || + 44008 === t || + 44013 === t || + 64286 === t || + (65024 <= t && t <= 65039) || + (65056 <= t && t <= 65071) || + (65438 <= t && t <= 65439) || + 66045 === t || + 66272 === t || + (66422 <= t && t <= 66426) || + (68097 <= t && t <= 68099) || + (68101 <= t && t <= 68102) || + (68108 <= t && t <= 68111) || + (68152 <= t && t <= 68154) || + 68159 === t || + (68325 <= t && t <= 68326) || + 69633 === t || + (69688 <= t && t <= 69702) || + (69759 <= t && t <= 69761) || + (69811 <= t && t <= 69814) || + (69817 <= t && t <= 69818) || + (69888 <= t && t <= 69890) || + (69927 <= t && t <= 69931) || + (69933 <= t && t <= 69940) || + 70003 === t || + (70016 <= t && t <= 70017) || + (70070 <= t && t <= 70078) || + (70090 <= t && t <= 70092) || + (70191 <= t && t <= 70193) || + 70196 === t || + (70198 <= t && t <= 70199) || + 70367 === t || + (70371 <= t && t <= 70378) || + (70400 <= t && t <= 70401) || + 70460 === t || + 70462 === t || + 70464 === t || + 70487 === t || + (70502 <= t && t <= 70508) || + (70512 <= t && t <= 70516) || + 70832 === t || + (70835 <= t && t <= 70840) || + 70842 === t || + 70845 === t || + (70847 <= t && t <= 70848) || + (70850 <= t && t <= 70851) || + 71087 === t || + (71090 <= t && t <= 71093) || + (71100 <= t && t <= 71101) || + (71103 <= t && t <= 71104) || + (71132 <= t && t <= 71133) || + (71219 <= t && t <= 71226) || + 71229 === t || + (71231 <= t && t <= 71232) || + 71339 === t || + 71341 === t || + (71344 <= t && t <= 71349) || + 71351 === t || + (71453 <= t && t <= 71455) || + (71458 <= t && t <= 71461) || + (71463 <= t && t <= 71467) || + (92912 <= t && t <= 92916) || + (92976 <= t && t <= 92982) || + (94095 <= t && t <= 94098) || + (113821 <= t && t <= 113822) || + 119141 === t || + (119143 <= t && t <= 119145) || + (119150 <= t && t <= 119154) || + (119163 <= t && t <= 119170) || + (119173 <= t && t <= 119179) || + (119210 <= t && t <= 119213) || + (119362 <= t && t <= 119364) || + (121344 <= t && t <= 121398) || + (121403 <= t && t <= 121452) || + 121461 === t || + 121476 === t || + (121499 <= t && t <= 121503) || + (121505 <= t && t <= 121519) || + (125136 <= t && t <= 125142) || + (917760 <= t && t <= 917999) + ? 3 + : 127462 <= t && t <= 127487 + ? 4 + : 127995 <= t && t <= 127999 + ? 12 + : 2307 === t || + 2363 === t || + (2366 <= t && t <= 2368) || + (2377 <= t && t <= 2380) || + (2382 <= t && t <= 2383) || + (2434 <= t && t <= 2435) || + (2495 <= t && t <= 2496) || + (2503 <= t && t <= 2504) || + (2507 <= t && t <= 2508) || + 2563 === t || + (2622 <= t && t <= 2624) || + 2691 === t || + (2750 <= t && t <= 2752) || + 2761 === t || + (2763 <= t && t <= 2764) || + (2818 <= t && t <= 2819) || + 2880 === t || + (2887 <= t && t <= 2888) || + (2891 <= t && t <= 2892) || + 3007 === t || + (3009 <= t && t <= 3010) || + (3014 <= t && t <= 3016) || + (3018 <= t && t <= 3020) || + (3073 <= t && t <= 3075) || + (3137 <= t && t <= 3140) || + (3202 <= t && t <= 3203) || + 3262 === t || + (3264 <= t && t <= 3265) || + (3267 <= t && t <= 3268) || + (3271 <= t && t <= 3272) || + (3274 <= t && t <= 3275) || + (3330 <= t && t <= 3331) || + (3391 <= t && t <= 3392) || + (3398 <= t && t <= 3400) || + (3402 <= t && t <= 3404) || + (3458 <= t && t <= 3459) || + (3536 <= t && t <= 3537) || + (3544 <= t && t <= 3550) || + (3570 <= t && t <= 3571) || + 3635 === t || + 3763 === t || + (3902 <= t && t <= 3903) || + 3967 === t || + 4145 === t || + (4155 <= t && t <= 4156) || + (4182 <= t && t <= 4183) || + 4228 === t || + 6070 === t || + (6078 <= t && t <= 6085) || + (6087 <= t && t <= 6088) || + (6435 <= t && t <= 6438) || + (6441 <= t && t <= 6443) || + (6448 <= t && t <= 6449) || + (6451 <= t && t <= 6456) || + (6681 <= t && t <= 6682) || + 6741 === t || + 6743 === t || + (6765 <= t && t <= 6770) || + 6916 === t || + 6965 === t || + 6971 === t || + (6973 <= t && t <= 6977) || + (6979 <= t && t <= 6980) || + 7042 === t || + 7073 === t || + (7078 <= t && t <= 7079) || + 7082 === t || + 7143 === t || + (7146 <= t && t <= 7148) || + 7150 === t || + (7154 <= t && t <= 7155) || + (7204 <= t && t <= 7211) || + (7220 <= t && t <= 7221) || + 7393 === t || + (7410 <= t && t <= 7411) || + (43043 <= t && t <= 43044) || + 43047 === t || + (43136 <= t && t <= 43137) || + (43188 <= t && t <= 43203) || + (43346 <= t && t <= 43347) || + 43395 === t || + (43444 <= t && t <= 43445) || + (43450 <= t && t <= 43451) || + (43453 <= t && t <= 43456) || + (43567 <= t && t <= 43568) || + (43571 <= t && t <= 43572) || + 43597 === t || + 43755 === t || + (43758 <= t && t <= 43759) || + 43765 === t || + (44003 <= t && t <= 44004) || + (44006 <= t && t <= 44007) || + (44009 <= t && t <= 44010) || + 44012 === t || + 69632 === t || + 69634 === t || + 69762 === t || + (69808 <= t && t <= 69810) || + (69815 <= t && t <= 69816) || + 69932 === t || + 70018 === t || + (70067 <= t && t <= 70069) || + (70079 <= t && t <= 70080) || + (70188 <= t && t <= 70190) || + (70194 <= t && t <= 70195) || + 70197 === t || + (70368 <= t && t <= 70370) || + (70402 <= t && t <= 70403) || + 70463 === t || + (70465 <= t && t <= 70468) || + (70471 <= t && t <= 70472) || + (70475 <= t && t <= 70477) || + (70498 <= t && t <= 70499) || + (70833 <= t && t <= 70834) || + 70841 === t || + (70843 <= t && t <= 70844) || + 70846 === t || + 70849 === t || + (71088 <= t && t <= 71089) || + (71096 <= t && t <= 71099) || + 71102 === t || + (71216 <= t && t <= 71218) || + (71227 <= t && t <= 71228) || + 71230 === t || + 71340 === t || + (71342 <= t && t <= 71343) || + 71350 === t || + (71456 <= t && t <= 71457) || + 71462 === t || + (94033 <= t && t <= 94078) || + 119142 === t || + 119149 === t + ? 5 + : (4352 <= t && t <= 4447) || (43360 <= t && t <= 43388) + ? 6 + : (4448 <= t && t <= 4519) || (55216 <= t && t <= 55238) + ? 7 + : (4520 <= t && t <= 4607) || (55243 <= t && t <= 55291) + ? 8 + : 44032 === t || + 44060 === t || + 44088 === t || + 44116 === t || + 44144 === t || + 44172 === t || + 44200 === t || + 44228 === t || + 44256 === t || + 44284 === t || + 44312 === t || + 44340 === t || + 44368 === t || + 44396 === t || + 44424 === t || + 44452 === t || + 44480 === t || + 44508 === t || + 44536 === t || + 44564 === t || + 44592 === t || + 44620 === t || + 44648 === t || + 44676 === t || + 44704 === t || + 44732 === t || + 44760 === t || + 44788 === t || + 44816 === t || + 44844 === t || + 44872 === t || + 44900 === t || + 44928 === t || + 44956 === t || + 44984 === t || + 45012 === t || + 45040 === t || + 45068 === t || + 45096 === t || + 45124 === t || + 45152 === t || + 45180 === t || + 45208 === t || + 45236 === t || + 45264 === t || + 45292 === t || + 45320 === t || + 45348 === t || + 45376 === t || + 45404 === t || + 45432 === t || + 45460 === t || + 45488 === t || + 45516 === t || + 45544 === t || + 45572 === t || + 45600 === t || + 45628 === t || + 45656 === t || + 45684 === t || + 45712 === t || + 45740 === t || + 45768 === t || + 45796 === t || + 45824 === t || + 45852 === t || + 45880 === t || + 45908 === t || + 45936 === t || + 45964 === t || + 45992 === t || + 46020 === t || + 46048 === t || + 46076 === t || + 46104 === t || + 46132 === t || + 46160 === t || + 46188 === t || + 46216 === t || + 46244 === t || + 46272 === t || + 46300 === t || + 46328 === t || + 46356 === t || + 46384 === t || + 46412 === t || + 46440 === t || + 46468 === t || + 46496 === t || + 46524 === t || + 46552 === t || + 46580 === t || + 46608 === t || + 46636 === t || + 46664 === t || + 46692 === t || + 46720 === t || + 46748 === t || + 46776 === t || + 46804 === t || + 46832 === t || + 46860 === t || + 46888 === t || + 46916 === t || + 46944 === t || + 46972 === t || + 47e3 === t || + 47028 === t || + 47056 === t || + 47084 === t || + 47112 === t || + 47140 === t || + 47168 === t || + 47196 === t || + 47224 === t || + 47252 === t || + 47280 === t || + 47308 === t || + 47336 === t || + 47364 === t || + 47392 === t || + 47420 === t || + 47448 === t || + 47476 === t || + 47504 === t || + 47532 === t || + 47560 === t || + 47588 === t || + 47616 === t || + 47644 === t || + 47672 === t || + 47700 === t || + 47728 === t || + 47756 === t || + 47784 === t || + 47812 === t || + 47840 === t || + 47868 === t || + 47896 === t || + 47924 === t || + 47952 === t || + 47980 === t || + 48008 === t || + 48036 === t || + 48064 === t || + 48092 === t || + 48120 === t || + 48148 === t || + 48176 === t || + 48204 === t || + 48232 === t || + 48260 === t || + 48288 === t || + 48316 === t || + 48344 === t || + 48372 === t || + 48400 === t || + 48428 === t || + 48456 === t || + 48484 === t || + 48512 === t || + 48540 === t || + 48568 === t || + 48596 === t || + 48624 === t || + 48652 === t || + 48680 === t || + 48708 === t || + 48736 === t || + 48764 === t || + 48792 === t || + 48820 === t || + 48848 === t || + 48876 === t || + 48904 === t || + 48932 === t || + 48960 === t || + 48988 === t || + 49016 === t || + 49044 === t || + 49072 === t || + 49100 === t || + 49128 === t || + 49156 === t || + 49184 === t || + 49212 === t || + 49240 === t || + 49268 === t || + 49296 === t || + 49324 === t || + 49352 === t || + 49380 === t || + 49408 === t || + 49436 === t || + 49464 === t || + 49492 === t || + 49520 === t || + 49548 === t || + 49576 === t || + 49604 === t || + 49632 === t || + 49660 === t || + 49688 === t || + 49716 === t || + 49744 === t || + 49772 === t || + 49800 === t || + 49828 === t || + 49856 === t || + 49884 === t || + 49912 === t || + 49940 === t || + 49968 === t || + 49996 === t || + 50024 === t || + 50052 === t || + 50080 === t || + 50108 === t || + 50136 === t || + 50164 === t || + 50192 === t || + 50220 === t || + 50248 === t || + 50276 === t || + 50304 === t || + 50332 === t || + 50360 === t || + 50388 === t || + 50416 === t || + 50444 === t || + 50472 === t || + 50500 === t || + 50528 === t || + 50556 === t || + 50584 === t || + 50612 === t || + 50640 === t || + 50668 === t || + 50696 === t || + 50724 === t || + 50752 === t || + 50780 === t || + 50808 === t || + 50836 === t || + 50864 === t || + 50892 === t || + 50920 === t || + 50948 === t || + 50976 === t || + 51004 === t || + 51032 === t || + 51060 === t || + 51088 === t || + 51116 === t || + 51144 === t || + 51172 === t || + 51200 === t || + 51228 === t || + 51256 === t || + 51284 === t || + 51312 === t || + 51340 === t || + 51368 === t || + 51396 === t || + 51424 === t || + 51452 === t || + 51480 === t || + 51508 === t || + 51536 === t || + 51564 === t || + 51592 === t || + 51620 === t || + 51648 === t || + 51676 === t || + 51704 === t || + 51732 === t || + 51760 === t || + 51788 === t || + 51816 === t || + 51844 === t || + 51872 === t || + 51900 === t || + 51928 === t || + 51956 === t || + 51984 === t || + 52012 === t || + 52040 === t || + 52068 === t || + 52096 === t || + 52124 === t || + 52152 === t || + 52180 === t || + 52208 === t || + 52236 === t || + 52264 === t || + 52292 === t || + 52320 === t || + 52348 === t || + 52376 === t || + 52404 === t || + 52432 === t || + 52460 === t || + 52488 === t || + 52516 === t || + 52544 === t || + 52572 === t || + 52600 === t || + 52628 === t || + 52656 === t || + 52684 === t || + 52712 === t || + 52740 === t || + 52768 === t || + 52796 === t || + 52824 === t || + 52852 === t || + 52880 === t || + 52908 === t || + 52936 === t || + 52964 === t || + 52992 === t || + 53020 === t || + 53048 === t || + 53076 === t || + 53104 === t || + 53132 === t || + 53160 === t || + 53188 === t || + 53216 === t || + 53244 === t || + 53272 === t || + 53300 === t || + 53328 === t || + 53356 === t || + 53384 === t || + 53412 === t || + 53440 === t || + 53468 === t || + 53496 === t || + 53524 === t || + 53552 === t || + 53580 === t || + 53608 === t || + 53636 === t || + 53664 === t || + 53692 === t || + 53720 === t || + 53748 === t || + 53776 === t || + 53804 === t || + 53832 === t || + 53860 === t || + 53888 === t || + 53916 === t || + 53944 === t || + 53972 === t || + 54e3 === t || + 54028 === t || + 54056 === t || + 54084 === t || + 54112 === t || + 54140 === t || + 54168 === t || + 54196 === t || + 54224 === t || + 54252 === t || + 54280 === t || + 54308 === t || + 54336 === t || + 54364 === t || + 54392 === t || + 54420 === t || + 54448 === t || + 54476 === t || + 54504 === t || + 54532 === t || + 54560 === t || + 54588 === t || + 54616 === t || + 54644 === t || + 54672 === t || + 54700 === t || + 54728 === t || + 54756 === t || + 54784 === t || + 54812 === t || + 54840 === t || + 54868 === t || + 54896 === t || + 54924 === t || + 54952 === t || + 54980 === t || + 55008 === t || + 55036 === t || + 55064 === t || + 55092 === t || + 55120 === t || + 55148 === t || + 55176 === t + ? 9 + : (44033 <= t && t <= 44059) || + (44061 <= t && t <= 44087) || + (44089 <= t && t <= 44115) || + (44117 <= t && t <= 44143) || + (44145 <= t && t <= 44171) || + (44173 <= t && t <= 44199) || + (44201 <= t && t <= 44227) || + (44229 <= t && t <= 44255) || + (44257 <= t && t <= 44283) || + (44285 <= t && t <= 44311) || + (44313 <= t && t <= 44339) || + (44341 <= t && t <= 44367) || + (44369 <= t && t <= 44395) || + (44397 <= t && t <= 44423) || + (44425 <= t && t <= 44451) || + (44453 <= t && t <= 44479) || + (44481 <= t && t <= 44507) || + (44509 <= t && t <= 44535) || + (44537 <= t && t <= 44563) || + (44565 <= t && t <= 44591) || + (44593 <= t && t <= 44619) || + (44621 <= t && t <= 44647) || + (44649 <= t && t <= 44675) || + (44677 <= t && t <= 44703) || + (44705 <= t && t <= 44731) || + (44733 <= t && t <= 44759) || + (44761 <= t && t <= 44787) || + (44789 <= t && t <= 44815) || + (44817 <= t && t <= 44843) || + (44845 <= t && t <= 44871) || + (44873 <= t && t <= 44899) || + (44901 <= t && t <= 44927) || + (44929 <= t && t <= 44955) || + (44957 <= t && t <= 44983) || + (44985 <= t && t <= 45011) || + (45013 <= t && t <= 45039) || + (45041 <= t && t <= 45067) || + (45069 <= t && t <= 45095) || + (45097 <= t && t <= 45123) || + (45125 <= t && t <= 45151) || + (45153 <= t && t <= 45179) || + (45181 <= t && t <= 45207) || + (45209 <= t && t <= 45235) || + (45237 <= t && t <= 45263) || + (45265 <= t && t <= 45291) || + (45293 <= t && t <= 45319) || + (45321 <= t && t <= 45347) || + (45349 <= t && t <= 45375) || + (45377 <= t && t <= 45403) || + (45405 <= t && t <= 45431) || + (45433 <= t && t <= 45459) || + (45461 <= t && t <= 45487) || + (45489 <= t && t <= 45515) || + (45517 <= t && t <= 45543) || + (45545 <= t && t <= 45571) || + (45573 <= t && t <= 45599) || + (45601 <= t && t <= 45627) || + (45629 <= t && t <= 45655) || + (45657 <= t && t <= 45683) || + (45685 <= t && t <= 45711) || + (45713 <= t && t <= 45739) || + (45741 <= t && t <= 45767) || + (45769 <= t && t <= 45795) || + (45797 <= t && t <= 45823) || + (45825 <= t && t <= 45851) || + (45853 <= t && t <= 45879) || + (45881 <= t && t <= 45907) || + (45909 <= t && t <= 45935) || + (45937 <= t && t <= 45963) || + (45965 <= t && t <= 45991) || + (45993 <= t && t <= 46019) || + (46021 <= t && t <= 46047) || + (46049 <= t && t <= 46075) || + (46077 <= t && t <= 46103) || + (46105 <= t && t <= 46131) || + (46133 <= t && t <= 46159) || + (46161 <= t && t <= 46187) || + (46189 <= t && t <= 46215) || + (46217 <= t && t <= 46243) || + (46245 <= t && t <= 46271) || + (46273 <= t && t <= 46299) || + (46301 <= t && t <= 46327) || + (46329 <= t && t <= 46355) || + (46357 <= t && t <= 46383) || + (46385 <= t && t <= 46411) || + (46413 <= t && t <= 46439) || + (46441 <= t && t <= 46467) || + (46469 <= t && t <= 46495) || + (46497 <= t && t <= 46523) || + (46525 <= t && t <= 46551) || + (46553 <= t && t <= 46579) || + (46581 <= t && t <= 46607) || + (46609 <= t && t <= 46635) || + (46637 <= t && t <= 46663) || + (46665 <= t && t <= 46691) || + (46693 <= t && t <= 46719) || + (46721 <= t && t <= 46747) || + (46749 <= t && t <= 46775) || + (46777 <= t && t <= 46803) || + (46805 <= t && t <= 46831) || + (46833 <= t && t <= 46859) || + (46861 <= t && t <= 46887) || + (46889 <= t && t <= 46915) || + (46917 <= t && t <= 46943) || + (46945 <= t && t <= 46971) || + (46973 <= t && t <= 46999) || + (47001 <= t && t <= 47027) || + (47029 <= t && t <= 47055) || + (47057 <= t && t <= 47083) || + (47085 <= t && t <= 47111) || + (47113 <= t && t <= 47139) || + (47141 <= t && t <= 47167) || + (47169 <= t && t <= 47195) || + (47197 <= t && t <= 47223) || + (47225 <= t && t <= 47251) || + (47253 <= t && t <= 47279) || + (47281 <= t && t <= 47307) || + (47309 <= t && t <= 47335) || + (47337 <= t && t <= 47363) || + (47365 <= t && t <= 47391) || + (47393 <= t && t <= 47419) || + (47421 <= t && t <= 47447) || + (47449 <= t && t <= 47475) || + (47477 <= t && t <= 47503) || + (47505 <= t && t <= 47531) || + (47533 <= t && t <= 47559) || + (47561 <= t && t <= 47587) || + (47589 <= t && t <= 47615) || + (47617 <= t && t <= 47643) || + (47645 <= t && t <= 47671) || + (47673 <= t && t <= 47699) || + (47701 <= t && t <= 47727) || + (47729 <= t && t <= 47755) || + (47757 <= t && t <= 47783) || + (47785 <= t && t <= 47811) || + (47813 <= t && t <= 47839) || + (47841 <= t && t <= 47867) || + (47869 <= t && t <= 47895) || + (47897 <= t && t <= 47923) || + (47925 <= t && t <= 47951) || + (47953 <= t && t <= 47979) || + (47981 <= t && t <= 48007) || + (48009 <= t && t <= 48035) || + (48037 <= t && t <= 48063) || + (48065 <= t && t <= 48091) || + (48093 <= t && t <= 48119) || + (48121 <= t && t <= 48147) || + (48149 <= t && t <= 48175) || + (48177 <= t && t <= 48203) || + (48205 <= t && t <= 48231) || + (48233 <= t && t <= 48259) || + (48261 <= t && t <= 48287) || + (48289 <= t && t <= 48315) || + (48317 <= t && t <= 48343) || + (48345 <= t && t <= 48371) || + (48373 <= t && t <= 48399) || + (48401 <= t && t <= 48427) || + (48429 <= t && t <= 48455) || + (48457 <= t && t <= 48483) || + (48485 <= t && t <= 48511) || + (48513 <= t && t <= 48539) || + (48541 <= t && t <= 48567) || + (48569 <= t && t <= 48595) || + (48597 <= t && t <= 48623) || + (48625 <= t && t <= 48651) || + (48653 <= t && t <= 48679) || + (48681 <= t && t <= 48707) || + (48709 <= t && t <= 48735) || + (48737 <= t && t <= 48763) || + (48765 <= t && t <= 48791) || + (48793 <= t && t <= 48819) || + (48821 <= t && t <= 48847) || + (48849 <= t && t <= 48875) || + (48877 <= t && t <= 48903) || + (48905 <= t && t <= 48931) || + (48933 <= t && t <= 48959) || + (48961 <= t && t <= 48987) || + (48989 <= t && t <= 49015) || + (49017 <= t && t <= 49043) || + (49045 <= t && t <= 49071) || + (49073 <= t && t <= 49099) || + (49101 <= t && t <= 49127) || + (49129 <= t && t <= 49155) || + (49157 <= t && t <= 49183) || + (49185 <= t && t <= 49211) || + (49213 <= t && t <= 49239) || + (49241 <= t && t <= 49267) || + (49269 <= t && t <= 49295) || + (49297 <= t && t <= 49323) || + (49325 <= t && t <= 49351) || + (49353 <= t && t <= 49379) || + (49381 <= t && t <= 49407) || + (49409 <= t && t <= 49435) || + (49437 <= t && t <= 49463) || + (49465 <= t && t <= 49491) || + (49493 <= t && t <= 49519) || + (49521 <= t && t <= 49547) || + (49549 <= t && t <= 49575) || + (49577 <= t && t <= 49603) || + (49605 <= t && t <= 49631) || + (49633 <= t && t <= 49659) || + (49661 <= t && t <= 49687) || + (49689 <= t && t <= 49715) || + (49717 <= t && t <= 49743) || + (49745 <= t && t <= 49771) || + (49773 <= t && t <= 49799) || + (49801 <= t && t <= 49827) || + (49829 <= t && t <= 49855) || + (49857 <= t && t <= 49883) || + (49885 <= t && t <= 49911) || + (49913 <= t && t <= 49939) || + (49941 <= t && t <= 49967) || + (49969 <= t && t <= 49995) || + (49997 <= t && t <= 50023) || + (50025 <= t && t <= 50051) || + (50053 <= t && t <= 50079) || + (50081 <= t && t <= 50107) || + (50109 <= t && t <= 50135) || + (50137 <= t && t <= 50163) || + (50165 <= t && t <= 50191) || + (50193 <= t && t <= 50219) || + (50221 <= t && t <= 50247) || + (50249 <= t && t <= 50275) || + (50277 <= t && t <= 50303) || + (50305 <= t && t <= 50331) || + (50333 <= t && t <= 50359) || + (50361 <= t && t <= 50387) || + (50389 <= t && t <= 50415) || + (50417 <= t && t <= 50443) || + (50445 <= t && t <= 50471) || + (50473 <= t && t <= 50499) || + (50501 <= t && t <= 50527) || + (50529 <= t && t <= 50555) || + (50557 <= t && t <= 50583) || + (50585 <= t && t <= 50611) || + (50613 <= t && t <= 50639) || + (50641 <= t && t <= 50667) || + (50669 <= t && t <= 50695) || + (50697 <= t && t <= 50723) || + (50725 <= t && t <= 50751) || + (50753 <= t && t <= 50779) || + (50781 <= t && t <= 50807) || + (50809 <= t && t <= 50835) || + (50837 <= t && t <= 50863) || + (50865 <= t && t <= 50891) || + (50893 <= t && t <= 50919) || + (50921 <= t && t <= 50947) || + (50949 <= t && t <= 50975) || + (50977 <= t && t <= 51003) || + (51005 <= t && t <= 51031) || + (51033 <= t && t <= 51059) || + (51061 <= t && t <= 51087) || + (51089 <= t && t <= 51115) || + (51117 <= t && t <= 51143) || + (51145 <= t && t <= 51171) || + (51173 <= t && t <= 51199) || + (51201 <= t && t <= 51227) || + (51229 <= t && t <= 51255) || + (51257 <= t && t <= 51283) || + (51285 <= t && t <= 51311) || + (51313 <= t && t <= 51339) || + (51341 <= t && t <= 51367) || + (51369 <= t && t <= 51395) || + (51397 <= t && t <= 51423) || + (51425 <= t && t <= 51451) || + (51453 <= t && t <= 51479) || + (51481 <= t && t <= 51507) || + (51509 <= t && t <= 51535) || + (51537 <= t && t <= 51563) || + (51565 <= t && t <= 51591) || + (51593 <= t && t <= 51619) || + (51621 <= t && t <= 51647) || + (51649 <= t && t <= 51675) || + (51677 <= t && t <= 51703) || + (51705 <= t && t <= 51731) || + (51733 <= t && t <= 51759) || + (51761 <= t && t <= 51787) || + (51789 <= t && t <= 51815) || + (51817 <= t && t <= 51843) || + (51845 <= t && t <= 51871) || + (51873 <= t && t <= 51899) || + (51901 <= t && t <= 51927) || + (51929 <= t && t <= 51955) || + (51957 <= t && t <= 51983) || + (51985 <= t && t <= 52011) || + (52013 <= t && t <= 52039) || + (52041 <= t && t <= 52067) || + (52069 <= t && t <= 52095) || + (52097 <= t && t <= 52123) || + (52125 <= t && t <= 52151) || + (52153 <= t && t <= 52179) || + (52181 <= t && t <= 52207) || + (52209 <= t && t <= 52235) || + (52237 <= t && t <= 52263) || + (52265 <= t && t <= 52291) || + (52293 <= t && t <= 52319) || + (52321 <= t && t <= 52347) || + (52349 <= t && t <= 52375) || + (52377 <= t && t <= 52403) || + (52405 <= t && t <= 52431) || + (52433 <= t && t <= 52459) || + (52461 <= t && t <= 52487) || + (52489 <= t && t <= 52515) || + (52517 <= t && t <= 52543) || + (52545 <= t && t <= 52571) || + (52573 <= t && t <= 52599) || + (52601 <= t && t <= 52627) || + (52629 <= t && t <= 52655) || + (52657 <= t && t <= 52683) || + (52685 <= t && t <= 52711) || + (52713 <= t && t <= 52739) || + (52741 <= t && t <= 52767) || + (52769 <= t && t <= 52795) || + (52797 <= t && t <= 52823) || + (52825 <= t && t <= 52851) || + (52853 <= t && t <= 52879) || + (52881 <= t && t <= 52907) || + (52909 <= t && t <= 52935) || + (52937 <= t && t <= 52963) || + (52965 <= t && t <= 52991) || + (52993 <= t && t <= 53019) || + (53021 <= t && t <= 53047) || + (53049 <= t && t <= 53075) || + (53077 <= t && t <= 53103) || + (53105 <= t && t <= 53131) || + (53133 <= t && t <= 53159) || + (53161 <= t && t <= 53187) || + (53189 <= t && t <= 53215) || + (53217 <= t && t <= 53243) || + (53245 <= t && t <= 53271) || + (53273 <= t && t <= 53299) || + (53301 <= t && t <= 53327) || + (53329 <= t && t <= 53355) || + (53357 <= t && t <= 53383) || + (53385 <= t && t <= 53411) || + (53413 <= t && t <= 53439) || + (53441 <= t && t <= 53467) || + (53469 <= t && t <= 53495) || + (53497 <= t && t <= 53523) || + (53525 <= t && t <= 53551) || + (53553 <= t && t <= 53579) || + (53581 <= t && t <= 53607) || + (53609 <= t && t <= 53635) || + (53637 <= t && t <= 53663) || + (53665 <= t && t <= 53691) || + (53693 <= t && t <= 53719) || + (53721 <= t && t <= 53747) || + (53749 <= t && t <= 53775) || + (53777 <= t && t <= 53803) || + (53805 <= t && t <= 53831) || + (53833 <= t && t <= 53859) || + (53861 <= t && t <= 53887) || + (53889 <= t && t <= 53915) || + (53917 <= t && t <= 53943) || + (53945 <= t && t <= 53971) || + (53973 <= t && t <= 53999) || + (54001 <= t && t <= 54027) || + (54029 <= t && t <= 54055) || + (54057 <= t && t <= 54083) || + (54085 <= t && t <= 54111) || + (54113 <= t && t <= 54139) || + (54141 <= t && t <= 54167) || + (54169 <= t && t <= 54195) || + (54197 <= t && t <= 54223) || + (54225 <= t && t <= 54251) || + (54253 <= t && t <= 54279) || + (54281 <= t && t <= 54307) || + (54309 <= t && t <= 54335) || + (54337 <= t && t <= 54363) || + (54365 <= t && t <= 54391) || + (54393 <= t && t <= 54419) || + (54421 <= t && t <= 54447) || + (54449 <= t && t <= 54475) || + (54477 <= t && t <= 54503) || + (54505 <= t && t <= 54531) || + (54533 <= t && t <= 54559) || + (54561 <= t && t <= 54587) || + (54589 <= t && t <= 54615) || + (54617 <= t && t <= 54643) || + (54645 <= t && t <= 54671) || + (54673 <= t && t <= 54699) || + (54701 <= t && t <= 54727) || + (54729 <= t && t <= 54755) || + (54757 <= t && t <= 54783) || + (54785 <= t && t <= 54811) || + (54813 <= t && t <= 54839) || + (54841 <= t && t <= 54867) || + (54869 <= t && t <= 54895) || + (54897 <= t && t <= 54923) || + (54925 <= t && t <= 54951) || + (54953 <= t && t <= 54979) || + (54981 <= t && t <= 55007) || + (55009 <= t && t <= 55035) || + (55037 <= t && t <= 55063) || + (55065 <= t && t <= 55091) || + (55093 <= t && t <= 55119) || + (55121 <= t && t <= 55147) || + (55149 <= t && t <= 55175) || + (55177 <= t && t <= 55203) + ? 10 + : 11; + } + var s = function(t) { + if (/^[\x20-\xFF]*$/.test(t)) return t; + const i = []; + let s, + a = 0; + for (; (s = e(t, a)) < t.length; ) i.push(t.slice(a, s)), (a = s); + return a < t.length && i.push(t.slice(a)), i; + }; + class a { + constructor(t, e) { + (this.type = t), (this.value = e); + } + } + class o { + constructor(t) { + (this.s = s(t)), (this.pos = 0); + } + end() { + return this.pos >= this.s.length; + } + get() { + return this.pos < this.s.length ? this.s[this.pos++] : null; + } + peek() { + return this.s[this.pos]; + } + scan(t) { + let e; + return ( + (e = + 'string' == typeof this.s + ? t.exec(this.s.slice(this.pos)) + : t.exec(this.s.slice(this.pos).join(''))), + e ? ((this.pos += e[0].length), e[0]) : null + ); + } + isWhiteSpace() { + return /[ \f\n\r\t\v\xA0\u2028\u2029]/.test(this.s[this.pos]); + } + makeToken() { + if (this.end()) return null; + if (this.isWhiteSpace()) return this.get(), new a('space'); + let t = null; + if ('\\' === this.peek()) { + if ((this.get(), !this.end())) { + let e = this.scan(/^[a-zA-Z*]+/); + 'bgroup' === e + ? (t = new a('{')) + : 'egroup' === e + ? (t = new a('}')) + : (e || (e = this.get()), + (t = new a('command', e))); + } + } else if ('{' === this.peek() || '}' === this.peek()) + t = new a(this.get()); + else if ('#' === this.peek()) { + if ((this.get(), !this.end())) { + let e = !1, + i = this.peek(); + if ( + /[0-9?]/.test(i) && + ((e = !0), this.pos + 1 < this.s.length) + ) { + const t = this.s[this.pos + 1]; + e = /[^0-9A-Za-z]/.test(t); + } + e + ? ((t = new a('#')), + (i = this.get()), + (t.value = + i >= '0' && i <= '9' ? parseInt(i) : '?')) + : (t = new a('literal', '#')); + } + } else + '~' === this.peek() + ? (this.get(), (t = new a('command', 'space'))) + : '$' === this.peek() + ? (this.get(), + '$' === this.peek() + ? (this.get(), (t = new a('$$'))) + : (t = new a('$'))) + : (t = new a('literal', this.get())); + return t; + } + } + var n = function(t) { + const e = [], + i = t.toString().split(/\r?\n/); + let s = '', + a = ''; + for (const t of i) { + (s += a), (a = ' '); + const e = t.match(/((?:\\%)|[^%])*/); + e && (s += e[0]); + } + const n = new o(s); + for (; !n.end(); ) { + const t = n.makeToken(); + t && e.push(t); + } + return e; + }, + r = { + 'AMS-Regular': { + 65: [0, 0.68889, 0, 0], + 66: [0, 0.68889, 0, 0], + 67: [0, 0.68889, 0, 0], + 68: [0, 0.68889, 0, 0], + 69: [0, 0.68889, 0, 0], + 70: [0, 0.68889, 0, 0], + 71: [0, 0.68889, 0, 0], + 72: [0, 0.68889, 0, 0], + 73: [0, 0.68889, 0, 0], + 74: [0.16667, 0.68889, 0, 0], + 75: [0, 0.68889, 0, 0], + 76: [0, 0.68889, 0, 0], + 77: [0, 0.68889, 0, 0], + 78: [0, 0.68889, 0, 0], + 79: [0.16667, 0.68889, 0, 0], + 80: [0, 0.68889, 0, 0], + 81: [0.16667, 0.68889, 0, 0], + 82: [0, 0.68889, 0, 0], + 83: [0, 0.68889, 0, 0], + 84: [0, 0.68889, 0, 0], + 85: [0, 0.68889, 0, 0], + 86: [0, 0.68889, 0, 0], + 87: [0, 0.68889, 0, 0], + 88: [0, 0.68889, 0, 0], + 89: [0, 0.68889, 0, 0], + 90: [0, 0.68889, 0, 0], + 107: [0, 0.68889, 0, 0], + 165: [0, 0.675, 0.025, 0], + 174: [0.15559, 0.69224, 0, 0], + 240: [0, 0.68889, 0, 0], + 295: [0, 0.68889, 0, 0], + 710: [0, 0.825, 0, 0], + 732: [0, 0.9, 0, 0], + 770: [0, 0.825, 0, 0], + 771: [0, 0.9, 0, 0], + 989: [0.08167, 0.58167, 0, 0], + 1008: [0, 0.43056, 0.04028, 0], + 8245: [0, 0.54986, 0, 0], + 8463: [0, 0.68889, 0, 0], + 8487: [0, 0.68889, 0, 0], + 8498: [0, 0.68889, 0, 0], + 8502: [0, 0.68889, 0, 0], + 8503: [0, 0.68889, 0, 0], + 8504: [0, 0.68889, 0, 0], + 8513: [0, 0.68889, 0, 0], + 8592: [-0.03598, 0.46402, 0, 0], + 8594: [-0.03598, 0.46402, 0, 0], + 8602: [-0.13313, 0.36687, 0, 0], + 8603: [-0.13313, 0.36687, 0, 0], + 8606: [0.01354, 0.52239, 0, 0], + 8608: [0.01354, 0.52239, 0, 0], + 8610: [0.01354, 0.52239, 0, 0], + 8611: [0.01354, 0.52239, 0, 0], + 8619: [0, 0.54986, 0, 0], + 8620: [0, 0.54986, 0, 0], + 8621: [-0.13313, 0.37788, 0, 0], + 8622: [-0.13313, 0.36687, 0, 0], + 8624: [0, 0.69224, 0, 0], + 8625: [0, 0.69224, 0, 0], + 8630: [0, 0.43056, 0, 0], + 8631: [0, 0.43056, 0, 0], + 8634: [0.08198, 0.58198, 0, 0], + 8635: [0.08198, 0.58198, 0, 0], + 8638: [0.19444, 0.69224, 0, 0], + 8639: [0.19444, 0.69224, 0, 0], + 8642: [0.19444, 0.69224, 0, 0], + 8643: [0.19444, 0.69224, 0, 0], + 8644: [0.1808, 0.675, 0, 0], + 8646: [0.1808, 0.675, 0, 0], + 8647: [0.1808, 0.675, 0, 0], + 8648: [0.19444, 0.69224, 0, 0], + 8649: [0.1808, 0.675, 0, 0], + 8650: [0.19444, 0.69224, 0, 0], + 8651: [0.01354, 0.52239, 0, 0], + 8652: [0.01354, 0.52239, 0, 0], + 8653: [-0.13313, 0.36687, 0, 0], + 8654: [-0.13313, 0.36687, 0, 0], + 8655: [-0.13313, 0.36687, 0, 0], + 8666: [0.13667, 0.63667, 0, 0], + 8667: [0.13667, 0.63667, 0, 0], + 8669: [-0.13313, 0.37788, 0, 0], + 8672: [-0.064, 0.437, 0, 0], + 8674: [-0.064, 0.437, 0, 0], + 8705: [0, 0.825, 0, 0], + 8708: [0, 0.68889, 0, 0], + 8709: [0.08167, 0.58167, 0, 0], + 8717: [0, 0.43056, 0, 0], + 8722: [-0.03598, 0.46402, 0, 0], + 8724: [0.08198, 0.69224, 0, 0], + 8726: [0.08167, 0.58167, 0, 0], + 8733: [0, 0.69224, 0, 0], + 8736: [0, 0.69224, 0, 0], + 8737: [0, 0.69224, 0, 0], + 8738: [0.03517, 0.52239, 0, 0], + 8739: [0.08167, 0.58167, 0, 0], + 8740: [0.25142, 0.74111, 0, 0], + 8741: [0.08167, 0.58167, 0, 0], + 8742: [0.25142, 0.74111, 0, 0], + 8756: [0, 0.69224, 0, 0], + 8757: [0, 0.69224, 0, 0], + 8764: [-0.13313, 0.36687, 0, 0], + 8765: [-0.13313, 0.37788, 0, 0], + 8769: [-0.13313, 0.36687, 0, 0], + 8770: [-0.03625, 0.46375, 0, 0], + 8774: [0.30274, 0.79383, 0, 0], + 8776: [-0.01688, 0.48312, 0, 0], + 8778: [0.08167, 0.58167, 0, 0], + 8782: [0.06062, 0.54986, 0, 0], + 8783: [0.06062, 0.54986, 0, 0], + 8785: [0.08198, 0.58198, 0, 0], + 8786: [0.08198, 0.58198, 0, 0], + 8787: [0.08198, 0.58198, 0, 0], + 8790: [0, 0.69224, 0, 0], + 8791: [0.22958, 0.72958, 0, 0], + 8796: [0.08198, 0.91667, 0, 0], + 8806: [0.25583, 0.75583, 0, 0], + 8807: [0.25583, 0.75583, 0, 0], + 8808: [0.25142, 0.75726, 0, 0], + 8809: [0.25142, 0.75726, 0, 0], + 8812: [0.25583, 0.75583, 0, 0], + 8814: [0.20576, 0.70576, 0, 0], + 8815: [0.20576, 0.70576, 0, 0], + 8816: [0.30274, 0.79383, 0, 0], + 8817: [0.30274, 0.79383, 0, 0], + 8818: [0.22958, 0.72958, 0, 0], + 8819: [0.22958, 0.72958, 0, 0], + 8822: [0.1808, 0.675, 0, 0], + 8823: [0.1808, 0.675, 0, 0], + 8828: [0.13667, 0.63667, 0, 0], + 8829: [0.13667, 0.63667, 0, 0], + 8830: [0.22958, 0.72958, 0, 0], + 8831: [0.22958, 0.72958, 0, 0], + 8832: [0.20576, 0.70576, 0, 0], + 8833: [0.20576, 0.70576, 0, 0], + 8840: [0.30274, 0.79383, 0, 0], + 8841: [0.30274, 0.79383, 0, 0], + 8842: [0.13597, 0.63597, 0, 0], + 8843: [0.13597, 0.63597, 0, 0], + 8847: [0.03517, 0.54986, 0, 0], + 8848: [0.03517, 0.54986, 0, 0], + 8858: [0.08198, 0.58198, 0, 0], + 8859: [0.08198, 0.58198, 0, 0], + 8861: [0.08198, 0.58198, 0, 0], + 8862: [0, 0.675, 0, 0], + 8863: [0, 0.675, 0, 0], + 8864: [0, 0.675, 0, 0], + 8865: [0, 0.675, 0, 0], + 8872: [0, 0.69224, 0, 0], + 8873: [0, 0.69224, 0, 0], + 8874: [0, 0.69224, 0, 0], + 8876: [0, 0.68889, 0, 0], + 8877: [0, 0.68889, 0, 0], + 8878: [0, 0.68889, 0, 0], + 8879: [0, 0.68889, 0, 0], + 8882: [0.03517, 0.54986, 0, 0], + 8883: [0.03517, 0.54986, 0, 0], + 8884: [0.13667, 0.63667, 0, 0], + 8885: [0.13667, 0.63667, 0, 0], + 8888: [0, 0.54986, 0, 0], + 8890: [0.19444, 0.43056, 0, 0], + 8891: [0.19444, 0.69224, 0, 0], + 8892: [0.19444, 0.69224, 0, 0], + 8901: [0, 0.54986, 0, 0], + 8903: [0.08167, 0.58167, 0, 0], + 8905: [0.08167, 0.58167, 0, 0], + 8906: [0.08167, 0.58167, 0, 0], + 8907: [0, 0.69224, 0, 0], + 8908: [0, 0.69224, 0, 0], + 8909: [-0.03598, 0.46402, 0, 0], + 8910: [0, 0.54986, 0, 0], + 8911: [0, 0.54986, 0, 0], + 8912: [0.03517, 0.54986, 0, 0], + 8913: [0.03517, 0.54986, 0, 0], + 8914: [0, 0.54986, 0, 0], + 8915: [0, 0.54986, 0, 0], + 8916: [0, 0.69224, 0, 0], + 8918: [0.0391, 0.5391, 0, 0], + 8919: [0.0391, 0.5391, 0, 0], + 8920: [0.03517, 0.54986, 0, 0], + 8921: [0.03517, 0.54986, 0, 0], + 8922: [0.38569, 0.88569, 0, 0], + 8923: [0.38569, 0.88569, 0, 0], + 8926: [0.13667, 0.63667, 0, 0], + 8927: [0.13667, 0.63667, 0, 0], + 8928: [0.30274, 0.79383, 0, 0], + 8929: [0.30274, 0.79383, 0, 0], + 8934: [0.23222, 0.74111, 0, 0], + 8935: [0.23222, 0.74111, 0, 0], + 8936: [0.23222, 0.74111, 0, 0], + 8937: [0.23222, 0.74111, 0, 0], + 8938: [0.20576, 0.70576, 0, 0], + 8939: [0.20576, 0.70576, 0, 0], + 8940: [0.30274, 0.79383, 0, 0], + 8941: [0.30274, 0.79383, 0, 0], + 8994: [0.19444, 0.69224, 0, 0], + 8995: [0.19444, 0.69224, 0, 0], + 9416: [0.15559, 0.69224, 0, 0], + 9484: [0, 0.69224, 0, 0], + 9488: [0, 0.69224, 0, 0], + 9492: [0, 0.37788, 0, 0], + 9496: [0, 0.37788, 0, 0], + 9585: [0.19444, 0.68889, 0, 0], + 9586: [0.19444, 0.74111, 0, 0], + 9632: [0, 0.675, 0, 0], + 9633: [0, 0.675, 0, 0], + 9650: [0, 0.54986, 0, 0], + 9651: [0, 0.54986, 0, 0], + 9654: [0.03517, 0.54986, 0, 0], + 9660: [0, 0.54986, 0, 0], + 9661: [0, 0.54986, 0, 0], + 9664: [0.03517, 0.54986, 0, 0], + 9674: [0.11111, 0.69224, 0, 0], + 9733: [0.19444, 0.69224, 0, 0], + 10003: [0, 0.69224, 0, 0], + 10016: [0, 0.69224, 0, 0], + 10731: [0.11111, 0.69224, 0, 0], + 10846: [0.19444, 0.75583, 0, 0], + 10877: [0.13667, 0.63667, 0, 0], + 10878: [0.13667, 0.63667, 0, 0], + 10885: [0.25583, 0.75583, 0, 0], + 10886: [0.25583, 0.75583, 0, 0], + 10887: [0.13597, 0.63597, 0, 0], + 10888: [0.13597, 0.63597, 0, 0], + 10889: [0.26167, 0.75726, 0, 0], + 10890: [0.26167, 0.75726, 0, 0], + 10891: [0.48256, 0.98256, 0, 0], + 10892: [0.48256, 0.98256, 0, 0], + 10901: [0.13667, 0.63667, 0, 0], + 10902: [0.13667, 0.63667, 0, 0], + 10933: [0.25142, 0.75726, 0, 0], + 10934: [0.25142, 0.75726, 0, 0], + 10935: [0.26167, 0.75726, 0, 0], + 10936: [0.26167, 0.75726, 0, 0], + 10937: [0.26167, 0.75726, 0, 0], + 10938: [0.26167, 0.75726, 0, 0], + 10949: [0.25583, 0.75583, 0, 0], + 10950: [0.25583, 0.75583, 0, 0], + 10955: [0.28481, 0.79383, 0, 0], + 10956: [0.28481, 0.79383, 0, 0], + 57350: [0.08167, 0.58167, 0, 0], + 57351: [0.08167, 0.58167, 0, 0], + 57352: [0.08167, 0.58167, 0, 0], + 57353: [0, 0.43056, 0.04028, 0], + 57356: [0.25142, 0.75726, 0, 0], + 57357: [0.25142, 0.75726, 0, 0], + 57358: [0.41951, 0.91951, 0, 0], + 57359: [0.30274, 0.79383, 0, 0], + 57360: [0.30274, 0.79383, 0, 0], + 57361: [0.41951, 0.91951, 0, 0], + 57366: [0.25142, 0.75726, 0, 0], + 57367: [0.25142, 0.75726, 0, 0], + 57368: [0.25142, 0.75726, 0, 0], + 57369: [0.25142, 0.75726, 0, 0], + 57370: [0.13597, 0.63597, 0, 0], + 57371: [0.13597, 0.63597, 0, 0], + }, + 'Caligraphic-Regular': { + 48: [0, 0.43056, 0, 0], + 49: [0, 0.43056, 0, 0], + 50: [0, 0.43056, 0, 0], + 51: [0.19444, 0.43056, 0, 0], + 52: [0.19444, 0.43056, 0, 0], + 53: [0.19444, 0.43056, 0, 0], + 54: [0, 0.64444, 0, 0], + 55: [0.19444, 0.43056, 0, 0], + 56: [0, 0.64444, 0, 0], + 57: [0.19444, 0.43056, 0, 0], + 65: [0, 0.68333, 0, 0.19445], + 66: [0, 0.68333, 0.03041, 0.13889], + 67: [0, 0.68333, 0.05834, 0.13889], + 68: [0, 0.68333, 0.02778, 0.08334], + 69: [0, 0.68333, 0.08944, 0.11111], + 70: [0, 0.68333, 0.09931, 0.11111], + 71: [0.09722, 0.68333, 0.0593, 0.11111], + 72: [0, 0.68333, 0.00965, 0.11111], + 73: [0, 0.68333, 0.07382, 0], + 74: [0.09722, 0.68333, 0.18472, 0.16667], + 75: [0, 0.68333, 0.01445, 0.05556], + 76: [0, 0.68333, 0, 0.13889], + 77: [0, 0.68333, 0, 0.13889], + 78: [0, 0.68333, 0.14736, 0.08334], + 79: [0, 0.68333, 0.02778, 0.11111], + 80: [0, 0.68333, 0.08222, 0.08334], + 81: [0.09722, 0.68333, 0, 0.11111], + 82: [0, 0.68333, 0, 0.08334], + 83: [0, 0.68333, 0.075, 0.13889], + 84: [0, 0.68333, 0.25417, 0], + 85: [0, 0.68333, 0.09931, 0.08334], + 86: [0, 0.68333, 0.08222, 0], + 87: [0, 0.68333, 0.08222, 0.08334], + 88: [0, 0.68333, 0.14643, 0.13889], + 89: [0.09722, 0.68333, 0.08222, 0.08334], + 90: [0, 0.68333, 0.07944, 0.13889], + }, + 'Fraktur-Regular': { + 33: [0, 0.69141, 0, 0], + 34: [0, 0.69141, 0, 0], + 38: [0, 0.69141, 0, 0], + 39: [0, 0.69141, 0, 0], + 40: [0.24982, 0.74947, 0, 0], + 41: [0.24982, 0.74947, 0, 0], + 42: [0, 0.62119, 0, 0], + 43: [0.08319, 0.58283, 0, 0], + 44: [0, 0.10803, 0, 0], + 45: [0.08319, 0.58283, 0, 0], + 46: [0, 0.10803, 0, 0], + 47: [0.24982, 0.74947, 0, 0], + 48: [0, 0.47534, 0, 0], + 49: [0, 0.47534, 0, 0], + 50: [0, 0.47534, 0, 0], + 51: [0.18906, 0.47534, 0, 0], + 52: [0.18906, 0.47534, 0, 0], + 53: [0.18906, 0.47534, 0, 0], + 54: [0, 0.69141, 0, 0], + 55: [0.18906, 0.47534, 0, 0], + 56: [0, 0.69141, 0, 0], + 57: [0.18906, 0.47534, 0, 0], + 58: [0, 0.47534, 0, 0], + 59: [0.12604, 0.47534, 0, 0], + 61: [-0.13099, 0.36866, 0, 0], + 63: [0, 0.69141, 0, 0], + 65: [0, 0.69141, 0, 0], + 66: [0, 0.69141, 0, 0], + 67: [0, 0.69141, 0, 0], + 68: [0, 0.69141, 0, 0], + 69: [0, 0.69141, 0, 0], + 70: [0.12604, 0.69141, 0, 0], + 71: [0, 0.69141, 0, 0], + 72: [0.06302, 0.69141, 0, 0], + 73: [0, 0.69141, 0, 0], + 74: [0.12604, 0.69141, 0, 0], + 75: [0, 0.69141, 0, 0], + 76: [0, 0.69141, 0, 0], + 77: [0, 0.69141, 0, 0], + 78: [0, 0.69141, 0, 0], + 79: [0, 0.69141, 0, 0], + 80: [0.18906, 0.69141, 0, 0], + 81: [0.03781, 0.69141, 0, 0], + 82: [0, 0.69141, 0, 0], + 83: [0, 0.69141, 0, 0], + 84: [0, 0.69141, 0, 0], + 85: [0, 0.69141, 0, 0], + 86: [0, 0.69141, 0, 0], + 87: [0, 0.69141, 0, 0], + 88: [0, 0.69141, 0, 0], + 89: [0.18906, 0.69141, 0, 0], + 90: [0.12604, 0.69141, 0, 0], + 91: [0.24982, 0.74947, 0, 0], + 93: [0.24982, 0.74947, 0, 0], + 94: [0, 0.69141, 0, 0], + 97: [0, 0.47534, 0, 0], + 98: [0, 0.69141, 0, 0], + 99: [0, 0.47534, 0, 0], + 100: [0, 0.62119, 0, 0], + 101: [0, 0.47534, 0, 0], + 102: [0.18906, 0.69141, 0, 0], + 103: [0.18906, 0.47534, 0, 0], + 104: [0.18906, 0.69141, 0, 0], + 105: [0, 0.69141, 0, 0], + 106: [0, 0.69141, 0, 0], + 107: [0, 0.69141, 0, 0], + 108: [0, 0.69141, 0, 0], + 109: [0, 0.47534, 0, 0], + 110: [0, 0.47534, 0, 0], + 111: [0, 0.47534, 0, 0], + 112: [0.18906, 0.52396, 0, 0], + 113: [0.18906, 0.47534, 0, 0], + 114: [0, 0.47534, 0, 0], + 115: [0, 0.47534, 0, 0], + 116: [0, 0.62119, 0, 0], + 117: [0, 0.47534, 0, 0], + 118: [0, 0.52396, 0, 0], + 119: [0, 0.52396, 0, 0], + 120: [0.18906, 0.47534, 0, 0], + 121: [0.18906, 0.47534, 0, 0], + 122: [0.18906, 0.47534, 0, 0], + 8216: [0, 0.69141, 0, 0], + 8217: [0, 0.69141, 0, 0], + 58112: [0, 0.62119, 0, 0], + 58113: [0, 0.62119, 0, 0], + 58114: [0.18906, 0.69141, 0, 0], + 58115: [0.18906, 0.69141, 0, 0], + 58116: [0.18906, 0.47534, 0, 0], + 58117: [0, 0.69141, 0, 0], + 58118: [0, 0.62119, 0, 0], + 58119: [0, 0.47534, 0, 0], + }, + 'Main-Bold': { + 33: [0, 0.69444, 0, 0], + 34: [0, 0.69444, 0, 0], + 35: [0.19444, 0.69444, 0, 0], + 36: [0.05556, 0.75, 0, 0], + 37: [0.05556, 0.75, 0, 0], + 38: [0, 0.69444, 0, 0], + 39: [0, 0.69444, 0, 0], + 40: [0.25, 0.75, 0, 0], + 41: [0.25, 0.75, 0, 0], + 42: [0, 0.75, 0, 0], + 43: [0.13333, 0.63333, 0, 0], + 44: [0.19444, 0.15556, 0, 0], + 45: [0, 0.44444, 0, 0], + 46: [0, 0.15556, 0, 0], + 47: [0.25, 0.75, 0, 0], + 48: [0, 0.64444, 0, 0], + 49: [0, 0.64444, 0, 0], + 50: [0, 0.64444, 0, 0], + 51: [0, 0.64444, 0, 0], + 52: [0, 0.64444, 0, 0], + 53: [0, 0.64444, 0, 0], + 54: [0, 0.64444, 0, 0], + 55: [0, 0.64444, 0, 0], + 56: [0, 0.64444, 0, 0], + 57: [0, 0.64444, 0, 0], + 58: [0, 0.44444, 0, 0], + 59: [0.19444, 0.44444, 0, 0], + 60: [0.08556, 0.58556, 0, 0], + 61: [-0.10889, 0.39111, 0, 0], + 62: [0.08556, 0.58556, 0, 0], + 63: [0, 0.69444, 0, 0], + 64: [0, 0.69444, 0, 0], + 65: [0, 0.68611, 0, 0], + 66: [0, 0.68611, 0, 0], + 67: [0, 0.68611, 0, 0], + 68: [0, 0.68611, 0, 0], + 69: [0, 0.68611, 0, 0], + 70: [0, 0.68611, 0, 0], + 71: [0, 0.68611, 0, 0], + 72: [0, 0.68611, 0, 0], + 73: [0, 0.68611, 0, 0], + 74: [0, 0.68611, 0, 0], + 75: [0, 0.68611, 0, 0], + 76: [0, 0.68611, 0, 0], + 77: [0, 0.68611, 0, 0], + 78: [0, 0.68611, 0, 0], + 79: [0, 0.68611, 0, 0], + 80: [0, 0.68611, 0, 0], + 81: [0.19444, 0.68611, 0, 0], + 82: [0, 0.68611, 0, 0], + 83: [0, 0.68611, 0, 0], + 84: [0, 0.68611, 0, 0], + 85: [0, 0.68611, 0, 0], + 86: [0, 0.68611, 0.01597, 0], + 87: [0, 0.68611, 0.01597, 0], + 88: [0, 0.68611, 0, 0], + 89: [0, 0.68611, 0.02875, 0], + 90: [0, 0.68611, 0, 0], + 91: [0.25, 0.75, 0, 0], + 92: [0.25, 0.75, 0, 0], + 93: [0.25, 0.75, 0, 0], + 94: [0, 0.69444, 0, 0], + 95: [0.31, 0.13444, 0.03194, 0], + 96: [0, 0.69444, 0, 0], + 97: [0, 0.44444, 0, 0], + 98: [0, 0.69444, 0, 0], + 99: [0, 0.44444, 0, 0], + 100: [0, 0.69444, 0, 0], + 101: [0, 0.44444, 0, 0], + 102: [0, 0.69444, 0.10903, 0], + 103: [0.19444, 0.44444, 0.01597, 0], + 104: [0, 0.69444, 0, 0], + 105: [0, 0.69444, 0, 0], + 106: [0.19444, 0.69444, 0, 0], + 107: [0, 0.69444, 0, 0], + 108: [0, 0.69444, 0, 0], + 109: [0, 0.44444, 0, 0], + 110: [0, 0.44444, 0, 0], + 111: [0, 0.44444, 0, 0], + 112: [0.19444, 0.44444, 0, 0], + 113: [0.19444, 0.44444, 0, 0], + 114: [0, 0.44444, 0, 0], + 115: [0, 0.44444, 0, 0], + 116: [0, 0.63492, 0, 0], + 117: [0, 0.44444, 0, 0], + 118: [0, 0.44444, 0.01597, 0], + 119: [0, 0.44444, 0.01597, 0], + 120: [0, 0.44444, 0, 0], + 121: [0.19444, 0.44444, 0.01597, 0], + 122: [0, 0.44444, 0, 0], + 123: [0.25, 0.75, 0, 0], + 124: [0.25, 0.75, 0, 0], + 125: [0.25, 0.75, 0, 0], + 126: [0.35, 0.34444, 0, 0], + 168: [0, 0.69444, 0, 0], + 172: [0, 0.44444, 0, 0], + 175: [0, 0.59611, 0, 0], + 176: [0, 0.69444, 0, 0], + 177: [0.13333, 0.63333, 0, 0], + 180: [0, 0.69444, 0, 0], + 215: [0.13333, 0.63333, 0, 0], + 247: [0.13333, 0.63333, 0, 0], + 305: [0, 0.44444, 0, 0], + 567: [0.19444, 0.44444, 0, 0], + 710: [0, 0.69444, 0, 0], + 711: [0, 0.63194, 0, 0], + 713: [0, 0.59611, 0, 0], + 714: [0, 0.69444, 0, 0], + 715: [0, 0.69444, 0, 0], + 728: [0, 0.69444, 0, 0], + 729: [0, 0.69444, 0, 0], + 730: [0, 0.69444, 0, 0], + 732: [0, 0.69444, 0, 0], + 768: [0, 0.69444, 0, 0], + 769: [0, 0.69444, 0, 0], + 770: [0, 0.69444, 0, 0], + 771: [0, 0.69444, 0, 0], + 772: [0, 0.59611, 0, 0], + 774: [0, 0.69444, 0, 0], + 775: [0, 0.69444, 0, 0], + 776: [0, 0.69444, 0, 0], + 778: [0, 0.69444, 0, 0], + 779: [0, 0.69444, 0, 0], + 780: [0, 0.63194, 0, 0], + 824: [0.19444, 0.69444, 0, 0], + 915: [0, 0.68611, 0, 0], + 916: [0, 0.68611, 0, 0], + 920: [0, 0.68611, 0, 0], + 923: [0, 0.68611, 0, 0], + 926: [0, 0.68611, 0, 0], + 928: [0, 0.68611, 0, 0], + 931: [0, 0.68611, 0, 0], + 933: [0, 0.68611, 0, 0], + 934: [0, 0.68611, 0, 0], + 936: [0, 0.68611, 0, 0], + 937: [0, 0.68611, 0, 0], + 8211: [0, 0.44444, 0.03194, 0], + 8212: [0, 0.44444, 0.03194, 0], + 8216: [0, 0.69444, 0, 0], + 8217: [0, 0.69444, 0, 0], + 8220: [0, 0.69444, 0, 0], + 8221: [0, 0.69444, 0, 0], + 8224: [0.19444, 0.69444, 0, 0], + 8225: [0.19444, 0.69444, 0, 0], + 8242: [0, 0.55556, 0, 0], + 8407: [0, 0.72444, 0.15486, 0], + 8463: [0, 0.69444, 0, 0], + 8465: [0, 0.69444, 0, 0], + 8467: [0, 0.69444, 0, 0], + 8472: [0.19444, 0.44444, 0, 0], + 8476: [0, 0.69444, 0, 0], + 8501: [0, 0.69444, 0, 0], + 8592: [-0.10889, 0.39111, 0, 0], + 8593: [0.19444, 0.69444, 0, 0], + 8594: [-0.10889, 0.39111, 0, 0], + 8595: [0.19444, 0.69444, 0, 0], + 8596: [-0.10889, 0.39111, 0, 0], + 8597: [0.25, 0.75, 0, 0], + 8598: [0.19444, 0.69444, 0, 0], + 8599: [0.19444, 0.69444, 0, 0], + 8600: [0.19444, 0.69444, 0, 0], + 8601: [0.19444, 0.69444, 0, 0], + 8636: [-0.10889, 0.39111, 0, 0], + 8637: [-0.10889, 0.39111, 0, 0], + 8640: [-0.10889, 0.39111, 0, 0], + 8641: [-0.10889, 0.39111, 0, 0], + 8656: [-0.10889, 0.39111, 0, 0], + 8657: [0.19444, 0.69444, 0, 0], + 8658: [-0.10889, 0.39111, 0, 0], + 8659: [0.19444, 0.69444, 0, 0], + 8660: [-0.10889, 0.39111, 0, 0], + 8661: [0.25, 0.75, 0, 0], + 8704: [0, 0.69444, 0, 0], + 8706: [0, 0.69444, 0.06389, 0], + 8707: [0, 0.69444, 0, 0], + 8709: [0.05556, 0.75, 0, 0], + 8711: [0, 0.68611, 0, 0], + 8712: [0.08556, 0.58556, 0, 0], + 8715: [0.08556, 0.58556, 0, 0], + 8722: [0.13333, 0.63333, 0, 0], + 8723: [0.13333, 0.63333, 0, 0], + 8725: [0.25, 0.75, 0, 0], + 8726: [0.25, 0.75, 0, 0], + 8727: [-0.02778, 0.47222, 0, 0], + 8728: [-0.02639, 0.47361, 0, 0], + 8729: [-0.02639, 0.47361, 0, 0], + 8730: [0.18, 0.82, 0, 0], + 8733: [0, 0.44444, 0, 0], + 8734: [0, 0.44444, 0, 0], + 8736: [0, 0.69224, 0, 0], + 8739: [0.25, 0.75, 0, 0], + 8741: [0.25, 0.75, 0, 0], + 8743: [0, 0.55556, 0, 0], + 8744: [0, 0.55556, 0, 0], + 8745: [0, 0.55556, 0, 0], + 8746: [0, 0.55556, 0, 0], + 8747: [0.19444, 0.69444, 0.12778, 0], + 8764: [-0.10889, 0.39111, 0, 0], + 8768: [0.19444, 0.69444, 0, 0], + 8771: [0.00222, 0.50222, 0, 0], + 8776: [0.02444, 0.52444, 0, 0], + 8781: [0.00222, 0.50222, 0, 0], + 8801: [0.00222, 0.50222, 0, 0], + 8804: [0.19667, 0.69667, 0, 0], + 8805: [0.19667, 0.69667, 0, 0], + 8810: [0.08556, 0.58556, 0, 0], + 8811: [0.08556, 0.58556, 0, 0], + 8826: [0.08556, 0.58556, 0, 0], + 8827: [0.08556, 0.58556, 0, 0], + 8834: [0.08556, 0.58556, 0, 0], + 8835: [0.08556, 0.58556, 0, 0], + 8838: [0.19667, 0.69667, 0, 0], + 8839: [0.19667, 0.69667, 0, 0], + 8846: [0, 0.55556, 0, 0], + 8849: [0.19667, 0.69667, 0, 0], + 8850: [0.19667, 0.69667, 0, 0], + 8851: [0, 0.55556, 0, 0], + 8852: [0, 0.55556, 0, 0], + 8853: [0.13333, 0.63333, 0, 0], + 8854: [0.13333, 0.63333, 0, 0], + 8855: [0.13333, 0.63333, 0, 0], + 8856: [0.13333, 0.63333, 0, 0], + 8857: [0.13333, 0.63333, 0, 0], + 8866: [0, 0.69444, 0, 0], + 8867: [0, 0.69444, 0, 0], + 8868: [0, 0.69444, 0, 0], + 8869: [0, 0.69444, 0, 0], + 8900: [-0.02639, 0.47361, 0, 0], + 8901: [-0.02639, 0.47361, 0, 0], + 8902: [-0.02778, 0.47222, 0, 0], + 8968: [0.25, 0.75, 0, 0], + 8969: [0.25, 0.75, 0, 0], + 8970: [0.25, 0.75, 0, 0], + 8971: [0.25, 0.75, 0, 0], + 8994: [-0.13889, 0.36111, 0, 0], + 8995: [-0.13889, 0.36111, 0, 0], + 9651: [0.19444, 0.69444, 0, 0], + 9657: [-0.02778, 0.47222, 0, 0], + 9661: [0.19444, 0.69444, 0, 0], + 9667: [-0.02778, 0.47222, 0, 0], + 9711: [0.19444, 0.69444, 0, 0], + 9824: [0.12963, 0.69444, 0, 0], + 9825: [0.12963, 0.69444, 0, 0], + 9826: [0.12963, 0.69444, 0, 0], + 9827: [0.12963, 0.69444, 0, 0], + 9837: [0, 0.75, 0, 0], + 9838: [0.19444, 0.69444, 0, 0], + 9839: [0.19444, 0.69444, 0, 0], + 10216: [0.25, 0.75, 0, 0], + 10217: [0.25, 0.75, 0, 0], + 10815: [0, 0.68611, 0, 0], + 10927: [0.19667, 0.69667, 0, 0], + 10928: [0.19667, 0.69667, 0, 0], + }, + 'Main-Italic': { + 33: [0, 0.69444, 0.12417, 0], + 34: [0, 0.69444, 0.06961, 0], + 35: [0.19444, 0.69444, 0.06616, 0], + 37: [0.05556, 0.75, 0.13639, 0], + 38: [0, 0.69444, 0.09694, 0], + 39: [0, 0.69444, 0.12417, 0], + 40: [0.25, 0.75, 0.16194, 0], + 41: [0.25, 0.75, 0.03694, 0], + 42: [0, 0.75, 0.14917, 0], + 43: [0.05667, 0.56167, 0.03694, 0], + 44: [0.19444, 0.10556, 0, 0], + 45: [0, 0.43056, 0.02826, 0], + 46: [0, 0.10556, 0, 0], + 47: [0.25, 0.75, 0.16194, 0], + 48: [0, 0.64444, 0.13556, 0], + 49: [0, 0.64444, 0.13556, 0], + 50: [0, 0.64444, 0.13556, 0], + 51: [0, 0.64444, 0.13556, 0], + 52: [0.19444, 0.64444, 0.13556, 0], + 53: [0, 0.64444, 0.13556, 0], + 54: [0, 0.64444, 0.13556, 0], + 55: [0.19444, 0.64444, 0.13556, 0], + 56: [0, 0.64444, 0.13556, 0], + 57: [0, 0.64444, 0.13556, 0], + 58: [0, 0.43056, 0.0582, 0], + 59: [0.19444, 0.43056, 0.0582, 0], + 61: [-0.13313, 0.36687, 0.06616, 0], + 63: [0, 0.69444, 0.1225, 0], + 64: [0, 0.69444, 0.09597, 0], + 65: [0, 0.68333, 0, 0], + 66: [0, 0.68333, 0.10257, 0], + 67: [0, 0.68333, 0.14528, 0], + 68: [0, 0.68333, 0.09403, 0], + 69: [0, 0.68333, 0.12028, 0], + 70: [0, 0.68333, 0.13305, 0], + 71: [0, 0.68333, 0.08722, 0], + 72: [0, 0.68333, 0.16389, 0], + 73: [0, 0.68333, 0.15806, 0], + 74: [0, 0.68333, 0.14028, 0], + 75: [0, 0.68333, 0.14528, 0], + 76: [0, 0.68333, 0, 0], + 77: [0, 0.68333, 0.16389, 0], + 78: [0, 0.68333, 0.16389, 0], + 79: [0, 0.68333, 0.09403, 0], + 80: [0, 0.68333, 0.10257, 0], + 81: [0.19444, 0.68333, 0.09403, 0], + 82: [0, 0.68333, 0.03868, 0], + 83: [0, 0.68333, 0.11972, 0], + 84: [0, 0.68333, 0.13305, 0], + 85: [0, 0.68333, 0.16389, 0], + 86: [0, 0.68333, 0.18361, 0], + 87: [0, 0.68333, 0.18361, 0], + 88: [0, 0.68333, 0.15806, 0], + 89: [0, 0.68333, 0.19383, 0], + 90: [0, 0.68333, 0.14528, 0], + 91: [0.25, 0.75, 0.1875, 0], + 93: [0.25, 0.75, 0.10528, 0], + 94: [0, 0.69444, 0.06646, 0], + 95: [0.31, 0.12056, 0.09208, 0], + 97: [0, 0.43056, 0.07671, 0], + 98: [0, 0.69444, 0.06312, 0], + 99: [0, 0.43056, 0.05653, 0], + 100: [0, 0.69444, 0.10333, 0], + 101: [0, 0.43056, 0.07514, 0], + 102: [0.19444, 0.69444, 0.21194, 0], + 103: [0.19444, 0.43056, 0.08847, 0], + 104: [0, 0.69444, 0.07671, 0], + 105: [0, 0.65536, 0.1019, 0], + 106: [0.19444, 0.65536, 0.14467, 0], + 107: [0, 0.69444, 0.10764, 0], + 108: [0, 0.69444, 0.10333, 0], + 109: [0, 0.43056, 0.07671, 0], + 110: [0, 0.43056, 0.07671, 0], + 111: [0, 0.43056, 0.06312, 0], + 112: [0.19444, 0.43056, 0.06312, 0], + 113: [0.19444, 0.43056, 0.08847, 0], + 114: [0, 0.43056, 0.10764, 0], + 115: [0, 0.43056, 0.08208, 0], + 116: [0, 0.61508, 0.09486, 0], + 117: [0, 0.43056, 0.07671, 0], + 118: [0, 0.43056, 0.10764, 0], + 119: [0, 0.43056, 0.10764, 0], + 120: [0, 0.43056, 0.12042, 0], + 121: [0.19444, 0.43056, 0.08847, 0], + 122: [0, 0.43056, 0.12292, 0], + 126: [0.35, 0.31786, 0.11585, 0], + 163: [0, 0.69444, 0, 0], + 305: [0, 0.43056, 0, 0.02778], + 567: [0.19444, 0.43056, 0, 0.08334], + 768: [0, 0.69444, 0, 0], + 769: [0, 0.69444, 0.09694, 0], + 770: [0, 0.69444, 0.06646, 0], + 771: [0, 0.66786, 0.11585, 0], + 772: [0, 0.56167, 0.10333, 0], + 774: [0, 0.69444, 0.10806, 0], + 775: [0, 0.66786, 0.11752, 0], + 776: [0, 0.66786, 0.10474, 0], + 778: [0, 0.69444, 0, 0], + 779: [0, 0.69444, 0.1225, 0], + 780: [0, 0.62847, 0.08295, 0], + 915: [0, 0.68333, 0.13305, 0], + 916: [0, 0.68333, 0, 0], + 920: [0, 0.68333, 0.09403, 0], + 923: [0, 0.68333, 0, 0], + 926: [0, 0.68333, 0.15294, 0], + 928: [0, 0.68333, 0.16389, 0], + 931: [0, 0.68333, 0.12028, 0], + 933: [0, 0.68333, 0.11111, 0], + 934: [0, 0.68333, 0.05986, 0], + 936: [0, 0.68333, 0.11111, 0], + 937: [0, 0.68333, 0.10257, 0], + 8211: [0, 0.43056, 0.09208, 0], + 8212: [0, 0.43056, 0.09208, 0], + 8216: [0, 0.69444, 0.12417, 0], + 8217: [0, 0.69444, 0.12417, 0], + 8220: [0, 0.69444, 0.1685, 0], + 8221: [0, 0.69444, 0.06961, 0], + 8463: [0, 0.68889, 0, 0], + }, + 'Main-Regular': { + 32: [0, 0, 0, 0], + 33: [0, 0.69444, 0, 0], + 34: [0, 0.69444, 0, 0], + 35: [0.19444, 0.69444, 0, 0], + 36: [0.05556, 0.75, 0, 0], + 37: [0.05556, 0.75, 0, 0], + 38: [0, 0.69444, 0, 0], + 39: [0, 0.69444, 0, 0], + 40: [0.25, 0.75, 0, 0], + 41: [0.25, 0.75, 0, 0], + 42: [0, 0.75, 0, 0], + 43: [0.08333, 0.58333, 0, 0], + 44: [0.19444, 0.10556, 0, 0], + 45: [0, 0.43056, 0, 0], + 46: [0, 0.10556, 0, 0], + 47: [0.25, 0.75, 0, 0], + 48: [0, 0.64444, 0, 0], + 49: [0, 0.64444, 0, 0], + 50: [0, 0.64444, 0, 0], + 51: [0, 0.64444, 0, 0], + 52: [0, 0.64444, 0, 0], + 53: [0, 0.64444, 0, 0], + 54: [0, 0.64444, 0, 0], + 55: [0, 0.64444, 0, 0], + 56: [0, 0.64444, 0, 0], + 57: [0, 0.64444, 0, 0], + 58: [0, 0.43056, 0, 0], + 59: [0.19444, 0.43056, 0, 0], + 60: [0.0391, 0.5391, 0, 0], + 61: [-0.13313, 0.36687, 0, 0], + 62: [0.0391, 0.5391, 0, 0], + 63: [0, 0.69444, 0, 0], + 64: [0, 0.69444, 0, 0], + 65: [0, 0.68333, 0, 0], + 66: [0, 0.68333, 0, 0], + 67: [0, 0.68333, 0, 0], + 68: [0, 0.68333, 0, 0], + 69: [0, 0.68333, 0, 0], + 70: [0, 0.68333, 0, 0], + 71: [0, 0.68333, 0, 0], + 72: [0, 0.68333, 0, 0], + 73: [0, 0.68333, 0, 0], + 74: [0, 0.68333, 0, 0], + 75: [0, 0.68333, 0, 0], + 76: [0, 0.68333, 0, 0], + 77: [0, 0.68333, 0, 0], + 78: [0, 0.68333, 0, 0], + 79: [0, 0.68333, 0, 0], + 80: [0, 0.68333, 0, 0], + 81: [0.19444, 0.68333, 0, 0], + 82: [0, 0.68333, 0, 0], + 83: [0, 0.68333, 0, 0], + 84: [0, 0.68333, 0, 0], + 85: [0, 0.68333, 0, 0], + 86: [0, 0.68333, 0.01389, 0], + 87: [0, 0.68333, 0.01389, 0], + 88: [0, 0.68333, 0, 0], + 89: [0, 0.68333, 0.025, 0], + 90: [0, 0.68333, 0, 0], + 91: [0.25, 0.75, 0, 0], + 92: [0.25, 0.75, 0, 0], + 93: [0.25, 0.75, 0, 0], + 94: [0, 0.69444, 0, 0], + 95: [0.31, 0.12056, 0.02778, 0], + 96: [0, 0.69444, 0, 0], + 97: [0, 0.43056, 0, 0], + 98: [0, 0.69444, 0, 0], + 99: [0, 0.43056, 0, 0], + 100: [0, 0.69444, 0, 0], + 101: [0, 0.43056, 0, 0], + 102: [0, 0.69444, 0.07778, 0], + 103: [0.19444, 0.43056, 0.01389, 0], + 104: [0, 0.69444, 0, 0], + 105: [0, 0.66786, 0, 0], + 106: [0.19444, 0.66786, 0, 0], + 107: [0, 0.69444, 0, 0], + 108: [0, 0.69444, 0, 0], + 109: [0, 0.43056, 0, 0], + 110: [0, 0.43056, 0, 0], + 111: [0, 0.43056, 0, 0], + 112: [0.19444, 0.43056, 0, 0], + 113: [0.19444, 0.43056, 0, 0], + 114: [0, 0.43056, 0, 0], + 115: [0, 0.43056, 0, 0], + 116: [0, 0.61508, 0, 0], + 117: [0, 0.43056, 0, 0], + 118: [0, 0.43056, 0.01389, 0], + 119: [0, 0.43056, 0.01389, 0], + 120: [0, 0.43056, 0, 0], + 121: [0.19444, 0.43056, 0.01389, 0], + 122: [0, 0.43056, 0, 0], + 123: [0.25, 0.75, 0, 0], + 124: [0.25, 0.75, 0, 0], + 125: [0.25, 0.75, 0, 0], + 126: [0.35, 0.31786, 0, 0], + 160: [0, 0, 0, 0], + 168: [0, 0.66786, 0, 0], + 172: [0, 0.43056, 0, 0], + 175: [0, 0.56778, 0, 0], + 176: [0, 0.69444, 0, 0], + 177: [0.08333, 0.58333, 0, 0], + 180: [0, 0.69444, 0, 0], + 215: [0.08333, 0.58333, 0, 0], + 247: [0.08333, 0.58333, 0, 0], + 305: [0, 0.43056, 0, 0], + 567: [0.19444, 0.43056, 0, 0], + 710: [0, 0.69444, 0, 0], + 711: [0, 0.62847, 0, 0], + 713: [0, 0.56778, 0, 0], + 714: [0, 0.69444, 0, 0], + 715: [0, 0.69444, 0, 0], + 728: [0, 0.69444, 0, 0], + 729: [0, 0.66786, 0, 0], + 730: [0, 0.69444, 0, 0], + 732: [0, 0.66786, 0, 0], + 768: [0, 0.69444, 0, 0], + 769: [0, 0.69444, 0, 0], + 770: [0, 0.69444, 0, 0], + 771: [0, 0.66786, 0, 0], + 772: [0, 0.56778, 0, 0], + 774: [0, 0.69444, 0, 0], + 775: [0, 0.66786, 0, 0], + 776: [0, 0.66786, 0, 0], + 778: [0, 0.69444, 0, 0], + 779: [0, 0.69444, 0, 0], + 780: [0, 0.62847, 0, 0], + 824: [0.19444, 0.69444, 0, 0], + 915: [0, 0.68333, 0, 0], + 916: [0, 0.68333, 0, 0], + 920: [0, 0.68333, 0, 0], + 923: [0, 0.68333, 0, 0], + 926: [0, 0.68333, 0, 0], + 928: [0, 0.68333, 0, 0], + 931: [0, 0.68333, 0, 0], + 933: [0, 0.68333, 0, 0], + 934: [0, 0.68333, 0, 0], + 936: [0, 0.68333, 0, 0], + 937: [0, 0.68333, 0, 0], + 8211: [0, 0.43056, 0.02778, 0], + 8212: [0, 0.43056, 0.02778, 0], + 8216: [0, 0.69444, 0, 0], + 8217: [0, 0.69444, 0, 0], + 8220: [0, 0.69444, 0, 0], + 8221: [0, 0.69444, 0, 0], + 8224: [0.19444, 0.69444, 0, 0], + 8225: [0.19444, 0.69444, 0, 0], + 8230: [0, 0.12, 0, 0], + 8242: [0, 0.55556, 0, 0], + 8407: [0, 0.71444, 0.15382, 0], + 8463: [0, 0.68889, 0, 0], + 8465: [0, 0.69444, 0, 0], + 8467: [0, 0.69444, 0, 0.11111], + 8472: [0.19444, 0.43056, 0, 0.11111], + 8476: [0, 0.69444, 0, 0], + 8501: [0, 0.69444, 0, 0], + 8592: [-0.13313, 0.36687, 0, 0], + 8593: [0.19444, 0.69444, 0, 0], + 8594: [-0.13313, 0.36687, 0, 0], + 8595: [0.19444, 0.69444, 0, 0], + 8596: [-0.13313, 0.36687, 0, 0], + 8597: [0.25, 0.75, 0, 0], + 8598: [0.19444, 0.69444, 0, 0], + 8599: [0.19444, 0.69444, 0, 0], + 8600: [0.19444, 0.69444, 0, 0], + 8601: [0.19444, 0.69444, 0, 0], + 8614: [0.011, 0.511, 0, 0], + 8617: [0.011, 0.511, 0, 0], + 8618: [0.011, 0.511, 0, 0], + 8636: [-0.13313, 0.36687, 0, 0], + 8637: [-0.13313, 0.36687, 0, 0], + 8640: [-0.13313, 0.36687, 0, 0], + 8641: [-0.13313, 0.36687, 0, 0], + 8652: [0.011, 0.671, 0, 0], + 8656: [-0.13313, 0.36687, 0, 0], + 8657: [0.19444, 0.69444, 0, 0], + 8658: [-0.13313, 0.36687, 0, 0], + 8659: [0.19444, 0.69444, 0, 0], + 8660: [-0.13313, 0.36687, 0, 0], + 8661: [0.25, 0.75, 0, 0], + 8704: [0, 0.69444, 0, 0], + 8706: [0, 0.69444, 0.05556, 0.08334], + 8707: [0, 0.69444, 0, 0], + 8709: [0.05556, 0.75, 0, 0], + 8711: [0, 0.68333, 0, 0], + 8712: [0.0391, 0.5391, 0, 0], + 8715: [0.0391, 0.5391, 0, 0], + 8722: [0.08333, 0.58333, 0, 0], + 8723: [0.08333, 0.58333, 0, 0], + 8725: [0.25, 0.75, 0, 0], + 8726: [0.25, 0.75, 0, 0], + 8727: [-0.03472, 0.46528, 0, 0], + 8728: [-0.05555, 0.44445, 0, 0], + 8729: [-0.05555, 0.44445, 0, 0], + 8730: [0.2, 0.8, 0, 0], + 8733: [0, 0.43056, 0, 0], + 8734: [0, 0.43056, 0, 0], + 8736: [0, 0.69224, 0, 0], + 8739: [0.25, 0.75, 0, 0], + 8741: [0.25, 0.75, 0, 0], + 8743: [0, 0.55556, 0, 0], + 8744: [0, 0.55556, 0, 0], + 8745: [0, 0.55556, 0, 0], + 8746: [0, 0.55556, 0, 0], + 8747: [0.19444, 0.69444, 0.11111, 0], + 8764: [-0.13313, 0.36687, 0, 0], + 8768: [0.19444, 0.69444, 0, 0], + 8771: [-0.03625, 0.46375, 0, 0], + 8773: [-0.022, 0.589, 0, 0], + 8776: [-0.01688, 0.48312, 0, 0], + 8781: [-0.03625, 0.46375, 0, 0], + 8784: [-0.133, 0.67, 0, 0], + 8800: [0.215, 0.716, 0, 0], + 8801: [-0.03625, 0.46375, 0, 0], + 8804: [0.13597, 0.63597, 0, 0], + 8805: [0.13597, 0.63597, 0, 0], + 8810: [0.0391, 0.5391, 0, 0], + 8811: [0.0391, 0.5391, 0, 0], + 8826: [0.0391, 0.5391, 0, 0], + 8827: [0.0391, 0.5391, 0, 0], + 8834: [0.0391, 0.5391, 0, 0], + 8835: [0.0391, 0.5391, 0, 0], + 8838: [0.13597, 0.63597, 0, 0], + 8839: [0.13597, 0.63597, 0, 0], + 8846: [0, 0.55556, 0, 0], + 8849: [0.13597, 0.63597, 0, 0], + 8850: [0.13597, 0.63597, 0, 0], + 8851: [0, 0.55556, 0, 0], + 8852: [0, 0.55556, 0, 0], + 8853: [0.08333, 0.58333, 0, 0], + 8854: [0.08333, 0.58333, 0, 0], + 8855: [0.08333, 0.58333, 0, 0], + 8856: [0.08333, 0.58333, 0, 0], + 8857: [0.08333, 0.58333, 0, 0], + 8866: [0, 0.69444, 0, 0], + 8867: [0, 0.69444, 0, 0], + 8868: [0, 0.69444, 0, 0], + 8869: [0, 0.69444, 0, 0], + 8872: [0.249, 0.75, 0, 0], + 8900: [-0.05555, 0.44445, 0, 0], + 8901: [-0.05555, 0.44445, 0, 0], + 8902: [-0.03472, 0.46528, 0, 0], + 8904: [0.005, 0.505, 0, 0], + 8942: [0.03, 0.9, 0, 0], + 8943: [-0.19, 0.31, 0, 0], + 8945: [-0.1, 0.82, 0, 0], + 8968: [0.25, 0.75, 0, 0], + 8969: [0.25, 0.75, 0, 0], + 8970: [0.25, 0.75, 0, 0], + 8971: [0.25, 0.75, 0, 0], + 8994: [-0.14236, 0.35764, 0, 0], + 8995: [-0.14236, 0.35764, 0, 0], + 9136: [0.244, 0.744, 0, 0], + 9137: [0.244, 0.744, 0, 0], + 9651: [0.19444, 0.69444, 0, 0], + 9657: [-0.03472, 0.46528, 0, 0], + 9661: [0.19444, 0.69444, 0, 0], + 9667: [-0.03472, 0.46528, 0, 0], + 9711: [0.19444, 0.69444, 0, 0], + 9824: [0.12963, 0.69444, 0, 0], + 9825: [0.12963, 0.69444, 0, 0], + 9826: [0.12963, 0.69444, 0, 0], + 9827: [0.12963, 0.69444, 0, 0], + 9837: [0, 0.75, 0, 0], + 9838: [0.19444, 0.69444, 0, 0], + 9839: [0.19444, 0.69444, 0, 0], + 10216: [0.25, 0.75, 0, 0], + 10217: [0.25, 0.75, 0, 0], + 10222: [0.244, 0.744, 0, 0], + 10223: [0.244, 0.744, 0, 0], + 10229: [0.011, 0.511, 0, 0], + 10230: [0.011, 0.511, 0, 0], + 10231: [0.011, 0.511, 0, 0], + 10232: [0.024, 0.525, 0, 0], + 10233: [0.024, 0.525, 0, 0], + 10234: [0.024, 0.525, 0, 0], + 10236: [0.011, 0.511, 0, 0], + 10815: [0, 0.68333, 0, 0], + 10927: [0.13597, 0.63597, 0, 0], + 10928: [0.13597, 0.63597, 0, 0], + }, + 'Math-BoldItalic': { + 47: [0.19444, 0.69444, 0, 0], + 65: [0, 0.68611, 0, 0], + 66: [0, 0.68611, 0.04835, 0], + 67: [0, 0.68611, 0.06979, 0], + 68: [0, 0.68611, 0.03194, 0], + 69: [0, 0.68611, 0.05451, 0], + 70: [0, 0.68611, 0.15972, 0], + 71: [0, 0.68611, 0, 0], + 72: [0, 0.68611, 0.08229, 0], + 73: [0, 0.68611, 0.07778, 0], + 74: [0, 0.68611, 0.10069, 0], + 75: [0, 0.68611, 0.06979, 0], + 76: [0, 0.68611, 0, 0], + 77: [0, 0.68611, 0.11424, 0], + 78: [0, 0.68611, 0.11424, 0], + 79: [0, 0.68611, 0.03194, 0], + 80: [0, 0.68611, 0.15972, 0], + 81: [0.19444, 0.68611, 0, 0], + 82: [0, 0.68611, 0.00421, 0], + 83: [0, 0.68611, 0.05382, 0], + 84: [0, 0.68611, 0.15972, 0], + 85: [0, 0.68611, 0.11424, 0], + 86: [0, 0.68611, 0.25555, 0], + 87: [0, 0.68611, 0.15972, 0], + 88: [0, 0.68611, 0.07778, 0], + 89: [0, 0.68611, 0.25555, 0], + 90: [0, 0.68611, 0.06979, 0], + 97: [0, 0.44444, 0, 0], + 98: [0, 0.69444, 0, 0], + 99: [0, 0.44444, 0, 0], + 100: [0, 0.69444, 0, 0], + 101: [0, 0.44444, 0, 0], + 102: [0.19444, 0.69444, 0.11042, 0], + 103: [0.19444, 0.44444, 0.03704, 0], + 104: [0, 0.69444, 0, 0], + 105: [0, 0.69326, 0, 0], + 106: [0.19444, 0.69326, 0.0622, 0], + 107: [0, 0.69444, 0.01852, 0], + 108: [0, 0.69444, 0.0088, 0], + 109: [0, 0.44444, 0, 0], + 110: [0, 0.44444, 0, 0], + 111: [0, 0.44444, 0, 0], + 112: [0.19444, 0.44444, 0, 0], + 113: [0.19444, 0.44444, 0.03704, 0], + 114: [0, 0.44444, 0.03194, 0], + 115: [0, 0.44444, 0, 0], + 116: [0, 0.63492, 0, 0], + 117: [0, 0.44444, 0, 0], + 118: [0, 0.44444, 0.03704, 0], + 119: [0, 0.44444, 0.02778, 0], + 120: [0, 0.44444, 0, 0], + 121: [0.19444, 0.44444, 0.03704, 0], + 122: [0, 0.44444, 0.04213, 0], + 915: [0, 0.68611, 0.15972, 0], + 916: [0, 0.68611, 0, 0], + 920: [0, 0.68611, 0.03194, 0], + 923: [0, 0.68611, 0, 0], + 926: [0, 0.68611, 0.07458, 0], + 928: [0, 0.68611, 0.08229, 0], + 931: [0, 0.68611, 0.05451, 0], + 933: [0, 0.68611, 0.15972, 0], + 934: [0, 0.68611, 0, 0], + 936: [0, 0.68611, 0.11653, 0], + 937: [0, 0.68611, 0.04835, 0], + 945: [0, 0.44444, 0, 0], + 946: [0.19444, 0.69444, 0.03403, 0], + 947: [0.19444, 0.44444, 0.06389, 0], + 948: [0, 0.69444, 0.03819, 0], + 949: [0, 0.44444, 0, 0], + 950: [0.19444, 0.69444, 0.06215, 0], + 951: [0.19444, 0.44444, 0.03704, 0], + 952: [0, 0.69444, 0.03194, 0], + 953: [0, 0.44444, 0, 0], + 954: [0, 0.44444, 0, 0], + 955: [0, 0.69444, 0, 0], + 956: [0.19444, 0.44444, 0, 0], + 957: [0, 0.44444, 0.06898, 0], + 958: [0.19444, 0.69444, 0.03021, 0], + 959: [0, 0.44444, 0, 0], + 960: [0, 0.44444, 0.03704, 0], + 961: [0.19444, 0.44444, 0, 0], + 962: [0.09722, 0.44444, 0.07917, 0], + 963: [0, 0.44444, 0.03704, 0], + 964: [0, 0.44444, 0.13472, 0], + 965: [0, 0.44444, 0.03704, 0], + 966: [0.19444, 0.44444, 0, 0], + 967: [0.19444, 0.44444, 0, 0], + 968: [0.19444, 0.69444, 0.03704, 0], + 969: [0, 0.44444, 0.03704, 0], + 977: [0, 0.69444, 0, 0], + 981: [0.19444, 0.69444, 0, 0], + 982: [0, 0.44444, 0.03194, 0], + 1009: [0.19444, 0.44444, 0, 0], + 1013: [0, 0.44444, 0, 0], + }, + 'Math-Italic': { + 47: [0.19444, 0.69444, 0, 0], + 65: [0, 0.68333, 0, 0.13889], + 66: [0, 0.68333, 0.05017, 0.08334], + 67: [0, 0.68333, 0.07153, 0.08334], + 68: [0, 0.68333, 0.02778, 0.05556], + 69: [0, 0.68333, 0.05764, 0.08334], + 70: [0, 0.68333, 0.13889, 0.08334], + 71: [0, 0.68333, 0, 0.08334], + 72: [0, 0.68333, 0.08125, 0.05556], + 73: [0, 0.68333, 0.07847, 0.11111], + 74: [0, 0.68333, 0.09618, 0.16667], + 75: [0, 0.68333, 0.07153, 0.05556], + 76: [0, 0.68333, 0, 0.02778], + 77: [0, 0.68333, 0.10903, 0.08334], + 78: [0, 0.68333, 0.10903, 0.08334], + 79: [0, 0.68333, 0.02778, 0.08334], + 80: [0, 0.68333, 0.13889, 0.08334], + 81: [0.19444, 0.68333, 0, 0.08334], + 82: [0, 0.68333, 0.00773, 0.08334], + 83: [0, 0.68333, 0.05764, 0.08334], + 84: [0, 0.68333, 0.13889, 0.08334], + 85: [0, 0.68333, 0.10903, 0.02778], + 86: [0, 0.68333, 0.22222, 0], + 87: [0, 0.68333, 0.13889, 0], + 88: [0, 0.68333, 0.07847, 0.08334], + 89: [0, 0.68333, 0.22222, 0], + 90: [0, 0.68333, 0.07153, 0.08334], + 97: [0, 0.43056, 0, 0], + 98: [0, 0.69444, 0, 0], + 99: [0, 0.43056, 0, 0.05556], + 100: [0, 0.69444, 0, 0.16667], + 101: [0, 0.43056, 0, 0.05556], + 102: [0.19444, 0.69444, 0.10764, 0.16667], + 103: [0.19444, 0.43056, 0.03588, 0.02778], + 104: [0, 0.69444, 0, 0], + 105: [0, 0.65952, 0, 0], + 106: [0.19444, 0.65952, 0.05724, 0], + 107: [0, 0.69444, 0.03148, 0], + 108: [0, 0.69444, 0.01968, 0.08334], + 109: [0, 0.43056, 0, 0], + 110: [0, 0.43056, 0, 0], + 111: [0, 0.43056, 0, 0.05556], + 112: [0.19444, 0.43056, 0, 0.08334], + 113: [0.19444, 0.43056, 0.03588, 0.08334], + 114: [0, 0.43056, 0.02778, 0.05556], + 115: [0, 0.43056, 0, 0.05556], + 116: [0, 0.61508, 0, 0.08334], + 117: [0, 0.43056, 0, 0.02778], + 118: [0, 0.43056, 0.03588, 0.02778], + 119: [0, 0.43056, 0.02691, 0.08334], + 120: [0, 0.43056, 0, 0.02778], + 121: [0.19444, 0.43056, 0.03588, 0.05556], + 122: [0, 0.43056, 0.04398, 0.05556], + 915: [0, 0.68333, 0.13889, 0.08334], + 916: [0, 0.68333, 0, 0.16667], + 920: [0, 0.68333, 0.02778, 0.08334], + 923: [0, 0.68333, 0, 0.16667], + 926: [0, 0.68333, 0.07569, 0.08334], + 928: [0, 0.68333, 0.08125, 0.05556], + 931: [0, 0.68333, 0.05764, 0.08334], + 933: [0, 0.68333, 0.13889, 0.05556], + 934: [0, 0.68333, 0, 0.08334], + 936: [0, 0.68333, 0.11, 0.05556], + 937: [0, 0.68333, 0.05017, 0.08334], + 945: [0, 0.43056, 0.0037, 0.02778], + 946: [0.19444, 0.69444, 0.05278, 0.08334], + 947: [0.19444, 0.43056, 0.05556, 0], + 948: [0, 0.69444, 0.03785, 0.05556], + 949: [0, 0.43056, 0, 0.08334], + 950: [0.19444, 0.69444, 0.07378, 0.08334], + 951: [0.19444, 0.43056, 0.03588, 0.05556], + 952: [0, 0.69444, 0.02778, 0.08334], + 953: [0, 0.43056, 0, 0.05556], + 954: [0, 0.43056, 0, 0], + 955: [0, 0.69444, 0, 0], + 956: [0.19444, 0.43056, 0, 0.02778], + 957: [0, 0.43056, 0.06366, 0.02778], + 958: [0.19444, 0.69444, 0.04601, 0.11111], + 959: [0, 0.43056, 0, 0.05556], + 960: [0, 0.43056, 0.03588, 0], + 961: [0.19444, 0.43056, 0, 0.08334], + 962: [0.09722, 0.43056, 0.07986, 0.08334], + 963: [0, 0.43056, 0.03588, 0], + 964: [0, 0.43056, 0.1132, 0.02778], + 965: [0, 0.43056, 0.03588, 0.02778], + 966: [0.19444, 0.43056, 0, 0.08334], + 967: [0.19444, 0.43056, 0, 0.05556], + 968: [0.19444, 0.69444, 0.03588, 0.11111], + 969: [0, 0.43056, 0.03588, 0], + 977: [0, 0.69444, 0, 0.08334], + 981: [0.19444, 0.69444, 0, 0.08334], + 982: [0, 0.43056, 0.02778, 0], + 1009: [0.19444, 0.43056, 0, 0.08334], + 1013: [0, 0.43056, 0, 0.05556], + }, + 'Math-Regular': { + 65: [0, 0.68333, 0, 0.13889], + 66: [0, 0.68333, 0.05017, 0.08334], + 67: [0, 0.68333, 0.07153, 0.08334], + 68: [0, 0.68333, 0.02778, 0.05556], + 69: [0, 0.68333, 0.05764, 0.08334], + 70: [0, 0.68333, 0.13889, 0.08334], + 71: [0, 0.68333, 0, 0.08334], + 72: [0, 0.68333, 0.08125, 0.05556], + 73: [0, 0.68333, 0.07847, 0.11111], + 74: [0, 0.68333, 0.09618, 0.16667], + 75: [0, 0.68333, 0.07153, 0.05556], + 76: [0, 0.68333, 0, 0.02778], + 77: [0, 0.68333, 0.10903, 0.08334], + 78: [0, 0.68333, 0.10903, 0.08334], + 79: [0, 0.68333, 0.02778, 0.08334], + 80: [0, 0.68333, 0.13889, 0.08334], + 81: [0.19444, 0.68333, 0, 0.08334], + 82: [0, 0.68333, 0.00773, 0.08334], + 83: [0, 0.68333, 0.05764, 0.08334], + 84: [0, 0.68333, 0.13889, 0.08334], + 85: [0, 0.68333, 0.10903, 0.02778], + 86: [0, 0.68333, 0.22222, 0], + 87: [0, 0.68333, 0.13889, 0], + 88: [0, 0.68333, 0.07847, 0.08334], + 89: [0, 0.68333, 0.22222, 0], + 90: [0, 0.68333, 0.07153, 0.08334], + 97: [0, 0.43056, 0, 0], + 98: [0, 0.69444, 0, 0], + 99: [0, 0.43056, 0, 0.05556], + 100: [0, 0.69444, 0, 0.16667], + 101: [0, 0.43056, 0, 0.05556], + 102: [0.19444, 0.69444, 0.10764, 0.16667], + 103: [0.19444, 0.43056, 0.03588, 0.02778], + 104: [0, 0.69444, 0, 0], + 105: [0, 0.65952, 0, 0], + 106: [0.19444, 0.65952, 0.05724, 0], + 107: [0, 0.69444, 0.03148, 0], + 108: [0, 0.69444, 0.01968, 0.08334], + 109: [0, 0.43056, 0, 0], + 110: [0, 0.43056, 0, 0], + 111: [0, 0.43056, 0, 0.05556], + 112: [0.19444, 0.43056, 0, 0.08334], + 113: [0.19444, 0.43056, 0.03588, 0.08334], + 114: [0, 0.43056, 0.02778, 0.05556], + 115: [0, 0.43056, 0, 0.05556], + 116: [0, 0.61508, 0, 0.08334], + 117: [0, 0.43056, 0, 0.02778], + 118: [0, 0.43056, 0.03588, 0.02778], + 119: [0, 0.43056, 0.02691, 0.08334], + 120: [0, 0.43056, 0, 0.02778], + 121: [0.19444, 0.43056, 0.03588, 0.05556], + 122: [0, 0.43056, 0.04398, 0.05556], + 915: [0, 0.68333, 0.13889, 0.08334], + 916: [0, 0.68333, 0, 0.16667], + 920: [0, 0.68333, 0.02778, 0.08334], + 923: [0, 0.68333, 0, 0.16667], + 926: [0, 0.68333, 0.07569, 0.08334], + 928: [0, 0.68333, 0.08125, 0.05556], + 931: [0, 0.68333, 0.05764, 0.08334], + 933: [0, 0.68333, 0.13889, 0.05556], + 934: [0, 0.68333, 0, 0.08334], + 936: [0, 0.68333, 0.11, 0.05556], + 937: [0, 0.68333, 0.05017, 0.08334], + 945: [0, 0.43056, 0.0037, 0.02778], + 946: [0.19444, 0.69444, 0.05278, 0.08334], + 947: [0.19444, 0.43056, 0.05556, 0], + 948: [0, 0.69444, 0.03785, 0.05556], + 949: [0, 0.43056, 0, 0.08334], + 950: [0.19444, 0.69444, 0.07378, 0.08334], + 951: [0.19444, 0.43056, 0.03588, 0.05556], + 952: [0, 0.69444, 0.02778, 0.08334], + 953: [0, 0.43056, 0, 0.05556], + 954: [0, 0.43056, 0, 0], + 955: [0, 0.69444, 0, 0], + 956: [0.19444, 0.43056, 0, 0.02778], + 957: [0, 0.43056, 0.06366, 0.02778], + 958: [0.19444, 0.69444, 0.04601, 0.11111], + 959: [0, 0.43056, 0, 0.05556], + 960: [0, 0.43056, 0.03588, 0], + 961: [0.19444, 0.43056, 0, 0.08334], + 962: [0.09722, 0.43056, 0.07986, 0.08334], + 963: [0, 0.43056, 0.03588, 0], + 964: [0, 0.43056, 0.1132, 0.02778], + 965: [0, 0.43056, 0.03588, 0.02778], + 966: [0.19444, 0.43056, 0, 0.08334], + 967: [0.19444, 0.43056, 0, 0.05556], + 968: [0.19444, 0.69444, 0.03588, 0.11111], + 969: [0, 0.43056, 0.03588, 0], + 977: [0, 0.69444, 0, 0.08334], + 981: [0.19444, 0.69444, 0, 0.08334], + 982: [0, 0.43056, 0.02778, 0], + 1009: [0.19444, 0.43056, 0, 0.08334], + 1013: [0, 0.43056, 0, 0.05556], + }, + 'SansSerif-Regular': { + 33: [0, 0.69444, 0, 0], + 34: [0, 0.69444, 0, 0], + 35: [0.19444, 0.69444, 0, 0], + 36: [0.05556, 0.75, 0, 0], + 37: [0.05556, 0.75, 0, 0], + 38: [0, 0.69444, 0, 0], + 39: [0, 0.69444, 0, 0], + 40: [0.25, 0.75, 0, 0], + 41: [0.25, 0.75, 0, 0], + 42: [0, 0.75, 0, 0], + 43: [0.08333, 0.58333, 0, 0], + 44: [0.125, 0.08333, 0, 0], + 45: [0, 0.44444, 0, 0], + 46: [0, 0.08333, 0, 0], + 47: [0.25, 0.75, 0, 0], + 48: [0, 0.65556, 0, 0], + 49: [0, 0.65556, 0, 0], + 50: [0, 0.65556, 0, 0], + 51: [0, 0.65556, 0, 0], + 52: [0, 0.65556, 0, 0], + 53: [0, 0.65556, 0, 0], + 54: [0, 0.65556, 0, 0], + 55: [0, 0.65556, 0, 0], + 56: [0, 0.65556, 0, 0], + 57: [0, 0.65556, 0, 0], + 58: [0, 0.44444, 0, 0], + 59: [0.125, 0.44444, 0, 0], + 61: [-0.13, 0.37, 0, 0], + 63: [0, 0.69444, 0, 0], + 64: [0, 0.69444, 0, 0], + 65: [0, 0.69444, 0, 0], + 66: [0, 0.69444, 0, 0], + 67: [0, 0.69444, 0, 0], + 68: [0, 0.69444, 0, 0], + 69: [0, 0.69444, 0, 0], + 70: [0, 0.69444, 0, 0], + 71: [0, 0.69444, 0, 0], + 72: [0, 0.69444, 0, 0], + 73: [0, 0.69444, 0, 0], + 74: [0, 0.69444, 0, 0], + 75: [0, 0.69444, 0, 0], + 76: [0, 0.69444, 0, 0], + 77: [0, 0.69444, 0, 0], + 78: [0, 0.69444, 0, 0], + 79: [0, 0.69444, 0, 0], + 80: [0, 0.69444, 0, 0], + 81: [0.125, 0.69444, 0, 0], + 82: [0, 0.69444, 0, 0], + 83: [0, 0.69444, 0, 0], + 84: [0, 0.69444, 0, 0], + 85: [0, 0.69444, 0, 0], + 86: [0, 0.69444, 0.01389, 0], + 87: [0, 0.69444, 0.01389, 0], + 88: [0, 0.69444, 0, 0], + 89: [0, 0.69444, 0.025, 0], + 90: [0, 0.69444, 0, 0], + 91: [0.25, 0.75, 0, 0], + 93: [0.25, 0.75, 0, 0], + 94: [0, 0.69444, 0, 0], + 95: [0.35, 0.09444, 0.02778, 0], + 97: [0, 0.44444, 0, 0], + 98: [0, 0.69444, 0, 0], + 99: [0, 0.44444, 0, 0], + 100: [0, 0.69444, 0, 0], + 101: [0, 0.44444, 0, 0], + 102: [0, 0.69444, 0.06944, 0], + 103: [0.19444, 0.44444, 0.01389, 0], + 104: [0, 0.69444, 0, 0], + 105: [0, 0.67937, 0, 0], + 106: [0.19444, 0.67937, 0, 0], + 107: [0, 0.69444, 0, 0], + 108: [0, 0.69444, 0, 0], + 109: [0, 0.44444, 0, 0], + 110: [0, 0.44444, 0, 0], + 111: [0, 0.44444, 0, 0], + 112: [0.19444, 0.44444, 0, 0], + 113: [0.19444, 0.44444, 0, 0], + 114: [0, 0.44444, 0.01389, 0], + 115: [0, 0.44444, 0, 0], + 116: [0, 0.57143, 0, 0], + 117: [0, 0.44444, 0, 0], + 118: [0, 0.44444, 0.01389, 0], + 119: [0, 0.44444, 0.01389, 0], + 120: [0, 0.44444, 0, 0], + 121: [0.19444, 0.44444, 0.01389, 0], + 122: [0, 0.44444, 0, 0], + 126: [0.35, 0.32659, 0, 0], + 305: [0, 0.44444, 0, 0], + 567: [0.19444, 0.44444, 0, 0], + 768: [0, 0.69444, 0, 0], + 769: [0, 0.69444, 0, 0], + 770: [0, 0.69444, 0, 0], + 771: [0, 0.67659, 0, 0], + 772: [0, 0.60889, 0, 0], + 774: [0, 0.69444, 0, 0], + 775: [0, 0.67937, 0, 0], + 776: [0, 0.67937, 0, 0], + 778: [0, 0.69444, 0, 0], + 779: [0, 0.69444, 0, 0], + 780: [0, 0.63194, 0, 0], + 915: [0, 0.69444, 0, 0], + 916: [0, 0.69444, 0, 0], + 920: [0, 0.69444, 0, 0], + 923: [0, 0.69444, 0, 0], + 926: [0, 0.69444, 0, 0], + 928: [0, 0.69444, 0, 0], + 931: [0, 0.69444, 0, 0], + 933: [0, 0.69444, 0, 0], + 934: [0, 0.69444, 0, 0], + 936: [0, 0.69444, 0, 0], + 937: [0, 0.69444, 0, 0], + 8211: [0, 0.44444, 0.02778, 0], + 8212: [0, 0.44444, 0.02778, 0], + 8216: [0, 0.69444, 0, 0], + 8217: [0, 0.69444, 0, 0], + 8220: [0, 0.69444, 0, 0], + 8221: [0, 0.69444, 0, 0], + }, + 'Script-Regular': { + 65: [0, 0.7, 0.22925, 0], + 66: [0, 0.7, 0.04087, 0], + 67: [0, 0.7, 0.1689, 0], + 68: [0, 0.7, 0.09371, 0], + 69: [0, 0.7, 0.18583, 0], + 70: [0, 0.7, 0.13634, 0], + 71: [0, 0.7, 0.17322, 0], + 72: [0, 0.7, 0.29694, 0], + 73: [0, 0.7, 0.19189, 0], + 74: [0.27778, 0.7, 0.19189, 0], + 75: [0, 0.7, 0.31259, 0], + 76: [0, 0.7, 0.19189, 0], + 77: [0, 0.7, 0.15981, 0], + 78: [0, 0.7, 0.3525, 0], + 79: [0, 0.7, 0.08078, 0], + 80: [0, 0.7, 0.08078, 0], + 81: [0, 0.7, 0.03305, 0], + 82: [0, 0.7, 0.06259, 0], + 83: [0, 0.7, 0.19189, 0], + 84: [0, 0.7, 0.29087, 0], + 85: [0, 0.7, 0.25815, 0], + 86: [0, 0.7, 0.27523, 0], + 87: [0, 0.7, 0.27523, 0], + 88: [0, 0.7, 0.26006, 0], + 89: [0, 0.7, 0.2939, 0], + 90: [0, 0.7, 0.24037, 0], + }, + 'Size1-Regular': { + 40: [0.35001, 0.85, 0, 0], + 41: [0.35001, 0.85, 0, 0], + 47: [0.35001, 0.85, 0, 0], + 91: [0.35001, 0.85, 0, 0], + 92: [0.35001, 0.85, 0, 0], + 93: [0.35001, 0.85, 0, 0], + 123: [0.35001, 0.85, 0, 0], + 125: [0.35001, 0.85, 0, 0], + 710: [0, 0.72222, 0, 0], + 732: [0, 0.72222, 0, 0], + 770: [0, 0.72222, 0, 0], + 771: [0, 0.72222, 0, 0], + 8214: [-99e-5, 0.601, 0, 0], + 8593: [1e-5, 0.6, 0, 0], + 8595: [1e-5, 0.6, 0, 0], + 8657: [1e-5, 0.6, 0, 0], + 8659: [1e-5, 0.6, 0, 0], + 8719: [0.25001, 0.75, 0, 0], + 8720: [0.25001, 0.75, 0, 0], + 8721: [0.25001, 0.75, 0, 0], + 8730: [0.35001, 0.85, 0, 0], + 8739: [-0.00599, 0.606, 0, 0], + 8741: [-0.00599, 0.606, 0, 0], + 8747: [0.30612, 0.805, 0.19445, 0], + 8748: [0.306, 0.805, 0.19445, 0], + 8749: [0.306, 0.805, 0.19445, 0], + 8750: [0.30612, 0.805, 0.19445, 0], + 8896: [0.25001, 0.75, 0, 0], + 8897: [0.25001, 0.75, 0, 0], + 8898: [0.25001, 0.75, 0, 0], + 8899: [0.25001, 0.75, 0, 0], + 8968: [0.35001, 0.85, 0, 0], + 8969: [0.35001, 0.85, 0, 0], + 8970: [0.35001, 0.85, 0, 0], + 8971: [0.35001, 0.85, 0, 0], + 9168: [-99e-5, 0.601, 0, 0], + 10216: [0.35001, 0.85, 0, 0], + 10217: [0.35001, 0.85, 0, 0], + 10752: [0.25001, 0.75, 0, 0], + 10753: [0.25001, 0.75, 0, 0], + 10754: [0.25001, 0.75, 0, 0], + 10756: [0.25001, 0.75, 0, 0], + 10758: [0.25001, 0.75, 0, 0], + }, + 'Size2-Regular': { + 40: [0.65002, 1.15, 0, 0], + 41: [0.65002, 1.15, 0, 0], + 47: [0.65002, 1.15, 0, 0], + 91: [0.65002, 1.15, 0, 0], + 92: [0.65002, 1.15, 0, 0], + 93: [0.65002, 1.15, 0, 0], + 123: [0.65002, 1.15, 0, 0], + 125: [0.65002, 1.15, 0, 0], + 710: [0, 0.75, 0, 0], + 732: [0, 0.75, 0, 0], + 770: [0, 0.75, 0, 0], + 771: [0, 0.75, 0, 0], + 8719: [0.55001, 1.05, 0, 0], + 8720: [0.55001, 1.05, 0, 0], + 8721: [0.55001, 1.05, 0, 0], + 8730: [0.65002, 1.15, 0, 0], + 8747: [0.86225, 1.36, 0.44445, 0], + 8748: [0.862, 1.36, 0.44445, 0], + 8749: [0.862, 1.36, 0.44445, 0], + 8750: [0.86225, 1.36, 0.44445, 0], + 8896: [0.55001, 1.05, 0, 0], + 8897: [0.55001, 1.05, 0, 0], + 8898: [0.55001, 1.05, 0, 0], + 8899: [0.55001, 1.05, 0, 0], + 8968: [0.65002, 1.15, 0, 0], + 8969: [0.65002, 1.15, 0, 0], + 8970: [0.65002, 1.15, 0, 0], + 8971: [0.65002, 1.15, 0, 0], + 10216: [0.65002, 1.15, 0, 0], + 10217: [0.65002, 1.15, 0, 0], + 10752: [0.55001, 1.05, 0, 0], + 10753: [0.55001, 1.05, 0, 0], + 10754: [0.55001, 1.05, 0, 0], + 10756: [0.55001, 1.05, 0, 0], + 10758: [0.55001, 1.05, 0, 0], + }, + 'Size3-Regular': { + 40: [0.95003, 1.45, 0, 0], + 41: [0.95003, 1.45, 0, 0], + 47: [0.95003, 1.45, 0, 0], + 91: [0.95003, 1.45, 0, 0], + 92: [0.95003, 1.45, 0, 0], + 93: [0.95003, 1.45, 0, 0], + 123: [0.95003, 1.45, 0, 0], + 125: [0.95003, 1.45, 0, 0], + 710: [0, 0.75, 0, 0], + 732: [0, 0.75, 0, 0], + 770: [0, 0.75, 0, 0], + 771: [0, 0.75, 0, 0], + 8730: [0.95003, 1.45, 0, 0], + 8968: [0.95003, 1.45, 0, 0], + 8969: [0.95003, 1.45, 0, 0], + 8970: [0.95003, 1.45, 0, 0], + 8971: [0.95003, 1.45, 0, 0], + 10216: [0.95003, 1.45, 0, 0], + 10217: [0.95003, 1.45, 0, 0], + }, + 'Size4-Regular': { + 40: [1.25003, 1.75, 0, 0], + 41: [1.25003, 1.75, 0, 0], + 47: [1.25003, 1.75, 0, 0], + 91: [1.25003, 1.75, 0, 0], + 92: [1.25003, 1.75, 0, 0], + 93: [1.25003, 1.75, 0, 0], + 123: [1.25003, 1.75, 0, 0], + 125: [1.25003, 1.75, 0, 0], + 710: [0, 0.825, 0, 0], + 732: [0, 0.825, 0, 0], + 770: [0, 0.825, 0, 0], + 771: [0, 0.825, 0, 0], + 8730: [1.25003, 1.75, 0, 0], + 8968: [1.25003, 1.75, 0, 0], + 8969: [1.25003, 1.75, 0, 0], + 8970: [1.25003, 1.75, 0, 0], + 8971: [1.25003, 1.75, 0, 0], + 9115: [0.64502, 1.155, 0, 0], + 9116: [1e-5, 0.6, 0, 0], + 9117: [0.64502, 1.155, 0, 0], + 9118: [0.64502, 1.155, 0, 0], + 9119: [1e-5, 0.6, 0, 0], + 9120: [0.64502, 1.155, 0, 0], + 9121: [0.64502, 1.155, 0, 0], + 9122: [-99e-5, 0.601, 0, 0], + 9123: [0.64502, 1.155, 0, 0], + 9124: [0.64502, 1.155, 0, 0], + 9125: [-99e-5, 0.601, 0, 0], + 9126: [0.64502, 1.155, 0, 0], + 9127: [1e-5, 0.9, 0, 0], + 9128: [0.65002, 1.15, 0, 0], + 9129: [0.90001, 0, 0, 0], + 9130: [0, 0.3, 0, 0], + 9131: [1e-5, 0.9, 0, 0], + 9132: [0.65002, 1.15, 0, 0], + 9133: [0.90001, 0, 0, 0], + 9143: [0.88502, 0.915, 0, 0], + 10216: [1.25003, 1.75, 0, 0], + 10217: [1.25003, 1.75, 0, 0], + 57344: [-0.00499, 0.605, 0, 0], + 57345: [-0.00499, 0.605, 0, 0], + 57680: [0, 0.12, 0, 0], + 57681: [0, 0.12, 0, 0], + 57682: [0, 0.12, 0, 0], + 57683: [0, 0.12, 0, 0], + }, + 'Typewriter-Regular': { + 33: [0, 0.61111, 0, 0], + 34: [0, 0.61111, 0, 0], + 35: [0, 0.61111, 0, 0], + 36: [0.08333, 0.69444, 0, 0], + 37: [0.08333, 0.69444, 0, 0], + 38: [0, 0.61111, 0, 0], + 39: [0, 0.61111, 0, 0], + 40: [0.08333, 0.69444, 0, 0], + 41: [0.08333, 0.69444, 0, 0], + 42: [0, 0.52083, 0, 0], + 43: [-0.08056, 0.53055, 0, 0], + 44: [0.13889, 0.125, 0, 0], + 45: [-0.08056, 0.53055, 0, 0], + 46: [0, 0.125, 0, 0], + 47: [0.08333, 0.69444, 0, 0], + 48: [0, 0.61111, 0, 0], + 49: [0, 0.61111, 0, 0], + 50: [0, 0.61111, 0, 0], + 51: [0, 0.61111, 0, 0], + 52: [0, 0.61111, 0, 0], + 53: [0, 0.61111, 0, 0], + 54: [0, 0.61111, 0, 0], + 55: [0, 0.61111, 0, 0], + 56: [0, 0.61111, 0, 0], + 57: [0, 0.61111, 0, 0], + 58: [0, 0.43056, 0, 0], + 59: [0.13889, 0.43056, 0, 0], + 60: [-0.05556, 0.55556, 0, 0], + 61: [-0.19549, 0.41562, 0, 0], + 62: [-0.05556, 0.55556, 0, 0], + 63: [0, 0.61111, 0, 0], + 64: [0, 0.61111, 0, 0], + 65: [0, 0.61111, 0, 0], + 66: [0, 0.61111, 0, 0], + 67: [0, 0.61111, 0, 0], + 68: [0, 0.61111, 0, 0], + 69: [0, 0.61111, 0, 0], + 70: [0, 0.61111, 0, 0], + 71: [0, 0.61111, 0, 0], + 72: [0, 0.61111, 0, 0], + 73: [0, 0.61111, 0, 0], + 74: [0, 0.61111, 0, 0], + 75: [0, 0.61111, 0, 0], + 76: [0, 0.61111, 0, 0], + 77: [0, 0.61111, 0, 0], + 78: [0, 0.61111, 0, 0], + 79: [0, 0.61111, 0, 0], + 80: [0, 0.61111, 0, 0], + 81: [0.13889, 0.61111, 0, 0], + 82: [0, 0.61111, 0, 0], + 83: [0, 0.61111, 0, 0], + 84: [0, 0.61111, 0, 0], + 85: [0, 0.61111, 0, 0], + 86: [0, 0.61111, 0, 0], + 87: [0, 0.61111, 0, 0], + 88: [0, 0.61111, 0, 0], + 89: [0, 0.61111, 0, 0], + 90: [0, 0.61111, 0, 0], + 91: [0.08333, 0.69444, 0, 0], + 92: [0.08333, 0.69444, 0, 0], + 93: [0.08333, 0.69444, 0, 0], + 94: [0, 0.61111, 0, 0], + 95: [0.09514, 0, 0, 0], + 96: [0, 0.61111, 0, 0], + 97: [0, 0.43056, 0, 0], + 98: [0, 0.61111, 0, 0], + 99: [0, 0.43056, 0, 0], + 100: [0, 0.61111, 0, 0], + 101: [0, 0.43056, 0, 0], + 102: [0, 0.61111, 0, 0], + 103: [0.22222, 0.43056, 0, 0], + 104: [0, 0.61111, 0, 0], + 105: [0, 0.61111, 0, 0], + 106: [0.22222, 0.61111, 0, 0], + 107: [0, 0.61111, 0, 0], + 108: [0, 0.61111, 0, 0], + 109: [0, 0.43056, 0, 0], + 110: [0, 0.43056, 0, 0], + 111: [0, 0.43056, 0, 0], + 112: [0.22222, 0.43056, 0, 0], + 113: [0.22222, 0.43056, 0, 0], + 114: [0, 0.43056, 0, 0], + 115: [0, 0.43056, 0, 0], + 116: [0, 0.55358, 0, 0], + 117: [0, 0.43056, 0, 0], + 118: [0, 0.43056, 0, 0], + 119: [0, 0.43056, 0, 0], + 120: [0, 0.43056, 0, 0], + 121: [0.22222, 0.43056, 0, 0], + 122: [0, 0.43056, 0, 0], + 123: [0.08333, 0.69444, 0, 0], + 124: [0.08333, 0.69444, 0, 0], + 125: [0.08333, 0.69444, 0, 0], + 126: [0, 0.61111, 0, 0], + 127: [0, 0.61111, 0, 0], + 305: [0, 0.43056, 0, 0], + 567: [0.22222, 0.43056, 0, 0], + 768: [0, 0.61111, 0, 0], + 769: [0, 0.61111, 0, 0], + 770: [0, 0.61111, 0, 0], + 771: [0, 0.61111, 0, 0], + 772: [0, 0.56555, 0, 0], + 774: [0, 0.61111, 0, 0], + 776: [0, 0.61111, 0, 0], + 778: [0, 0.61111, 0, 0], + 780: [0, 0.56597, 0, 0], + 915: [0, 0.61111, 0, 0], + 916: [0, 0.61111, 0, 0], + 920: [0, 0.61111, 0, 0], + 923: [0, 0.61111, 0, 0], + 926: [0, 0.61111, 0, 0], + 928: [0, 0.61111, 0, 0], + 931: [0, 0.61111, 0, 0], + 933: [0, 0.61111, 0, 0], + 934: [0, 0.61111, 0, 0], + 936: [0, 0.61111, 0, 0], + 937: [0, 0.61111, 0, 0], + 2018: [0, 0.61111, 0, 0], + 2019: [0, 0.61111, 0, 0], + 8242: [0, 0.61111, 0, 0], + }, + }; + const l = /[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/, + c = { + slant: [0.25, 0.25, 0.25], + space: [0, 0, 0], + stretch: [0, 0, 0], + shrink: [0, 0, 0], + xHeight: [0.431, 0.431, 0.431], + quad: [1, 1.171, 1.472], + extraSpace: [0, 0, 0], + num1: [0.677, 0.732, 0.925], + num2: [0.394, 0.384, 0.387], + num3: [0.444, 0.471, 0.504], + denom1: [0.686, 0.752, 1.025], + denom2: [0.345, 0.344, 0.532], + sup1: [0.413, 0.503, 0.504], + sup2: [0.363, 0.431, 0.404], + sup3: [0.289, 0.286, 0.294], + sub1: [0.15, 0.143, 0.2], + sub2: [0.247, 0.286, 0.4], + supDrop: [0.386, 0.353, 0.494], + subDrop: [0.05, 0.071, 0.1], + delim1: [2.39, 1.7, 1.98], + delim2: [1.01, 1.157, 1.42], + axisHeight: [0.25, 0.25, 0.25], + }, + h = { + defaultRuleThickness: 0.04, + bigOpSpacing1: 0.111, + bigOpSpacing2: 0.166, + bigOpSpacing3: 0.2, + bigOpSpacing4: 0.6, + bigOpSpacing5: 0.1, + ptPerEm: 10, + pxPerEm: 40 / 3, + doubleRuleSep: 0.2, + arraycolsep: 0.5, + baselineskip: 1.2, + arrayrulewidth: 0.04, + fboxsep: 0.3, + fboxrule: 0.04, + }, + d = { + ' ': ' ', + '​': ' ', + Å: 'A', + Ç: 'C', + Ð: 'D', + Þ: 'o', + å: 'a', + ç: 'c', + ð: 'd', + þ: 'o', + А: 'A', + Б: 'B', + В: 'B', + Г: 'F', + Д: 'A', + Е: 'E', + Ж: 'K', + З: '3', + И: 'N', + Й: 'N', + К: 'K', + Л: 'N', + М: 'M', + Н: 'H', + О: 'O', + П: 'N', + Р: 'P', + С: 'C', + Т: 'T', + У: 'y', + Ф: 'O', + Х: 'X', + Ц: 'U', + Ч: 'h', + Ш: 'W', + Щ: 'W', + Ъ: 'B', + Ы: 'X', + Ь: 'B', + Э: '3', + Ю: 'X', + Я: 'R', + а: 'a', + б: 'b', + в: 'a', + г: 'r', + д: 'y', + е: 'e', + ж: 'm', + з: 'e', + и: 'n', + й: 'n', + к: 'n', + л: 'n', + м: 'm', + н: 'n', + о: 'o', + п: 'n', + р: 'p', + с: 'c', + т: 'o', + у: 'y', + ф: 'b', + х: 'x', + ц: 'n', + ч: 'n', + ш: 'w', + щ: 'w', + ъ: 'a', + ы: 'm', + ь: 'a', + э: 'e', + ю: 'm', + я: 'r', + }; + function p(t, e, i) { + if ('string' == typeof t) { + const i = t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/); + i + ? ((t = parseFloat(i[1])), (e = i[2].toLowerCase())) + : (t = parseFloat(t)); + } + const s = + { + pt: 1, + mm: 7227 / 2540, + cm: 7227 / 254, + ex: 35271 / 8192, + px: 0.75, + em: h.ptPerEm, + bp: 1.00375, + dd: 1238 / 1157, + pc: 12, + in: 72.27, + mu: 10 / 18, + }[e] || 1; + if (isFinite(i)) { + const e = Math.pow(10, i); + return Math.round((t / h.ptPerEm) * s * e) / e; + } + return (t / h.ptPerEm) * s; + } + var m = { + toEm: p, + toPx: function(t, e) { + return p(t, e) * (4 / 3) * h.ptPerEm; + }, + METRICS: h, + SIGMAS: c, + getCharacterMetrics: function(t, e) { + const i = + { + cal: 'Caligraphic-Regular', + ams: 'AMS-Regular', + frak: 'Fraktur-Regular', + bb: 'AMS-Regular', + scr: 'Script-Regular', + cmr: 'Main-Regular', + cmtt: 'Typewriter-Regular', + cmss: 'SansSerif-Regular', + }[e] || e; + let s = t.charCodeAt(0); + t[0] in d + ? (s = d[t[0]].charCodeAt(0)) + : l.test(t[0]) && (s = 77); + const a = r[i][s]; + return a + ? a + ? { + depth: a[0], + height: a[1], + italic: a[2], + skew: a[3], + } + : null + : { + defaultMetrics: !0, + depth: 0.2, + height: 0.7, + italic: 0, + skew: 0, + }; + }, + }; + const u = [{}, {}, {}]; + let f; + for (const t in c) + if (Object.prototype.hasOwnProperty.call(c, t)) + for (f = 0; f < 3; f++) u[f][t] = c[t][f]; + for (f = 0; f < 3; f++) u[f].emPerEx = c.xHeight[f] / c.quad[f]; + class g { + constructor(t, e, i, s) { + (this.id = t), + (this.size = e), + (this.cramped = s), + (this.sizeMultiplier = i), + (this.metrics = u[e > 0 ? e - 1 : 0]); + } + sup() { + return y[k[this.id]]; + } + sub() { + return y[v[this.id]]; + } + fracNum() { + return y[w[this.id]]; + } + fracDen() { + return y[S[this.id]]; + } + cramp() { + return y[A[this.id]]; + } + cls() { + return b[this.size]; + } + adjustTo(t) { + let e = x[this.size][t.size]; + return e.length > 0 && (e = ' ' + e), e; + } + isTight() { + return this.size >= 2; + } + } + const y = [ + new g(0, 0, 1, !1), + new g(1, 0, 1, !0), + new g(2, 1, 1, !1), + new g(3, 1, 1, !0), + new g(4, 2, 0.7, !1), + new g(5, 2, 0.7, !0), + new g(6, 3, 0.5, !1), + new g(7, 3, 0.5, !0), + ], + b = [ + 'displaystyle textstyle', + 'textstyle', + 'scriptstyle', + 'scriptscriptstyle', + ], + x = [ + [ + '', + '', + 'reset-textstyle scriptstyle', + 'reset-textstyle scriptscriptstyle', + ], + [ + 'reset-textstyle displaystyle textstyle', + '', + 'reset-textstyle scriptstyle', + 'reset-textstyle scriptscriptstyle', + ], + [ + 'reset-scriptstyle textstyle displaystyle', + 'reset-scriptstyle textstyle', + '', + 'reset-scriptstyle scriptscriptstyle', + ], + [ + 'reset-scriptscriptstyle textstyle displaystyle', + 'reset-scriptscriptstyle textstyle', + 'reset-scriptscriptstyle scriptstyle', + '', + ], + ], + k = [4, 5, 4, 5, 6, 7, 6, 7], + v = [5, 5, 5, 5, 7, 7, 7, 7], + w = [2, 3, 4, 5, 6, 7, 6, 7], + S = [3, 3, 5, 5, 7, 7, 7, 7], + A = [1, 1, 3, 3, 5, 5, 7, 7]; + var M = { + DISPLAY: y[0], + TEXT: y[2], + SCRIPT: y[4], + SCRIPTSCRIPT: y[6], + toMathstyle: function(t) { + return t + ? 'object' == typeof t + ? t + : { + displaystyle: y[0], + textstyle: y[2], + scriptstyle: y[4], + scriptscriptstyle: y[6], + }[t] + : t; + }, + }; + class C { + constructor(t) { + (this.macros = t.macros || {}), + (this.generateID = !!t.generateID && t.generateID), + (this.mathstyle = M.toMathstyle( + t.mathstyle || 'displaystyle' + )), + (this.size = t.size || 'size5'), + (this.parentMathstyle = + t.parentMathstyle || this.mathstyle), + (this.parentSize = t.parentSize || this.size), + (this.opacity = t.opacity); + } + clone(t) { + const e = new C(this); + return ( + (e.parentMathstyle = this.mathstyle), + (e.parentSize = this.size), + (e.macros = this.macros), + t && + (('auto' !== t.mathstyle && t.mathstyle) || + delete t.mathstyle, + Object.assign(e, t), + 'string' == typeof t.mathstyle && + (e.mathstyle = M.toMathstyle(t.mathstyle))), + e + ); + } + setMathstyle(t) { + t && 'auto' !== t && (this.mathstyle = M.toMathstyle(t)); + } + cramp() { + return this.clone({ mathstyle: this.mathstyle.cramp() }); + } + sup() { + return this.clone({ mathstyle: this.mathstyle.sup() }); + } + sub() { + return this.clone({ mathstyle: this.mathstyle.sup() }); + } + } + var _ = C; + function T(t) { + let e = ''; + if ('number' == typeof t) e += Math.floor(100 * t) / 100; + else if ('string' == typeof t) e += t; + else if (Array.isArray(t)) for (const i of t) e += T(i); + else t && (e += t.toString()); + return e; + } + class L { + constructor(t, e) { + (this.classes = e || ''), + Array.isArray(t) + ? (this.children = [].concat.apply([], t)) + : 'string' == typeof t + ? (this.body = t) + : t && 'object' == typeof t && (this.children = [t]), + (this.style = null), + this.updateDimensions(); + } + updateDimensions() { + let t = 0, + e = 0, + i = 1; + this.children && + this.children.forEach(s => { + s.height > t && (t = s.height), + s.depth > e && (e = s.depth), + s.maxFontSize > i && (i = s.maxFontSize); + }), + (this.height = t), + (this.depth = e), + (this.maxFontSize = i); + } + selected(t) { + t && + !/ML__selected/.test(this.classes) && + (this.classes.length > 0 && (this.classes += ' '), + (this.classes += 'ML__selected')), + !t && + /ML__selected/.test(this.classes) && + (this.classes = this.classes.replace( + 'ML__selected', + '' + )), + this.children && this.children.forEach(e => e.selected(t)); + } + applyStyle(t) { + if (!t) return; + if ( + (t.color && + ('none' !== t.color + ? this.setStyle('color', t.color) + : this.setStyle('color', '')), + t.backgroundColor && + ('none' !== t.backgroundColor + ? this.setStyle( + 'background-color', + t.backgroundColor + ) + : this.setStyle('background-color', '')), + t.cssClass && (this.classes += ' ' + t.cssClass), + !this.body) + ) + return; + let e = t.fontFamily; + 'math' === e && 'n' === t.fontShape && (e = 'cmr'); + let i = 'Main-Regular'; + if ( + (e && + (i = (function(t, e) { + if ( + 'string' != typeof t || + t.length > 1 || + '​' === t + ) + return K[e]; + if ('bb' === e || 'scr' === e) { + if (!/^[A-Z ]$/.test(t)) return null; + } else if ('cal' === e) { + if (!/^[0-9A-Z ]$/.test(t)) return null; + } else if ('frak' === e) { + if ( + !/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test( + t + ) + ) + return null; + } else if ( + ('cmtt' === e || 'cmss' === e) && + !/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test( + t + ) + ) + return null; + return K[e]; + })(this.body, e)), + t.fontShape && + (this.classes += + ' ' + + ({ + it: 'ML__it', + sl: 'ML__shape_sl', + sc: 'ML__shape_sc', + ol: 'ML__shape_ol', + }[t.fontShape] || '')), + t.fontSeries) + ) { + const e = t.fontSeries.match(/(.?[lbm])?(.?[cx])?/); + e && + ((this.classes += + ' ' + + ({ + ul: 'ML__series_ul', + el: 'ML__series_el', + l: 'ML__series_l', + sl: 'ML__series_sl', + m: '', + sb: 'ML__series_sb', + b: 'ML__bold', + eb: 'ML__series_eb', + ub: 'ML__series_ub', + }[e[1] || ''] || '')), + (this.classes += + ' ' + + ({ + uc: 'ML__series_uc', + ec: 'ML__series_ec', + c: 'ML__series_c', + sc: 'ML__series_sc', + n: '', + sx: 'ML__series_sx', + x: 'ML__series_x', + ex: 'ML__series_ex', + ux: 'ML__series_ux', + }[e[2] || ''] || ''))); + } + if ( + (N[e] + ? (this.classes += ' ' + N[e]) + : e && this.setStyle('font-family', e), + this.body && this.body.length > 0 && i) + ) { + (this.height = 0), + (this.depth = 0), + (this.maxFontSize = + { + size1: 0.5, + size2: 0.7, + size3: 0.8, + size4: 0.9, + size5: 1, + size6: 1.2, + size7: 1.44, + size8: 1.73, + size9: 2.07, + size10: 2.49, + }[t.fontSize] || 1), + (this.skew = 0), + (this.italic = 0); + for (let t = 0; t < this.body.length; t++) { + const e = m.getCharacterMetrics(this.body.charAt(t), i); + e && + ((this.height = Math.max(this.height, e.height)), + (this.depth = Math.max(this.depth, e.depth)), + (this.skew = e.skew), + (this.italic = e.italic)); + } + } + } + setStyle(t, ...e) { + const i = T(e); + i.length > 0 && + (this.style || (this.style = {}), (this.style[t] = i)); + } + setTop(t) { + t && + 0 !== t && + (this.style || (this.style = {}), + (this.style.top = T(t) + 'em'), + (this.height -= t), + (this.depth += t)); + } + setLeft(t) { + t && + 0 !== t && + (this.style || (this.style = {}), + (this.style['margin-left'] = T(t) + 'em')); + } + setRight(t) { + t && + 0 !== t && + (this.style || (this.style = {}), + (this.style['margin-right'] = T(t) + 'em')); + } + setWidth(t) { + t && + 0 !== t && + (this.style || (this.style = {}), + (this.style.width = T(t) + 'em')); + } + addMarginRight(t) { + if (t && 0 !== t) { + if ( + !this.style && + !/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test( + this.classes + ) + ) { + const e = { + 2: 'qquad', + 1: 'quad', + '.5': 'enspace', + 0.277778: 'thickspace', + 0.222222: 'mediumspace', + 0.166667: 'thinspace', + '-0.166667': 'negativethinspace', + }[t.toString()]; + if (e) return void (this.classes += ' rspace ' + e); + } + this.style || (this.style = {}); + const e = parseFloat(this.style['margin-right'] || '0'); + this.style['margin-right'] = T(e + t) + 'em'; + } + } + toMarkup(t, e) { + (t = t || 0), (e = e || 1); + let i = '', + s = this.body || ''; + if (this.children) { + let t = 'none'; + for (const i of this.children) { + let a = 0; + if (t) { + let s = i.type; + s && + ('textord' === s && (s = 'mord'), + 'first' === s && (s = 'none'), + (a = i.isTight + ? E[t + '+' + s] || 0 + : F[t + '+' + s] || 0), + (a = Math.floor(e * a))); + } + (s += i.toMarkup(a, e)), (t = q(i)); + } + } + if ( + ('​' !== s && s) || + (this.classes && 'ML__selected' !== this.classes) + ) { + if ( + ((i = ' 1 + ? e + .filter(function(t, e, i) { + return ( + t.length > 0 && i.indexOf(t) === e + ); + }) + .join(' ') + : e[0]), + a.length > 0 && (i += ' class="' + a + '"'), + t && + (this.style && this.style['margin-left'] + ? (this.style['margin-left'] = + T( + parseFloat( + this.style['margin-left'] + ) + + t / 18 + ) + 'em') + : t < 0 && z[-t] + ? (s = z[-t] + s) + : D[t] + ? (s = D[t] + s) + : (this.style || (this.style = {}), + (this.style['margin-left'] = + T(t / 18) + 'em'))), + this.style) + ) { + let t = ''; + const e = /ML__selected/.test(this.classes); + for (const i in this.style) + Object.prototype.hasOwnProperty.call( + this.style, + i + ) && + (('background-color' === i && e) || + (t += i + ':' + this.style[i] + ';')); + t.length > 0 && (i += ' style="' + t + '"'); + } + (i += '>'), + this.svgOverlay + ? ((i += ''), + (i += s), + (i += ''), + (i += ' 0, + i = t.children && t.children.length > 0; + if (e || i) return !1; + if ( + (this.style ? this.style.length : 0) !== + (t.style ? t.style.length : 0) + ) + return !1; + const s = this.classes + .trim() + .replace(/\s+/g, ' ') + .split(' '), + a = t.classes + .trim() + .replace(/\s+/g, ' ') + .split(' '); + if (s.length !== a.length) return !1; + s.sort(), a.sort(); + for (let t = 0; t < s.length; t++) { + if ('vertical-separator' === s[t]) return !1; + if (s[t] !== a[t]) return !1; + } + if (this.style && t.style) + for (const e in this.style) + if ( + Object.prototype.hasOwnProperty.call( + this.style, + e + ) && + Object.prototype.hasOwnProperty.call(t.style, e) && + this.style[e] !== t.style[e] + ) + return !1; + return ( + (this.body += t.body), + (this.height = Math.max(this.height, t.height)), + (this.depth = Math.max(this.depth, t.depth)), + (this.maxFontSize = Math.max( + this.maxFontSize, + t.maxFontSize + )), + (this.italic = t.italic), + !0 + ); + } + } + const F = { + 'mord+mop': 3, + 'mord+mbin': 4, + 'mord+mrel': 5, + 'mord+minner': 3, + 'mop+mord': 3, + 'mop+mop': 3, + 'mop+mbin': 5, + 'mop+minner': 3, + 'mbin+mord': 4, + 'mbin+mop': 4, + 'mbin+mopen': 4, + 'mbin+minner': 4, + 'mrel+mord': 5, + 'mrel+mop': 5, + 'mrel+mopen': 5, + 'mrel+minner': 5, + 'mclose+mop': 3, + 'mclose+mbin': 4, + 'mclose+mrel': 5, + 'mclose+minner': 3, + 'mpunct+mord': 3, + 'mpunct+mop': 3, + 'mpunct+mbin': 4, + 'mpunct+mrel': 5, + 'mpunct+mopen': 3, + 'mpunct+mpunct': 3, + 'mpunct+minner': 3, + }, + D = ['​', ' ', '  ', ' ', ' ', '  ', ' ', '', '', ' '], + z = ['', ' ⁣', '', ' ⁣', ' ⁣', ' ⁣'], + E = { + 'mord+mop': 3, + 'mop+mord': 3, + 'mop+mop': 3, + 'mclose+mop': 3, + 'minner+mop': 3, + }; + function q(t) { + const e = t.type; + return 'first' === e ? 'none' : 'textord' === e ? 'mord' : e; + } + function P(t) { + return t + ? Array.isArray(t) + ? t.reduce((t, e) => Math.max(t, e.height), 0) + : t.height + : 0; + } + function I(t) { + return t + ? Array.isArray(t) + ? t.reduce((t, e) => Math.max(t, e.depth), 0) + : t.depth + : 0; + } + function B(t, e) { + if (Array.isArray(t)) { + const i = []; + for (const e of t) e && i.push(e); + if (1 === i.length) return B(i[0], e); + } + return new L(t, e); + } + function O(t, e, i) { + const s = B(e, i); + return (s.type = t), s; + } + function R(t, e) { + if (!e || 0 === e.length) { + if (t instanceof L) return t; + if (Array.isArray(t) && 1 === t.length) return t[0]; + } + const i = new L(t, e); + let s = 1; + return ( + (s = + t instanceof L + ? t.maxFontSize + : t.reduce((t, e) => Math.max(t, e.maxFontSize), 0)), + (i.height *= s), + (i.depth *= s), + i + ); + } + const K = { + ams: 'AMS-Regular', + bb: 'AMS-Regular', + cal: 'Caligraphic-Regular', + frak: 'Fraktur-Regular', + scr: 'Script-Regular', + cmr: 'Main-Regular', + cmss: 'SansSerif-Regular', + cmtt: 'Typewriter-Regular', + math: 'Math-Regular', + mainit: 'Main-Italic', + }, + N = { + ams: 'ML__ams', + bb: 'ML__bb', + cal: 'ML__cal', + frak: 'ML__frak', + scr: 'ML__script', + cmr: 'ML__mathrm', + cmss: 'ML__sans', + cmtt: 'ML__tt', + math: 'ML__mathit', + mainit: 'ML__mainit', + }; + var $ = { + coalesce: function t(e) { + if (!e || 0 === e.length) return []; + e[0].children = t(e[0].children); + const i = [e[0]]; + for (let s = 1; s < e.length; s++) + i[i.length - 1].tryCoalesceWith(e[s]) || + ((e[s].children = t(e[s].children)), i.push(e[s])); + return i; + }, + makeSpan: B, + makeOp: function(t, e) { + return O('mop', t, e); + }, + makeOrd: function(t, e) { + return O('mord', t, e); + }, + makeRel: function(t, e) { + return O('mrel', t, e); + }, + makeClose: function(t, e) { + return O('mclose', t, e); + }, + makeOpen: function(t, e) { + return O('mopen', t, e); + }, + makeInner: function(t, e) { + return O('minner', t, e); + }, + makePunct: function(t, e) { + return O('mpunct', t, e); + }, + makeSpanOfType: O, + makeSymbol: function(t, e, i) { + const s = new L(e, i), + a = m.getCharacterMetrics(e, t); + return ( + (s.height = a.height), + (s.depth = a.depth), + (s.skew = a.skew), + (s.italic = a.italic), + s.setRight(s.italic), + s + ); + }, + makeVlist: function(t, e, i, s) { + let a = 0, + o = 0; + (i = i || 'shift'), (s = s || 0); + for (let t = 0; t < e.length; t++) + Array.isArray(e[t]) && + (1 === e[t].length + ? (e[t] = e[t][0]) + : (e[t] = B(e[t]))); + if ('shift' === i) a = -e[0].depth - s; + else if ('bottom' === i) a = -s; + else if ('top' === i) { + let t = s; + for (const i of e) + t -= i instanceof L ? i.height + i.depth : i; + a = t; + } else if ('individualShift' === i) { + const t = e; + (e = [t[0]]), (a = -t[1] - t[0].depth), (o = a); + for (let i = 2; i < t.length; i += 2) { + const s = -t[i + 1] - o - t[i].depth; + o += s; + const a = s - (t[i - 2].height + t[i - 2].depth); + e.push(a), e.push(t[i]); + } + } + let n = 1; + for (const t of e) + t instanceof L && (n = Math.max(n, t.maxFontSize)); + const r = (function(t, e) { + const i = e ? e / t.mathstyle.sizeMultiplier : 0, + s = new L('​'); + return ( + 1 !== i && + (s.setStyle('font-size', i, i > 0 ? 'em' : ''), + (s.attributes = { 'aria-hidden': !0 })), + 'size5' !== t.size + ? new L( + s, + 'fontsize-ensurer reset-' + + t.size + + ' size5' + ) + : 0 !== i + ? s + : null + ); + })(t, n), + l = []; + o = a; + for (const t of e) + if ('number' == typeof t) o += t; + else { + const e = B([r, t]); + e.setTop(-t.depth - o), + l.push(e), + (o += t.height + t.depth); + } + const c = B(l, 'vlist'); + return ( + (c.depth = Math.max(a, I(c) || 0)), + (c.height = Math.max(-o, P(c) || 0)), + c + ); + }, + makeHlist: R, + makeStyleWrap: function(t, e, i, s, a) { + a = a || ''; + const o = R(e, (a += ' style-wrap ') + i.adjustTo(s)); + o.type = t; + const n = s.sizeMultiplier / i.sizeMultiplier; + return ( + (o.height *= n), + (o.depth *= n), + (o.maxFontSize = s.sizeMultiplier), + o + ); + }, + makeSVG: function(t, e, i) { + return (t.svgOverlay = e), (t.svgStyle = i), t; + }, + height: P, + depth: I, + skew: function(t) { + if (!t) return 0; + if (Array.isArray(t)) { + let e = 0; + for (const i of t) e += i.skew || 0; + return e; + } + return t.skew; + }, + italic: function(t) { + return t + ? Array.isArray(t) + ? t[t.length - 1].italic + : t.italic + : 0; + }, + }; + let W = ''; + const H = {}, + V = {}, + U = {}, + j = 'CRYPTIC', + G = 'COMMON', + Z = 'SUPERCOMMON', + X = { + CRYPTIC: 0, + ARCANE: 200, + VERY_RARE: 600, + RARE: 1200, + UNCOMMON: 2e3, + COMMON: 3e3, + SUPERCOMMON: 4e3, + }; + function J(t, ...e) { + const i = 'string' == typeof t ? X[t] : t; + for (const t of e) + H[t] && (H[t].frequency = i), + V[t] && + ((V[t] = Object.assign({}, V[t])), + (V[t].frequency = i)); + } + function Y(t, e, i, s, a) { + e && /^(ams|cmr|bb|cal|frak|scr)$/.test(e), + 'string' == typeof a && (a = X[a]), + (H[t] = { + type: i === rt ? lt : i, + baseFontFamily: e, + value: s, + category: W, + frequency: a, + }); + } + function Q(t, e) { + for (let i = t; i <= e; i++) { + const t = String.fromCodePoint(i); + Y(t, '', 'mord', t); + } + } + const tt = { + 8739: '|', + 183: '\\cdot', + 188: '\\frac{1}{4}', + 189: '\\frac{1}{2}', + 190: '\\frac{3}{4}', + 8304: '^{0}', + 8305: '^{i}', + 185: '^{1}', + 178: '^{2}', + 179: '^{3}', + 8308: '^{4}', + 8309: '^{5}', + 8310: '^{6}', + 8311: '^{7}', + 8312: '^{8}', + 8313: '^{9}', + 8314: '^{+}', + 8315: '^{-}', + 8316: '^{=}', + 8319: '^{n}', + 8320: '_{0}', + 8321: '_{1}', + 8322: '_{2}', + 8323: '_{3}', + 8324: '_{4}', + 8325: '_{5}', + 8326: '_{6}', + 8327: '_{7}', + 8328: '_{8}', + 8329: '_{9}', + 8330: '_{+}', + 8331: '_{-}', + 8332: '_{=}', + 8336: '_{a}', + 8337: '_{e}', + 8338: '_{o}', + 8339: '_{x}', + 8242: '\\prime', + 8243: '\\doubleprime', + 8736: '\\angle', + 8450: '\\C', + 8469: '\\N', + 8473: '\\P', + 8474: '\\Q', + 8477: '\\R', + 8484: '\\Z', + }; + function et(t, e) { + const i = String.fromCodePoint(e); + if ('math' === t && tt[i]) return tt[i]; + if (e > 32 && e < 127) return i; + let s = ''; + if ('math' === t) { + for (const t in H) + if ( + Object.prototype.hasOwnProperty.call(H, t) && + H[t].value === i + ) { + s = t; + break; + } + } else + for (const t in vt) + if ( + Object.prototype.hasOwnProperty.call(vt, t) && + vt[t] === i + ) { + s = t; + break; + } + return s || i; + } + const it = { + 119893: 8462, + 119965: 8492, + 119968: 8496, + 119969: 8497, + 119971: 8459, + 119972: 8464, + 119975: 8466, + 119976: 8499, + 119981: 8475, + 119994: 8495, + 119996: 8458, + 120004: 8500, + 120070: 8493, + 120075: 8460, + 120076: 8465, + 120085: 8476, + 120093: 8488, + 120122: 8450, + 120127: 8461, + 120133: 8469, + 120135: 8473, + 120136: 8474, + 120137: 8477, + 120145: 8484, + }, + st = [ + { start: 119808, len: 26, offset: 65, style: 'bold' }, + { start: 119834, len: 26, offset: 97, style: 'bold' }, + { start: 119860, len: 26, offset: 65, style: 'italic' }, + { start: 119886, len: 26, offset: 97, style: 'italic' }, + { start: 119912, len: 26, offset: 65, style: 'bolditalic' }, + { start: 119938, len: 26, offset: 97, style: 'bolditalic' }, + { start: 119964, len: 26, offset: 65, variant: 'script' }, + { start: 119990, len: 26, offset: 97, variant: 'script' }, + { + start: 120016, + len: 26, + offset: 65, + variant: 'script', + style: 'bold', + }, + { + start: 120042, + len: 26, + offset: 97, + variant: 'script', + style: 'bold', + }, + { start: 120068, len: 26, offset: 65, variant: 'fraktur' }, + { start: 120094, len: 26, offset: 97, variant: 'fraktur' }, + { + start: 120172, + len: 26, + offset: 65, + variant: 'fraktur', + style: 'bold', + }, + { + start: 120198, + len: 26, + offset: 97, + variant: 'fraktur', + style: 'bold', + }, + { + start: 120120, + len: 26, + offset: 65, + variant: 'double-struck', + }, + { + start: 120146, + len: 26, + offset: 97, + variant: 'double-struck', + }, + { start: 120224, len: 26, offset: 65, variant: 'sans-serif' }, + { start: 120250, len: 26, offset: 97, variant: 'sans-serif' }, + { + start: 120276, + len: 26, + offset: 65, + variant: 'sans-serif', + style: 'bold', + }, + { + start: 120302, + len: 26, + offset: 97, + variant: 'sans-serif', + style: 'bold', + }, + { + start: 120328, + len: 26, + offset: 65, + variant: 'sans-serif', + style: 'italic', + }, + { + start: 120354, + len: 26, + offset: 97, + variant: 'sans-serif', + style: 'italic', + }, + { + start: 120380, + len: 26, + offset: 65, + variant: 'sans-serif', + style: 'bolditalic', + }, + { + start: 120406, + len: 26, + offset: 97, + variant: 'sans-serif', + style: 'bolditalic', + }, + { start: 120432, len: 26, offset: 65, variant: 'monospace' }, + { start: 120458, len: 26, offset: 97, variant: 'monospace' }, + { start: 120488, len: 25, offset: 913, style: 'bold' }, + { start: 120514, len: 25, offset: 945, style: 'bold' }, + { start: 120546, len: 25, offset: 913, style: 'italic' }, + { start: 120572, len: 25, offset: 945, style: 'italic' }, + { start: 120604, len: 25, offset: 913, style: 'bolditalic' }, + { start: 120630, len: 25, offset: 945, style: 'bolditalic' }, + { + start: 120662, + len: 25, + offset: 913, + variant: 'sans-serif', + style: 'bold', + }, + { + start: 120688, + len: 25, + offset: 945, + variant: 'sans-serif', + style: 'bold', + }, + { + start: 120720, + len: 25, + offset: 913, + variant: 'sans-serif', + style: 'bolditalic', + }, + { + start: 120746, + len: 25, + offset: 945, + variant: 'sans-serif', + style: 'bolditalic', + }, + { + start: 120782, + len: 10, + offset: 48, + variant: '', + style: 'bold', + }, + { + start: 120792, + len: 10, + offset: 48, + variant: 'double-struck', + }, + { start: 120803, len: 10, offset: 48, variant: 'sans-serif' }, + { + start: 120812, + len: 10, + offset: 48, + variant: 'sans-serif', + style: 'bold', + }, + { start: 120822, len: 10, offset: 48, variant: 'monospace' }, + ]; + function at(t) { + let e = t; + if ( + ('string' == typeof t && (e = t.codePointAt(0)), + (e < 119808 || e > 120831) && (e < 8448 || e > 8527)) + ) + return { char: t }; + for (const t in it) + if ( + Object.prototype.hasOwnProperty.call(it, t) && + it[t] === e + ) { + e = t; + break; + } + for (let t = 0; t < st.length; t++) + if (e >= st[t].start && e < st[t].start + st[t].len) + return { + char: String.fromCodePoint( + e - st[t].start + st[t].offset + ), + variant: st[t].variant, + style: st[t].style, + }; + return { char: t }; + } + function ot(t, e) { + if ('text' === t) return String.fromCodePoint(e); + let i; + if (tt[e]) return tt[e]; + const s = at(e); + return s.style || s.variant + ? ((i = s.char), + s.variant && (i = '\\' + s.variant + '{' + i + '}'), + 'bold' === s.style + ? (i = '\\mathbf{' + i + '}') + : 'italic' === s.style + ? (i = '\\mathit{' + i + '}') + : 'bolditalic' === s.style && + (i = '\\mathbf{\\mathit{' + i + '}}'), + '\\mathord{' + i + '}') + : et(t, e); + } + const nt = 'ams', + rt = 'mord', + lt = 'mord', + ct = 'mbin', + ht = 'mrel', + dt = 'mopen', + pt = 'mclose', + mt = 'spacing'; + function ut(t, e) { + let i = t.match(/=(.+)/), + s = '{}', + a = 'auto', + o = null; + return ( + i && (s = i[1]), + (i = t.match(/:([^=]+)/)), + i && (a = i[1].trim()), + (i = t.match(/^([^:=]+)/)), + i && (o = i[1].trim()), + { optional: e, type: a, defaultValue: s, placeholder: o } + ); + } + function ft(t) { + if (!t || 0 === t.length) return []; + let e = [], + i = t.split(']'); + if ('[' === i[0].charAt(0)) { + e.push(ut(i[0].slice(1), !0)); + for (let t = 1; t <= i.length; t++) e = e.concat(ft(i[t])); + } else if (((i = t.split('}')), '{' === i[0].charAt(0))) { + e.push(ut(i[0].slice(1), !1)); + for (let t = 1; t <= i.length; t++) e = e.concat(ft(i[t])); + } + return e; + } + function gt(t) { + return t.map(t => t.body).join(''); + } + function yt(t, e, i, s) { + 'string' == typeof t && (t = [t]), i || (i = {}); + const a = ft(e), + o = { + category: W, + params: a, + parser: s, + mathstyle: 'displaystyle', + tabular: i.tabular || !0, + colFormat: i.colFormat || [], + }; + for (const e of t) U[e] = o; + } + function bt(t, e, i, s) { + 'string' == typeof t && (t = [t]), i || (i = {}); + const a = { + category: W, + baseFontFamily: i.fontFamily, + params: ft(e), + allowedInText: !!i.allowedInText, + infix: !!i.infix, + parse: s, + }; + for (const e of t) V[e] = a; + } + (W = 'Environments'), + yt('math', '', { frequency: 0 }, function() { + return { mathstyle: 'textstyle' }; + }), + yt('displaymath', '', { frequency: 8 }, function() { + return { mathstyle: 'displaystyle' }; + }), + yt('array', '{columns:colspec}', { frequency: G }, function(t, e) { + return { colFormat: e[0], mathstyle: 'textstyle' }; + }), + yt('eqnarray', '', {}, function() { + return {}; + }), + yt('equation', '', {}, function() { + return { colFormat: [{ align: 'c' }] }; + }), + yt('subequations', '', {}, function() { + return { colFormat: [{ align: 'c' }] }; + }), + yt('multline', '', {}, function() { + return { + firstRowFormat: [{ align: 'l' }], + colFormat: [{ align: 'c' }], + lastRowFormat: [{ align: 'r' }], + }; + }), + yt(['align', 'aligned'], '', {}, function(t, e, i) { + let s = 0; + for (const t of i) s = Math.max(s, t.length); + const a = [ + { gap: 0 }, + { align: 'r' }, + { gap: 0 }, + { align: 'l' }, + ]; + let o = 2; + for (; o < s; ) + a.push({ gap: 1 }), + a.push({ align: 'r' }), + a.push({ gap: 0 }), + a.push({ align: 'l' }), + (o += 2); + return a.push({ gap: 0 }), { colFormat: a, jot: 0.3 }; + }), + yt('split', '', {}, function() { + return {}; + }), + yt(['gather', 'gathered'], '', {}, function() { + return { + colFormat: [{ gap: 0.25 }, { align: 'c' }, { gap: 0 }], + jot: 0.3, + }; + }), + yt( + [ + 'matrix', + 'pmatrix', + 'bmatrix', + 'Bmatrix', + 'vmatrix', + 'Vmatrix', + 'smallmatrix', + 'matrix*', + 'pmatrix*', + 'bmatrix*', + 'Bmatrix*', + 'vmatrix*', + 'Vmatrix*', + 'smallmatrix*', + ], + '[columns:colspec]', + {}, + function(t, e) { + const i = { mathstyle: 'textstyle' }; + switch (t) { + case 'pmatrix': + case 'pmatrix*': + (i.lFence = '('), (i.rFence = ')'); + break; + case 'bmatrix': + case 'bmatrix*': + (i.lFence = '['), (i.rFence = ']'); + break; + case 'Bmatrix': + case 'Bmatrix*': + (i.lFence = '\\lbrace'), (i.rFence = '\\rbrace'); + break; + case 'vmatrix': + case 'vmatrix*': + (i.lFence = '\\vert'), (i.rFence = '\\vert'); + break; + case 'Vmatrix': + case 'Vmatrix*': + (i.lFence = '\\Vert'), (i.rFence = '\\Vert'); + break; + case 'smallmatrix': + case 'smallmatrix*': + i.mathstyle = 'scriptstyle'; + break; + case 'matrix': + case 'matrix*': + (i.lFence = '.'), (i.rFence = '.'); + } + return ( + (i.colFormat = e[0] || [ + { align: 'c' }, + { align: 'c' }, + { align: 'c' }, + { align: 'c' }, + { align: 'c' }, + { align: 'c' }, + { align: 'c' }, + { align: 'c' }, + { align: 'c' }, + { align: 'c' }, + ]), + i + ); + } + ), + yt('cases', '', {}, function() { + return { + arraystretch: 1.2, + lFence: '\\lbrace', + rFence: '.', + colFormat: [{ align: 'l' }, { gap: 1 }, { align: 'l' }], + }; + }), + yt('theorem', '', {}, function() { + return {}; + }), + yt('center', '', {}, function() { + return { colFormat: [{ align: 'c' }] }; + }), + (W = ''), + (function(t) { + for (let t = 0; t < '0123456789/@.'.length; t++) { + const e = '0123456789/@.'.charAt(t); + Y(e, '', lt, e); + } + })(), + Q(65, 90), + Q(97, 122), + (W = 'Trigonometry'), + bt( + [ + '\\arcsin', + '\\arccos', + '\\arctan', + '\\arctg', + '\\arcctg', + '\\arg', + '\\ch', + '\\cos', + '\\cosec', + '\\cosh', + '\\cot', + '\\cotg', + '\\coth', + '\\csc', + '\\ctg', + '\\cth', + '\\sec', + '\\sin', + '\\sinh', + '\\sh', + '\\tan', + '\\tanh', + '\\tg', + '\\th', + ], + '', + null, + function(t) { + return { + type: 'mop', + limits: 'nolimits', + symbol: !1, + isFunction: !0, + body: t.slice(1), + baseFontFamily: 'cmr', + }; + } + ), + J(Z, '\\cos', '\\sin', '\\tan'), + J( + 'UNCOMMON', + '\\arcsin', + '\\arccos', + '\\arctan', + '\\arctg', + '\\arcctg', + '\\arcsec', + '\\arccsc' + ), + J( + 'UNCOMMON', + '\\arsinh', + '\\arccosh', + '\\arctanh', + '\\arcsech', + '\\arccsch' + ), + J( + 'UNCOMMON', + '\\arg', + '\\ch', + '\\cosec', + '\\cosh', + '\\cot', + '\\cotg', + '\\coth', + '\\csc', + '\\ctg', + '\\cth', + '\\lg', + '\\lb', + '\\sec', + '\\sinh', + '\\sh', + '\\tanh', + '\\tg', + '\\th' + ), + (W = 'Functions'), + bt( + [ + '\\deg', + '\\dim', + '\\exp', + '\\hom', + '\\ker', + '\\lb', + '\\lg', + '\\ln', + '\\log', + ], + '', + null, + function(t) { + return { + type: 'mop', + limits: 'nolimits', + symbol: !1, + isFunction: !0, + body: t.slice(1), + baseFontFamily: 'cmr', + }; + } + ), + J(Z, '\\ln', '\\log', '\\exp'), + J(292, '\\hom'), + J(G, '\\dim'), + J(G, '\\ker', '\\deg'), + bt(['\\lim', '\\mod'], '', null, function(t) { + return { + type: 'mop', + limits: 'limits', + symbol: !1, + body: t.slice(1), + baseFontFamily: 'cmr', + }; + }), + bt(['\\det', '\\max', '\\min'], '', null, function(t) { + return { + type: 'mop', + limits: 'limits', + symbol: !1, + isFunction: !0, + body: t.slice(1), + baseFontFamily: 'cmr', + }; + }), + J(Z, '\\lim'), + J(G, '\\det'), + J(G, '\\mod'), + J(G, '\\min'), + J(G, '\\max'), + (W = 'Decoration'), + bt( + '\\rule', + '[raise:dimen]{width:dimen}{thickness:dimen}', + null, + function(t, e) { + return { + type: 'rule', + shift: e[0], + width: e[1], + height: e[2], + }; + } + ), + bt('\\color', '{:color}', { allowedInText: !0 }, (t, e) => ({ + color: e[0], + })), + bt( + '\\textcolor', + '{:color}{content:auto*}', + { allowedInText: !0 }, + (t, e) => ({ color: e[0] }) + ), + J(3, '\\textcolor'), + bt('\\overline', '{:auto}', null, function(t, e) { + return { + type: 'line', + position: 'overline', + skipBoundary: !0, + body: e[0], + }; + }), + J(G, '\\overline'), + bt('\\underline', '{:auto}', null, function(t, e) { + return { + type: 'line', + position: 'underline', + skipBoundary: !0, + body: e[0], + }; + }), + J(G, '\\underline'), + bt('\\overset', '{annotation:auto}{symbol:auto}', null, function( + t, + e + ) { + return { + type: 'overunder', + overscript: e[0], + skipBoundary: !0, + body: e[1], + }; + }), + J(G, '\\overset'), + bt('\\underset', '{annotation:auto}{symbol:auto}', null, function( + t, + e + ) { + return { + type: 'overunder', + underscript: e[0], + skipBoundary: !0, + body: e[1], + }; + }), + J(G, '\\underset'), + bt( + ['\\stackrel', '\\stackbin'], + '{annotation:auto}{symbol:auto}', + null, + function(t, e) { + return { + type: 'overunder', + overscript: e[0], + skipBoundary: !0, + body: e[1], + mathtype: '\\stackrel' === t ? 'mrel' : 'mbin', + }; + } + ), + J(G, '\\stackrel'), + J(0, '\\stackbin'), + bt('\\rlap', '{:auto}', null, function(t, e) { + return { + type: 'overlap', + align: 'right', + skipBoundary: !0, + body: e[0], + }; + }), + J(270, '\\rlap'), + bt('\\llap', '{:auto}', null, function(t, e) { + return { + type: 'overlap', + align: 'left', + skipBoundary: !0, + body: e[0], + }; + }), + J(18, '\\llap'), + bt('\\mathrlap', '{:auto}', null, function(t, e) { + return { + type: 'overlap', + mode: 'math', + align: 'right', + skipBoundary: !0, + body: e[0], + }; + }), + J(j, '\\mathrlap'), + bt('\\mathllap', '{:auto}', null, function(t, e) { + return { + type: 'overlap', + mode: 'math', + align: 'left', + skipBoundary: !0, + body: e[0], + }; + }), + J(j, '\\mathllap'), + bt('\\boxed', '{content:math}', null, function(t, e) { + return { + type: 'box', + framecolor: 'black', + skipBoundary: !0, + body: e[0], + }; + }), + J(1236, '\\boxed'), + bt( + '\\colorbox', + '{background-color:color}{content:auto}', + { allowedInText: !0 }, + function(t, e) { + return { + type: 'box', + backgroundcolor: e[0], + skipBoundary: !0, + body: e[1], + }; + } + ), + J(j, '\\colorbox'), + bt( + '\\fcolorbox', + '{frame-color:color}{background-color:color}{content:auto}', + { allowedInText: !0 }, + function(t, e) { + return { + type: 'box', + framecolor: e[0], + backgroundcolor: e[1], + skipBoundary: !0, + body: e[2], + }; + } + ), + J(j, '\\fcolorbox'), + bt('\\bbox', '[:bbox]{body:auto}', { allowedInText: !0 }, function( + t, + e + ) { + return e[0] + ? { + type: 'box', + padding: e[0].padding, + border: e[0].border, + backgroundcolor: e[0].backgroundcolor, + skipBoundary: !0, + body: e[1], + } + : { type: 'box', skipBoundary: !0, body: e[1] }; + }), + J(j, '\\bbox'), + bt( + '\\enclose', + '{notation:string}[style:string]{body:auto}', + null, + function(t, e) { + let i = e[0] || []; + const s = { + type: 'enclose', + strokeColor: 'currentColor', + strokeWidth: 1, + strokeStyle: 'solid', + backgroundcolor: 'transparent', + padding: 'auto', + shadow: 'auto', + captureSelection: !0, + body: e[2], + }; + if (e[1]) { + const t = e[1].split( + /,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/ + ); + for (const e of t) { + const t = e.match(/\s*(\S+)\s+(\S+)\s+(.*)/); + if (t) + (s.strokeWidth = m.toPx(t[1], 'px')), + isFinite(s.strokeWidth) || + (s.strokeWidth = 1), + (s.strokeStyle = t[2]), + (s.strokeColor = t[3]); + else { + const t = e.match(/\s*([a-z]*)\s*=\s*"(.*)"/); + t && + ('mathbackground' === t[1] + ? (s.backgroundcolor = t[2]) + : 'mathcolor' === t[1] + ? (s.strokeColor = t[2]) + : 'padding' === t[1] + ? (s.padding = m.toPx(t[2], 'px')) + : 'shadow' === t[1] && + (s.shadow = t[2])); + } + } + 'dashed' === s.strokeStyle + ? (s.svgStrokeStyle = '5,5') + : 'dotted' === s.strokeStyle && + (s.svgStrokeStyle = '1,5'); + } + (s.borderStyle = + s.strokeWidth + + 'px ' + + s.strokeStyle + + ' ' + + s.strokeColor), + (i = i + .toString() + .split(/[, ]/) + .filter(t => t.length > 0) + .map(t => t.toLowerCase())), + (s.notation = {}); + for (const t of i) s.notation[t] = !0; + return ( + s.notation.updiagonalarrow && + (s.notation.updiagonalstrike = !1), + s.notation.box && + ((s.notation.left = !1), + (s.notation.right = !1), + (s.notation.bottom = !1), + (s.notation.top = !1)), + s + ); + } + ), + J(j, '\\enclose'), + bt('\\cancel', '{body:auto}', null, function(t, e) { + return { + type: 'enclose', + strokeColor: 'currentColor', + strokeWidth: 1, + strokeStyle: 'solid', + borderStyle: '1px solid currentColor', + backgroundcolor: 'transparent', + padding: 'auto', + shadow: 'auto', + notation: { updiagonalstrike: !0 }, + body: e[0], + }; + }), + bt('\\bcancel', '{body:auto}', null, function(t, e) { + return { + type: 'enclose', + strokeColor: 'currentColor', + strokeWidth: 1, + strokeStyle: 'solid', + borderStyle: '1px solid currentColor', + backgroundcolor: 'transparent', + padding: 'auto', + shadow: 'auto', + notation: { downdiagonalstrike: !0 }, + body: e[0], + }; + }), + bt('\\xcancel', '{body:auto}', null, function(t, e) { + return { + type: 'enclose', + strokeColor: 'currentColor', + strokeWidth: 1, + strokeStyle: 'solid', + borderStyle: '1px solid currentColor', + backgroundcolor: 'transparent', + padding: 'auto', + shadow: 'auto', + notation: { updiagonalstrike: !0, downdiagonalstrike: !0 }, + body: e[0], + }; + }), + J(j, '\\cancel', '\\bcancel', '\\xcancel'), + (W = 'Styling'), + bt( + [ + '\\tiny', + '\\scriptsize', + '\\footnotesize', + '\\small', + '\\normalsize', + '\\large', + '\\Large', + '\\LARGE', + '\\huge', + '\\Huge', + ], + '', + { allowedInText: !0 }, + function(t, e) { + return { + fontSize: { + tiny: 'size1', + scriptsize: 'size2', + footnotesize: 'size3', + small: 'size4', + normalsize: 'size5', + large: 'size6', + Large: 'size7', + LARGE: 'size8', + huge: 'size9', + Huge: 'size10', + }[t.slice(1)], + }; + } + ), + bt('\\fontseries', '{:text}', { allowedInText: !0 }, (t, e) => ({ + fontSeries: gt(e[0]), + })), + bt('\\bf', '', { allowedInText: !0 }, (t, e) => ({ + fontSeries: 'b', + })), + bt('\\bm', '{:math*}', { allowedInText: !0 }, (t, e) => ({ + fontSeries: 'b', + })), + bt('\\bold', '', { allowedInText: !0 }, (t, e) => ({ + mode: 'math', + fontSeries: 'b', + })), + bt( + ['\\mathbf', '\\boldsymbol'], + '{:math*}', + { allowedInText: !0 }, + (t, e) => ({ mode: 'math', fontSeries: 'b', fontShape: 'n' }) + ), + bt('\\bfseries', '', { allowedInText: !0 }, (t, e) => ({ + fontSeries: 'b', + })), + bt('\\textbf', '{:text*}', { allowedInText: !0 }, (t, e) => ({ + fontSeries: 'b', + })), + bt('\\mathmd', '{:math*}', { allowedInText: !0 }, (t, e) => ({ + mode: 'math', + fontSeries: 'm', + fontShape: 'n', + })), + bt('\\mdseries', '', { allowedInText: !0 }, (t, e) => ({ + fontSeries: 'm', + })), + bt('\\textmd', '{:math*}', { allowedInText: !0 }, (t, e) => ({ + fontSeries: 'm', + })), + bt('\\fontshape', '{:text}', { allowedInText: !0 }, (t, e) => ({ + fontShape: gt(e[0]), + })), + bt('\\it', '', { allowedInText: !0 }, (t, e) => ({ + fontShape: 'it', + })), + bt('\\mathit', '{:math*}', { allowedInText: !0 }, (t, e) => ({ + mode: 'math', + fontSeries: 'm', + fontShape: 'it', + })), + bt('\\upshape', '', { allowedInText: !0 }, (t, e) => ({ + fontShape: 'n', + })), + bt('\\textup', '{:text*}', { allowedInText: !0 }, (t, e) => ({ + fontShape: 'n', + })), + bt('\\textit', '{:text*}', { allowedInText: !0 }, (t, e) => ({ + fontShape: 'it', + })), + bt('\\slshape', '', { allowedInText: !0 }, (t, e) => ({ + fontShape: 'sl', + })), + bt('\\textsl', '{:text*}', { allowedInText: !0 }, (t, e) => ({ + fontShape: 'sl', + })), + bt('\\scshape', '', { allowedInText: !0 }, (t, e) => ({ + mode: 'text', + fontShape: 'sc', + })), + bt('\\textsc', '{:text*}', { allowedInText: !0 }, (t, e) => ({ + fontShape: 'sc', + })), + bt('\\fontfamily', '{:text}', { allowedInText: !0 }, (t, e) => ({ + fontFamily: gt(e[0]), + })), + bt('\\mathrm', '{:math*}', { allowedInText: !0 }, (t, e) => ({ + mode: 'math', + fontFamily: 'cmr', + fontSeries: 'm', + fontShape: 'n', + })), + bt('\\rmfamily', '', { allowedInText: !0 }, (t, e) => ({ + fontFamily: 'cmr', + })), + bt('\\textrm', '{:text*}', { allowedInText: !0 }, (t, e) => ({ + fontFamily: 'cmr', + })), + bt('\\mathsf', '{:math*}', { allowedInText: !0 }, (t, e) => ({ + mode: 'math', + baseFontFamily: 'cmss', + fontSeries: 'm', + fontShape: 'n', + })), + bt('\\sffamily', '', { allowedInText: !0 }, (t, e) => ({ + fontFamily: 'cmss', + })), + bt('\\textsf', '{:text*}', { allowedInText: !0 }, (t, e) => ({ + fontFamily: 'cmss', + })), + bt('\\mathtt', '{:math*}', { allowedInText: !0 }, (t, e) => ({ + mode: 'math', + baseFontFamily: 'cmtt', + fontSeries: 'm', + fontShape: 'n', + })), + bt('\\ttfamily', '', { allowedInText: !0 }, (t, e) => ({ + fontFamily: 'cmtt', + })), + bt('\\texttt', '{:text*}', { allowedInText: !0 }, (t, e) => ({ + fontFamily: 'cmtt', + })), + bt( + ['\\Bbb', '\\mathbb'], + '{:math*}', + { allowedInText: !0 }, + (t, e) => ({ mode: 'math', baseFontFamily: 'bb' }) + ), + bt( + ['\\frak', '\\mathfrak'], + '{:math*}', + { allowedInText: !0 }, + (t, e) => ({ baseFontFamily: 'frak' }) + ), + bt('\\mathcal', '{:math*}', { allowedInText: !0 }, (t, e) => ({ + mode: 'math', + baseFontFamily: 'cal', + fontSeries: 'm', + fontShape: 'n', + })), + bt('\\mathscr', '{:math*}', { allowedInText: !0 }, (t, e) => ({ + mode: 'math', + baseFontFamily: 'scr', + fontSeries: 'm', + fontShape: 'n', + })), + J(Z, '\\mathbb'), + J(1081, '\\Bbb'), + J(0, '\\mathcal'), + J(G, '\\mathfrak'), + J(271, '\\frak'), + J(G, '\\mathscr'), + J('UNCOMMON', '\\mathsf'), + J(G, '\\mathtt'), + J(G, '\\boldsymbol'), + bt('\\textnormal', '{:text*}', { allowedInText: !0 }, (t, e) => ({ + fontFamily: 'cmr', + fontShape: 'n', + fontSeries: 'n', + })), + bt('\\mbox', '{:text*}', null, (t, e) => ({ fontFamily: 'cmr' })), + bt('\\text', '{:text*}', { allowedInText: !0 }, (t, e) => ({})), + bt( + '\\class', + '{name:text}{content:auto*}', + { allowedInText: !0 }, + (t, e) => ({ cssClass: gt(e[0]) }) + ), + bt( + '\\cssId', + '{id:text}{content:auto}', + { allowedInText: !0 }, + (t, e) => ({ cssId: gt(e[0]), body: e[1], type: 'group' }) + ), + bt('\\em', '', { allowedInText: !0 }, (t, e) => ({ + cssClass: 'ML__emph', + type: 'group', + })), + bt('\\emph', '{:auto}', { allowedInText: !0 }, (t, e) => ({ + cssClass: 'ML__emph', + body: e[0], + type: 'group', + skipBoundary: !0, + })), + J(G, '\\textrm'), + J(G, '\\textit'), + J(G, '\\textsf'), + J(G, '\\texttt'), + J(433, '\\textnormal'), + J(G, '\\textbf'), + J(421, '\\textup'), + J(819, '\\emph'), + J(49, '\\em'), + (W = 'Operators'), + bt('\\sqrt', '[index:auto]{radicand:auto}', null, function(t, e) { + return { type: 'surd', body: e[1], index: e[0] }; + }), + J(Z, '\\sqrt'), + (W = 'Fractions'), + bt( + [ + '\\frac', + '\\dfrac', + '\\tfrac', + '\\cfrac', + '\\binom', + '\\dbinom', + '\\tbinom', + ], + '{numerator}{denominator}', + null, + function(t, e) { + const i = { + type: 'genfrac', + numer: e[0], + denom: e[1], + mathstyle: 'auto', + }; + switch (t) { + case '\\dfrac': + case '\\frac': + case '\\tfrac': + case '\\cfrac': + i.hasBarLine = !0; + break; + case '\\\\atopfrac': + i.hasBarLine = !1; + break; + case '\\dbinom': + case '\\binom': + case '\\tbinom': + (i.hasBarLine = !1), + (i.leftDelim = '('), + (i.rightDelim = ')'); + } + switch (t) { + case '\\dfrac': + case '\\dbinom': + i.mathstyle = 'displaystyle'; + break; + case '\\tfrac': + case '\\tbinom': + i.mathstyle = 'textstyle'; + } + return '\\cfrac' === t && (i.continuousFraction = !0), i; + } + ), + bt(['\\over', '\\atop', '\\choose'], '', { infix: !0 }, function( + t, + e + ) { + const i = e[0], + s = e[1]; + let a = !1, + o = null, + n = null; + switch (t) { + case '\\atop': + break; + case '\\over': + a = !0; + break; + case '\\choose': + (a = !1), (o = '('), (n = ')'); + break; + default: + throw new Error('Unrecognized genfrac command'); + } + return { + type: 'genfrac', + numer: i, + denom: s, + hasBarLine: a, + leftDelim: o, + rightDelim: n, + mathstyle: 'auto', + }; + }), + J(21, '\\over'), + J(12, '\\atop'), + J(1968, '\\choose'), + bt( + ['\\overwithdelims', '\\atopwithdelims'], + '{left-delim:delim}{right-delim:delim}', + { infix: !0 }, + function(t, e) { + return { + type: 'genfrac', + numer: e[0], + denom: e[1], + hasBarLine: !1, + leftDelim: e[2], + rightDelim: e[3], + mathstyle: 'auto', + }; + } + ), + J(15, '\\overwithdelims'), + J(G, '\\atopwithdelims'), + (W = 'Fractions'), + bt('\\pdiff', '{numerator}{denominator}', null, function(t, e) { + return { + type: 'genfrac', + numer: e[0], + denom: e[1], + numerPrefix: '∂', + denomPrefix: '∂', + hasBarLine: !0, + leftDelim: null, + rightDelim: null, + mathstyle: 'auto', + }; + }), + (W = 'Quantifiers'), + Y('\\forall', '', lt, '∀', Z), + Y('\\exists', '', lt, '∃', Z), + Y('\\nexists', nt, lt, '∄', Z), + Y('\\mid', '', ht, '∣', G), + Y('\\top', '', lt, '⊤', 'RARE'), + Y('\\bot', '', lt, '⊥', 'RARE'), + (W = 'Variable Sized Symbols'), + bt( + [ + '\\sum', + '\\prod', + '\\bigcup', + '\\bigcap', + '\\coprod', + '\\bigvee', + '\\bigwedge', + '\\biguplus', + '\\bigotimes', + '\\bigoplus', + '\\bigodot', + '\\bigsqcup', + '\\smallint', + '\\intop', + ], + '', + null, + function(t) { + return { + type: 'mop', + limits: 'auto', + symbol: !0, + baseFontFamily: 'cmr', + body: { + coprod: '∐', + bigvee: '⋁', + bigwedge: '⋀', + biguplus: '⨄', + bigcap: '⋂', + bigcup: '⋃', + intop: '∫', + prod: '∏', + sum: '∑', + bigotimes: '⨂', + bigoplus: '⨁', + bigodot: '⨀', + bigsqcup: '⨆', + smallint: '∫', + }[t.slice(1)], + }; + } + ), + bt( + [ + '\\int', + '\\iint', + '\\iiint', + '\\oint', + '\\oiint', + '\\oiiint', + '\\intclockwise', + '\\varointclockwise', + '\\ointctrclockwise', + '\\intctrclockwise', + ], + '', + null, + function(t) { + return { + type: 'mop', + limits: 'nolimits', + symbol: !0, + body: { + int: '∫', + iint: '∬', + iiint: '∭', + oint: '∮', + oiint: '∯', + oiiint: '∰', + intclockwise: '∱', + varointclockwise: '∲', + ointctrclockwise: '∳', + intctrclockwise: '⨑', + }[t.slice(1)], + }; + } + ), + J(Z, '\\sum', '\\prod', '\\bigcap', '\\bigcup', '\\int'), + J(G, '\\bigoplus', '\\smallint', '\\iint', '\\oint'), + J('RARE', '\\bigwedge', '\\bigvee'), + J(756, '\\coprod'), + J(723, '\\bigsqcup'), + J(1241, '\\bigotimes'), + J(150, '\\bigodot'), + J(174, '\\biguplus'), + J(878, '\\iiint'), + J(97, '\\intop'), + (W = 'Various'), + Y('\\sharp', '', lt, '♯', G), + Y('\\flat', '', lt, '♭', 590), + Y('\\natural', '', lt, '♮', 278), + Y('\\#', '', lt, '#', 'RARE'), + Y('\\&', '', lt, '&', 'RARE'), + Y('\\clubsuit', '', lt, '♣', 172), + Y('\\heartsuit', '', lt, '♡', 'ARCANE'), + Y('\\spadesuit', '', lt, '♠', 'ARCANE'), + Y('\\diamondsuit', '', lt, '♢', j), + Y('\\differencedelta', '', ht, '∆', G), + (W = 'Letters and Letter Like Forms'), + bt('\\unicode', '{charcode:number}', null, function(t, e) { + let i = parseInt(e[0]); + return ( + isFinite(i) || (i = 10067), + { type: 'mord', body: String.fromCodePoint(i) } + ); + }), + Y('\\backslash', '', lt, '\\'), + Y('?', '', lt, '?'), + Y('!', '', lt, '!'), + Y('\\nabla', '', lt, '∇', Z), + Y('\\partial', '', lt, '∂', Z), + Y('\\ell', '', lt, 'ℓ', G), + Y('\\imaginaryI', '', lt, 'i'), + Y('\\imaginaryJ', '', lt, 'j'), + bt(['\\Re', '\\Im'], '', null, function(t) { + return { + type: 'mop', + limits: 'nolimits', + symbol: !1, + isFunction: !0, + body: { '\\Re': 'ℜ', '\\Im': 'ℑ' }[t], + baseFontFamily: 'frak', + }; + }), + Y('\\hbar', '', lt, 'ℏ', G), + Y('\\hslash', nt, lt, 'ℏ', G), + Y('\\differentialD', 'cmr', lt, 'd'), + Y('\\rd', 'cmr', lt, 'd'), + Y('\\capitalDifferentialD', 'cmr', lt, 'D'), + Y('\\rD', 'cmr', lt, 'D'), + Y('\\exponentialE', 'cmr', lt, 'e'), + Y('\\Finv', nt, lt, 'Ⅎ', 3), + Y('\\Game', nt, lt, '⅁', 1), + Y('\\wp', '', lt, '℘', 1306), + Y('\\eth', nt, lt, 'ð', 77), + Y('\\mho', nt, lt, '℧', 138), + Y('\\Bbbk', nt, lt, 'k'), + Y('\\doubleStruckCapitalN', 'bb', lt, 'N'), + Y('\\N', 'bb', lt, 'N'), + Y('\\doubleStruckCapitalR', 'bb', lt, 'R'), + Y('\\R', 'bb', lt, 'R'), + Y('\\doubleStruckCapitalQ', 'bb', lt, 'Q'), + Y('\\Q', 'bb', lt, 'Q'), + Y('\\doubleStruckCapitalC', 'bb', lt, 'C'), + Y('\\C', 'bb', lt, 'C'), + Y('\\doubleStruckCapitalZ', 'bb', lt, 'Z'), + Y('\\Z', 'bb', lt, 'Z'), + Y('\\doubleStruckCapitalP', 'bb', lt, 'P'), + Y('\\P', 'bb', lt, 'P'), + Y('\\scriptCapitalE', 'scr', lt, 'E'), + Y('\\scriptCapitalH', 'scr', lt, 'H'), + Y('\\scriptCapitalL', 'scr', lt, 'L'), + Y('\\gothicCapitalC', 'frak', lt, 'C'), + Y('\\gothicCapitalH', 'frak', lt, 'H'), + Y('\\gothicCapitalI', 'frak', lt, 'I'), + Y('\\gothicCapitalR', 'frak', lt, 'R'), + Y('\\pounds', '', lt, '£', 509), + Y('\\yen', nt, lt, '¥', 57), + Y('\\euro', '', lt, '€', 4), + (W = 'Crosses'), + Y('\\textdagger', '', ct, '†'), + Y('\\dagger', '', ct, '†', G), + Y('\\dag', '', ct, '†', G), + Y('\\ddag', '', ct, '‡', 500), + Y('\\textdaggerdbl', '', ct, '‡'), + Y('\\ddagger', '', ct, '‡', 353), + Y('\\maltese', nt, lt, '✠', 24), + (W = 'Arrows'), + Y('\\longrightarrow', '', ht, '⟶', Z), + Y('\\rightarrow', '', ht, '→', Z), + Y('\\Longrightarrow', '', ht, '⟹', Z), + Y('\\Rightarrow', '', ht, '⇒', Z), + Y('\\longmapsto', '', ht, '⟼', G), + Y('\\mapsto', '', ht, '↦', G), + Y('\\Longleftrightarrow', '', ht, '⟺', G), + Y('\\rightleftarrows', nt, ht, '⇄', G), + Y('\\leftarrow', '', ht, '←', G), + Y('\\curvearrowleft', nt, ht, '↶', G), + Y('\\uparrow', '', ht, '↑', G), + Y('\\downarrow', '', ht, '↓', G), + Y('\\hookrightarrow', '', ht, '↪', G), + Y('\\rightharpoonup', '', ht, '⇀', G), + Y('\\rightleftharpoons', '', ht, '⇌', G), + Y('\\Leftarrow', '', ht, '⇐', 1695), + Y('\\longleftrightarrow', '', ht, '⟷', 1599), + Y('\\longleftarrow', '', ht, '⟵', 878), + Y('\\Longleftarrow', '', ht, '⟸', 296), + Y('\\searrow', '', ht, '↘', 1609), + Y('\\nearrow', '', ht, '↗', 1301), + Y('\\swarrow', '', ht, '↙', 167), + Y('\\nwarrow', '', ht, '↖', 108), + Y('\\Uparrow', '', ht, '⇑', 257), + Y('\\Downarrow', '', ht, '⇓', 556), + Y('\\updownarrow', '', ht, '↕', 192), + Y('\\Updownarrow', '', ht, '⇕', 161), + Y('\\hookleftarrow', '', ht, '↩', 115), + Y('\\leftharpoonup', '', ht, '↼', 93), + Y('\\leftharpoondown', '', ht, '↽', 42), + Y('\\rightharpoondown', '', ht, '⇁', 80), + Y('\\leftrightarrows', nt, ht, '⇆', 765), + Y('\\dashrightarrow', nt, ht, '⇢', 311), + Y('\\dashleftarrow', nt, ht, '⇠', 5), + Y('\\leftleftarrows', nt, ht, '⇇', 8), + Y('\\Lleftarrow', nt, ht, '⇚', 7), + Y('\\twoheadleftarrow', nt, ht, '↞', 32), + Y('\\leftarrowtail', nt, ht, '↢', 25), + Y('\\looparrowleft', nt, ht, '↫', 6), + Y('\\leftrightharpoons', nt, ht, '⇋', 205), + Y('\\circlearrowleft', nt, ht, '↺', 105), + Y('\\Lsh', nt, ht, '↰', 11), + Y('\\upuparrows', nt, ht, '⇈', 15), + Y('\\downharpoonleft', nt, ht, '⇃', 21), + Y('\\multimap', nt, ht, '⊸', 108), + Y('\\leftrightsquigarrow', nt, ht, '↭', 31), + Y('\\twoheadrightarrow', nt, ht, '↠', 835), + Y('\\rightarrowtail', nt, ht, '↣', 195), + Y('\\looparrowright', nt, ht, '↬', 37), + Y('\\curvearrowright', nt, ht, '↷', 209), + Y('\\circlearrowright', nt, ht, '↻', 63), + Y('\\Rsh', nt, ht, '↱', 18), + Y('\\downdownarrows', nt, ht, '⇊', 6), + Y('\\upharpoonright', nt, ht, '↾', 579), + Y('\\downharpoonright', nt, ht, '⇂', 39), + Y('\\rightsquigarrow', nt, ht, '⇝', 674), + Y('\\leadsto', nt, ht, '⇝', 709), + Y('\\Rrightarrow', nt, ht, '⇛', 62), + Y('\\restriction', nt, ht, '↾', 29), + Y('\\upharpoonleft', nt, ht, '↿', j), + Y('\\rightrightarrows', nt, ht, '⇉', j), + (W = 'Negated Arrows'), + Y('\\nrightarrow', nt, ht, '↛', 324), + Y('\\nRightarrow', nt, ht, '⇏', 107), + Y('\\nleftrightarrow', nt, ht, '↮', 36), + Y('\\nLeftrightarrow', nt, ht, '⇎', 20), + Y('\\nleftarrow', nt, ht, '↚', 7), + Y('\\nLeftarrow', nt, ht, '⇍', 5), + (W = 'Negated Relations'), + Y('\\nless', nt, ht, '≮', 146), + Y('\\nleqslant', nt, ht, '', 58), + Y('\\lneq', nt, ht, '⪇', 54), + Y('\\lneqq', nt, ht, '≨', 36), + Y('\\nleqq', nt, ht, '', 18), + Y('\\unlhd', nt, ct, '⊴', 253), + Y('\\unrhd', nt, ct, '⊵', 66), + Y('\\lvertneqq', nt, ht, '', 6), + Y('\\lnsim', nt, ht, '⋦', 4), + Y('\\lnapprox', nt, ht, '⪉', j), + Y('\\nprec', nt, ht, '⊀', 71), + Y('\\npreceq', nt, ht, '⋠', 57), + Y('\\precnsim', nt, ht, '⋨', 4), + Y('\\precnapprox', nt, ht, '⪹', 2), + Y('\\nsim', nt, ht, '≁', 40), + Y('\\nshortmid', nt, ht, '', 1), + Y('\\nmid', nt, ht, '∤', 417), + Y('\\nvdash', nt, ht, '⊬', 266), + Y('\\nvDash', nt, ht, '⊭', 405), + Y('\\ngtr', nt, ht, '≯', 90), + Y('\\ngeqslant', nt, ht, '', 23), + Y('\\ngeqq', nt, ht, '', 12), + Y('\\gneq', nt, ht, '⪈', 29), + Y('\\gneqq', nt, ht, '≩', 35), + Y('\\gvertneqq', nt, ht, '', 6), + Y('\\gnsim', nt, ht, '⋧', 3), + Y('\\gnapprox', nt, ht, '⪊', j), + Y('\\nsucc', nt, ht, '⊁', 44), + Y('\\nsucceq', nt, ht, '⋡', j), + Y('\\succnsim', nt, ht, '⋩', 4), + Y('\\succnapprox', nt, ht, '⪺', j), + Y('\\ncong', nt, ht, '≆', 128), + Y('\\nshortparallel', nt, ht, '', 6), + Y('\\nparallel', nt, ht, '∦', 54), + Y('\\nVDash', nt, ht, '⊯', 5), + Y('\\nsupseteqq', nt, ht, '', 1), + Y('\\supsetneq', nt, ht, '⊋', 286), + Y('\\varsupsetneq', nt, ht, '', 2), + Y('\\supsetneqq', nt, ht, '⫌', 49), + Y('\\varsupsetneqq', nt, ht, '', 3), + Y('\\nVdash', nt, ht, '⊮', 179), + Y('\\precneqq', nt, ht, '⪵', 11), + Y('\\succneqq', nt, ht, '⪶', 3), + Y('\\nsubseteqq', nt, ht, '', 16), + (W = 'Various'), + Y('\\checkmark', nt, lt, '✓', 1025), + Y('\\diagup', nt, lt, '╱', 440), + Y('\\diagdown', nt, lt, '╲', 175), + Y('\\measuredangle', nt, lt, '∡', 271), + Y('\\sphericalangle', nt, lt, '∢', 156), + Y('\\backprime', nt, lt, '‵', 104), + Y('\\backdoubleprime', nt, lt, '‶', j), + (W = 'Shapes'), + Y('\\ast', '', ct, '∗', Z), + Y('\\star', '', ct, '⋆', G), + Y('\\diamond', '', ct, '⋄', 1356), + Y('\\Diamond', nt, lt, '◊', 695), + Y('\\lozenge', nt, lt, '◊', 422), + Y('\\blacklozenge', nt, lt, '⧫', 344), + Y('\\bigstar', nt, lt, '★', 168), + (W = 'Hebrew'), + Y('\\aleph', '', lt, 'ℵ', 1381), + Y('\\beth', nt, lt, 'ℶ', 54), + Y('\\daleth', nt, lt, 'ℸ', 43), + Y('\\gimel', nt, lt, 'ℷ', 36), + (W = 'Fences'), + Y('\\lbrace', '', dt, '{', Z), + Y('\\rbrace', '', pt, '}', Z), + Y('\\langle', '', dt, '⟨', G), + Y('\\rangle', '', pt, '⟩', G), + Y('\\lfloor', '', dt, '⌊', G), + Y('\\rfloor', '', pt, '⌋', G), + Y('\\lceil', '', dt, '⌈', G), + Y('\\rceil', '', pt, '⌉', G), + Y('\\vert', '', lt, '∣', Z), + Y('\\mvert', '', ht, '∣'), + Y('\\lvert', '', dt, '∣', 496), + Y('\\rvert', '', pt, '∣', 496), + Y('\\|', '', lt, '∥'), + Y('\\Vert', '', lt, '∥', Z), + Y('\\mVert', '', lt, '∥'), + Y('\\lVert', '', dt, '∥', 287), + Y('\\rVert', '', pt, '∥', j), + Y('\\lbrack', '', dt, '[', 574), + Y('\\rbrack', '', pt, ']', 213), + Y('\\{', '', dt, '{'), + Y('\\}', '', pt, '}'), + Y('(', '', dt, '('), + Y(')', '', pt, ')'), + Y('[', '', dt, '['), + Y(']', '', pt, ']'), + Y('\\ulcorner', nt, dt, '┌', 296), + Y('\\urcorner', nt, pt, '┐', 310), + Y('\\llcorner', nt, dt, '└', 137), + Y('\\lrcorner', nt, pt, '┘', 199), + Y('\\lgroup', '', dt, '⟮', 24), + Y('\\rgroup', '', pt, '⟯', 24), + Y('\\lmoustache', '', dt, '⎰', j), + Y('\\rmoustache', '', pt, '⎱', j), + bt(['\\middle'], '{:delim}', null, function(t, e) { + return { type: 'delim', delim: e[0] }; + }), + (W = 'Sizing'); + const xt = { + '\\bigl': { mclass: 'mopen', size: 1 }, + '\\Bigl': { mclass: 'mopen', size: 2 }, + '\\biggl': { mclass: 'mopen', size: 3 }, + '\\Biggl': { mclass: 'mopen', size: 4 }, + '\\bigr': { mclass: 'mclose', size: 1 }, + '\\Bigr': { mclass: 'mclose', size: 2 }, + '\\biggr': { mclass: 'mclose', size: 3 }, + '\\Biggr': { mclass: 'mclose', size: 4 }, + '\\bigm': { mclass: 'mrel', size: 1 }, + '\\Bigm': { mclass: 'mrel', size: 2 }, + '\\biggm': { mclass: 'mrel', size: 3 }, + '\\Biggm': { mclass: 'mrel', size: 4 }, + '\\big': { mclass: 'mord', size: 1 }, + '\\Big': { mclass: 'mord', size: 2 }, + '\\bigg': { mclass: 'mord', size: 3 }, + '\\Bigg': { mclass: 'mord', size: 4 }, + }; + function kt(t) { + let e = '', + i = !0; + for (const s of t) + 'string' == typeof s.body ? (e += s.body) : (i = !1); + return i ? e : ''; + } + bt( + [ + '\\bigl', + '\\Bigl', + '\\biggl', + '\\Biggl', + '\\bigr', + '\\Bigr', + '\\biggr', + '\\Biggr', + '\\bigm', + '\\Bigm', + '\\biggm', + '\\Biggm', + '\\big', + '\\Big', + '\\bigg', + '\\Bigg', + ], + '{:delim}', + null, + function(t, e) { + return { + type: 'sizeddelim', + size: xt[t].size, + cls: xt[t].mclass, + delim: e[0], + }; + } + ), + (W = 'Relations'), + Y('=', '', ht, '=', Z), + Y('\\ne', '', ht, '≠', Z), + Y('\\neq', '', ht, '≠', G), + Y('<', '', ht, '<', Z), + Y('\\lt', '', ht, '<', G), + Y('>', '', ht, '>', Z), + Y('\\gt', '', ht, '>', G), + Y('\\le', '', ht, '≤', G), + Y('\\ge', '', ht, '≥', G), + Y('\\leqslant', nt, ht, '⩽', Z), + Y('\\geqslant', nt, ht, '⩾', Z), + Y('\\leq', '', ht, '≤', G), + Y('\\geq', '', ht, '≥', G), + Y('\\ll', '', ht, '≪'), + Y('\\gg', '', ht, '≫', G), + Y('\\coloneq', '', ht, '≔', 5), + Y('\\measeq', '', ht, '≝'), + Y('\\eqdef', '', ht, '≞'), + Y('\\questeq', '', ht, '≟'), + Y(':', '', ht, ':'), + Y('\\cong', '', ht, '≅', G), + Y('\\equiv', '', ht, '≡', G), + Y('\\prec', '', ht, '≺', G), + Y('\\preceq', '', ht, '⪯', G), + Y('\\succ', '', ht, '≻', G), + Y('\\succeq', '', ht, '⪰', 1916), + Y('\\perp', '', ht, '⊥', G), + Y('\\parallel', '', ht, '∥', G), + Y('\\propto', '', ht, '∝', G), + Y('\\Colon', '', ht, '∷'), + Y('\\smile', '', ht, '⌣', G), + Y('\\frown', '', ht, '⌢', G), + Y('\\sim', '', ht, '∼', G), + Y('\\gtrsim', nt, ht, '≳', G), + Y('\\approx', '', ht, '≈', Z), + Y('\\approxeq', nt, ht, '≊', 147), + Y('\\thickapprox', nt, ht, '≈', 377), + Y('\\lessapprox', nt, ht, '⪅', 146), + Y('\\gtrapprox', nt, ht, '⪆', 95), + Y('\\precapprox', nt, ht, '⪷', 50), + Y('\\succapprox', nt, ht, '⪸', j), + Y('\\thicksim', nt, ht, '∼', 779), + Y('\\succsim', nt, ht, '≿', 251), + Y('\\precsim', nt, ht, '≾', 104), + Y('\\backsim', nt, ht, '∽', 251), + Y('\\eqsim', nt, ht, '≂', 62), + Y('\\backsimeq', nt, ht, '⋍', 91), + Y('\\simeq', '', ht, '≃', j), + Y('\\lesssim', nt, ht, '≲', j), + Y('\\nleq', nt, ht, '≰', 369), + Y('\\ngeq', nt, ht, '≱', 164), + Y('\\smallsmile', nt, ht, '⌣', 31), + Y('\\smallfrown', nt, ht, '⌢', 71), + Y('\\bowtie', '', ht, '⋈', 558), + Y('\\asymp', '', ht, '≍', 755), + Y('\\sqsubseteq', '', ht, '⊑', 1255), + Y('\\sqsupseteq', '', ht, '⊒', 183), + Y('\\leqq', nt, ht, '≦', 1356), + Y('\\eqslantless', nt, ht, '⪕', 15), + Y('\\lll', nt, ht, '⋘', 157), + Y('\\lessgtr', nt, ht, '≶', 281), + Y('\\lesseqgtr', nt, ht, '⋚', 134), + Y('\\lesseqqgtr', nt, ht, '⪋', j), + Y('\\risingdotseq', nt, ht, '≓', 8), + Y('\\fallingdotseq', nt, ht, '≒', 99), + Y('\\subseteqq', nt, ht, '⫅', 82), + Y('\\Subset', nt, ht, '⋐'), + Y('\\sqsubset', nt, ht, '⊏', 309), + Y('\\preccurlyeq', nt, ht, '≼', 549), + Y('\\curlyeqprec', nt, ht, '⋞', 14), + Y('\\vDash', nt, ht, '⊨', 646), + Y('\\Vvdash', nt, ht, '⊪', 20), + Y('\\bumpeq', nt, ht, '≏', 13), + Y('\\Bumpeq', nt, ht, '≎', 12), + Y('\\geqq', nt, ht, '≧', 972), + Y('\\eqslantgtr', nt, ht, '⪖', 13), + Y('\\ggg', nt, ht, '⋙', 127), + Y('\\gtrless', nt, ht, '≷', 417), + Y('\\gtreqless', nt, ht, '⋛', 190), + Y('\\gtreqqless', nt, ht, '⪌', 91), + Y('\\supseteqq', nt, ht, '⫆', 6), + Y('\\Supset', nt, ht, '⋑', 34), + Y('\\sqsupset', nt, ht, '⊐', 71), + Y('\\succcurlyeq', nt, ht, '≽', 442), + Y('\\curlyeqsucc', nt, ht, '⋟', 10), + Y('\\Vdash', nt, ht, '⊩', 276), + Y('\\shortmid', nt, ht, '∣', 67), + Y('\\shortparallel', nt, ht, '∥', 17), + Y('\\between', nt, ht, '≬', 110), + Y('\\pitchfork', nt, ht, '⋔', 66), + Y('\\varpropto', nt, ht, '∝', 203), + Y('\\backepsilon', nt, ht, '∍', 176), + Y('\\llless', nt, ht, '⋘', j), + Y('\\gggtr', nt, ht, '⋙', j), + Y('\\lhd', nt, ct, '⊲', 447), + Y('\\rhd', nt, ct, '⊳', 338), + Y('\\Join', '', ht, '⋈', 35), + Y('\\doteq', '', ht, '≐', 1450), + Y('\\doteqdot', nt, ht, '≑', 60), + Y('\\Doteq', nt, ht, '≑', j), + Y('\\eqcirc', nt, ht, '≖', 6), + Y('\\circeq', nt, ht, '≗', 31), + Y('\\lessdot', nt, ct, '⋖', 88), + Y('\\gtrdot', nt, ct, '⋗', 45), + Y('\\~', '', ht, '~'), + (W = 'Logic'), + Y('\\leftrightarrow', '', ht, '↔', Z), + Y('\\Leftrightarrow', '', ht, '⇔', Z), + Y('\\to', '', ht, '→', Z), + Y('\\models', '', ht, '⊨', G), + Y('\\vdash', '', ht, '⊢', G), + Y('\\therefore', nt, ht, '∴', 1129), + Y('\\because', nt, ht, '∵', 388), + Y('\\implies', '', ht, '⟹', 1858), + Y('\\gets', '', ht, '←', 150), + Y('\\dashv', '', ht, '⊣', 299), + Y('\\impliedby', '', ht, '⟸', j), + Y('\\biconditional', '', ht, '⟷', j), + Y('\\roundimplies', '', ht, '⥰', j), + (W = 'Operators'), + Y('+', '', ct, '+', Z), + Y('-', '', ct, '−', Z), + Y('−', '', ct, '−', Z), + Y('\\pm', '', ct, '±', G), + Y('\\mp', '', ct, '∓', G), + Y('*', '', ct, '∗', G), + Y('\\times', '', ct, '×', G), + Y('\\div', '', ct, '÷', G), + Y('\\surd', '', lt, '√', G), + Y('\\divides', '', ct, '∣', j), + Y('\\ltimes', nt, ct, '⋉', 576), + Y('\\rtimes', nt, ct, '⋊', 946), + Y('\\leftthreetimes', nt, ct, '⋋', 34), + Y('\\rightthreetimes', nt, ct, '⋌', 14), + Y('\\intercal', nt, ct, '⊺', 478), + Y('\\dotplus', nt, ct, '∔', 81), + Y('\\centerdot', nt, ct, '⋅', 271), + Y('\\doublebarwedge', nt, ct, '⩞', 5), + Y('\\divideontimes', nt, ct, '⋇', 51), + Y('\\cdot', '', ct, '⋅', j), + (W = 'Others'), + Y('\\infty', '', lt, '∞', Z), + Y('\\prime', '', rt, '′', Z), + Y('\\doubleprime', '', lt, '″'), + Y('\\angle', '', lt, '∠', G), + Y('`', '', lt, '‘'), + Y('\\$', '', lt, '$'), + Y('\\%', '', lt, '%'), + Y('\\_', '', lt, '_'), + (W = 'Greek'), + Y('\\alpha', '', rt, 'α', G), + Y('\\beta', '', rt, 'β', G), + Y('\\gamma', '', rt, 'γ', G), + Y('\\delta', '', rt, 'δ', G), + Y('\\epsilon', '', rt, 'ϵ', G), + Y('\\varepsilon', '', rt, 'ε'), + Y('\\zeta', '', rt, 'ζ', G), + Y('\\eta', '', rt, 'η', G), + Y('\\theta', '', rt, 'θ', G), + Y('\\vartheta', '', rt, 'ϑ', G), + Y('\\iota', '', rt, 'ι', G), + Y('\\kappa', '', rt, 'κ', G), + Y('\\varkappa', nt, rt, 'ϰ', G), + Y('\\lambda', '', rt, 'λ', G), + Y('\\mu', '', rt, 'μ', G), + Y('\\nu', '', rt, 'ν', G), + Y('\\xi', '', rt, 'ξ', G), + Y('\\omicron', '', rt, 'o'), + Y('\\pi', '', rt, 'π', G), + Y('\\varpi', '', rt, 'ϖ', G), + Y('\\rho', '', rt, 'ρ', G), + Y('\\varrho', '', rt, 'ϱ', G), + Y('\\sigma', '', rt, 'σ', G), + Y('\\varsigma', '', rt, 'ς', G), + Y('\\tau', '', rt, 'τ', G), + Y('\\phi', '', rt, 'ϕ', G), + Y('\\varphi', '', rt, 'φ', G), + Y('\\upsilon', '', rt, 'υ', G), + Y('\\chi', '', rt, 'χ', G), + Y('\\psi', '', rt, 'ψ', G), + Y('\\omega', '', rt, 'ω', G), + Y('\\Gamma', '', rt, 'Γ', G), + Y('\\Delta', '', rt, 'Δ', G), + Y('\\Theta', '', rt, 'Θ', G), + Y('\\Lambda', '', rt, 'Λ', G), + Y('\\Xi', '', rt, 'Ξ', G), + Y('\\Pi', '', rt, 'Π', G), + Y('\\Sigma', '', rt, 'Σ', G), + Y('\\Upsilon', '', rt, 'Υ', G), + Y('\\Phi', '', rt, 'Φ', G), + Y('\\Psi', '', rt, 'Ψ', G), + Y('\\Omega', '', rt, 'Ω', G), + Y('\\digamma', nt, rt, 'ϝ', 248), + (W = 'Others'), + Y('\\emptyset', '', lt, '∅', Z), + Y('\\varnothing', nt, lt, '∅', Z), + (W = 'Set Operators'), + Y('\\cap', '', ct, '∩', Z), + Y('\\cup', '', ct, '∪', Z), + Y('\\setminus', '', ct, '∖', G), + Y('\\smallsetminus', nt, ct, '∖', 254), + Y('\\complement', nt, lt, '∁', 200), + (W = 'Set Relations'), + Y('\\in', '', ht, '∈', Z), + Y('\\notin', '', ht, '∉', Z), + Y('\\not', '', ht, '̸', G), + Y('\\ni', '', ht, '∋', G), + Y('\\owns', '', ht, '∋', 18), + Y('\\subset', '', ht, '⊂', Z), + Y('\\supset', '', ht, '⊃', Z), + Y('\\subseteq', '', ht, '⊆', Z), + Y('\\supseteq', '', ht, '⊇', Z), + Y('\\subsetneq', nt, ht, '⊊', 1945), + Y('\\varsubsetneq', nt, ht, '', 198), + Y('\\subsetneqq', nt, ht, '⫋', 314), + Y('\\varsubsetneqq', nt, ht, '', 55), + Y('\\nsubset', nt, ht, '⊄', j), + Y('\\nsupset', nt, ht, '⊅', j), + Y('\\nsubseteq', nt, ht, '⊈', 950), + Y('\\nsupseteq', nt, ht, '⊉', 49), + (W = 'Spacing'), + Y('\\ ', '', mt, ' '), + Y('~', '', mt, ' '), + Y('\\space', '', mt, ' '), + Y('\\!', '', mt, null), + Y('\\,', '', mt, null), + Y('\\:', '', mt, null), + Y('\\;', '', mt, null), + Y('\\enskip', '', mt, null), + Y('\\enspace', '', mt, null, 672), + Y('\\quad', '', mt, null, G), + Y('\\qquad', '', mt, null, G), + bt( + ['\\hspace', '\\hspace*'], + '{width:skip}', + { allowedInText: !0 }, + function(t, e) { + return { type: 'spacing', width: e[0] || 0 }; + } + ), + bt( + [ + '\\mathop', + '\\mathbin', + '\\mathrel', + '\\mathopen', + '\\mathclose', + '\\mathpunct', + '\\mathord', + '\\mathinner', + ], + '{:auto}', + null, + function(t, e) { + const i = { + type: { + '\\mathop': 'mop', + '\\mathbin': 'mbin', + '\\mathrel': 'mrel', + '\\mathopen': 'mopen', + '\\mathclose': 'mclose', + '\\mathpunct': 'mpunct', + '\\mathord': 'mord', + '\\mathinner': 'minner', + }[t], + body: kt(e[0]) || e[0], + captureSelection: !0, + baseFontFamily: '\\mathop' === t ? 'math' : '', + }; + return ( + '\\mathop' === t && + ((i.limits = 'nolimits'), (i.isFunction = !0)), + i + ); + } + ), + bt( + ['\\operatorname', '\\operatorname*'], + '{operator:math}', + null, + function(t, e) { + const i = { + type: 'mop', + skipBoundary: !0, + body: e[0], + isFunction: !0, + }; + return ( + i.body.forEach(t => { + (t.isFunction = !1), (t.autoFontFamily = 'cmr'); + }), + '\\operatorname' === t + ? (i.limits = 'nolimits') + : '\\operatorname*' === t && (i.limits = 'limits'), + i + ); + } + ), + (W = 'Punctuation'), + Y('\\colon', '', 'mpunct', ':', G), + Y('\\cdotp', '', 'mpunct', '⋅', G), + Y('\\ldots', '', 'minner', '…', G), + Y('\\cdots', '', 'minner', '⋯', G), + Y('\\ddots', '', 'minner', '⋱', G), + Y('\\mathellipsis', '', 'minner', '…', 91), + Y('\\vdots', '', lt, '⋮', G), + Y('\\ldotp', '', 'mpunct', '.', 18), + Y(',', '', 'mpunct', ','), + Y(';', '', 'mpunct', ';'), + (W = 'Logical Operators'), + Y('\\wedge', '', ct, '∧', Z), + Y('\\vee', '', ct, '∨', Z), + Y('\\lnot', '', lt, '¬', G), + Y('\\neg', '', lt, '¬', Z), + Y('\\land', '', ct, '∧', 659), + Y('\\lor', '', ct, '∨', 364), + Y('\\barwedge', nt, ct, '⊼', 21), + Y('\\veebar', nt, ct, '⊻', 43), + Y('\\nor', nt, ct, '⊻', 7), + Y('\\curlywedge', nt, ct, '⋏', 58), + Y('\\curlyvee', nt, ct, '⋎', 57), + (W = 'Boxes'), + Y('\\square', nt, lt, '□', G), + Y('\\Box', nt, lt, '□', G), + Y('\\blacksquare', nt, lt, '■', 1679), + Y('\\boxminus', nt, ct, '⊟', 79), + Y('\\boxplus', nt, ct, '⊞', 276), + Y('\\boxtimes', nt, ct, '⊠', 457), + Y('\\boxdot', nt, ct, '⊡', 120), + (W = 'Circles'), + Y('\\circ', '', ct, '∘', Z), + Y('\\bigcirc', '', ct, '◯', 903), + Y('\\bullet', '', ct, '∙', G), + Y('\\circleddash', nt, ct, '⊝', G), + Y('\\circledast', nt, ct, '⊛', 339), + Y('\\oplus', '', ct, '⊕', G), + Y('\\ominus', '', ct, '⊖', 1568), + Y('\\otimes', '', ct, '⊗', G), + Y('\\odot', '', ct, '⊙', G), + Y('\\circledcirc', nt, ct, '⊚', 93), + Y('\\oslash', '', ct, '⊘', 497), + Y('\\circledS', nt, lt, 'Ⓢ', 31), + Y('\\circledR', nt, lt, '®', 1329), + (W = 'Triangles'), + Y('\\triangle', '', lt, '△', G), + Y('\\triangleq', nt, ht, '≜', G), + Y('\\bigtriangleup', '', ct, '△', 1773), + Y('\\vartriangle', nt, ht, '△', 762), + Y('\\triangledown', nt, lt, '▽', 520), + Y('\\bigtriangledown', '', ct, '▽', 661), + Y('\\triangleleft', '', ct, '◃', 534), + Y('\\vartriangleleft', nt, ht, '⊲', 281), + Y('\\trianglelefteq', nt, ht, '⊴', 176), + Y('\\ntriangleleft', nt, ht, '⋪', 13), + Y('\\ntrianglelefteq', nt, ht, '⋬', 22), + Y('\\triangleright', '', ct, '▹', 516), + Y('\\vartriangleright', nt, ht, '⊳', 209), + Y('\\trianglerighteq', nt, ht, '⊵', 45), + Y('\\ntriangleright', nt, ht, '⋫', 15), + Y('\\ntrianglerighteq', nt, ht, '⋭', 6), + Y('\\blacktriangle', nt, lt, '▲', 360), + Y('\\blacktriangledown', nt, lt, '▼', 159), + Y('\\blacktriangleleft', nt, ht, '◀', 101), + Y('\\blacktriangleright', nt, ht, '▶', 271), + (W = 'Others'), + Y('\\/', '', rt, '/'), + Y('|', '', 'textord', '∣'), + (W = 'Big Operators'), + Y('\\sqcup', '', ct, '⊔', 1717), + Y('\\sqcap', '', ct, '⊓', 735), + Y('\\uplus', '', ct, '⊎', 597), + Y('\\wr', '', ct, '≀', 286), + Y('\\Cap', nt, ct, '⋒', 2), + Y('\\Cup', nt, ct, '⋓', 2), + Y('\\doublecap', nt, ct, '⋒', 1), + Y('\\doublecup', nt, ct, '⋓', 1), + Y('\\amalg', '', ct, '⨿', j), + Y('\\And', '', ct, '&'), + (W = 'Accents'), + bt( + [ + '\\acute', + '\\grave', + '\\dot', + '\\ddot', + '\\mathring', + '\\tilde', + '\\bar', + '\\breve', + '\\check', + '\\hat', + '\\vec', + ], + '{body:auto}', + null, + function(t, e) { + return { + type: 'accent', + accent: { + '\\acute': 'ˊ', + '\\grave': 'ˋ', + '\\dot': '˙', + '\\ddot': '¨', + '\\mathring': '˚', + '\\tilde': '~', + '\\bar': 'ˉ', + '\\breve': '˘', + '\\check': 'ˇ', + '\\hat': '^', + '\\vec': '⃗', + }[t], + limits: 'accent', + skipBoundary: !0, + body: e[0], + }; + } + ), + J(G, '\\bar', '\\ddot', '\\acute', '\\tilde', '\\check'), + J(1548, '\\breve'), + J(735, '\\grave'), + J(Z, '\\vec'), + (W = 'Letters and Letter Like Forms'), + Y('\\imath', '', lt, 'ı'), + Y('\\jmath', '', lt, 'ȷ'), + (W = 'Others'), + Y('\\degree', '', lt, '°', 46), + (W = 'Others'), + Y("'", '', lt, '′'), + Y('"', '', lt, '”'), + (W = 'Others'), + bt('\\^', '{:string}', { allowedInText: !0 }, function(t, e) { + return { + type: 'mord', + limits: 'nolimits', + symbol: !0, + isFunction: !1, + body: + (e[0] && + { + a: 'â', + e: 'ê', + i: 'î', + o: 'ô', + u: 'û', + A: 'Â', + E: 'Ê', + I: 'Î', + O: 'Ô', + U: 'Û', + }[e[0]]) || + '^', + baseFontFamily: 'cmr', + }; + }), + bt('\\`', '{:string}', { allowedInText: !0 }, function(t, e) { + return { + type: 'mord', + limits: 'nolimits', + symbol: !0, + isFunction: !1, + body: + (e[0] && + { + a: 'à', + e: 'è', + i: 'ì', + o: 'ò', + u: 'ù', + A: 'À', + E: 'È', + I: 'Ì', + O: 'Ò', + U: 'Ù', + }[e[0]]) || + '`', + baseFontFamily: 'cmr', + }; + }), + bt("\\'", '{:string}', { allowedInText: !0 }, function(t, e) { + return { + type: 'mord', + limits: 'nolimits', + symbol: !0, + isFunction: !1, + body: + (e[0] && + { + a: 'á', + e: 'é', + i: 'í', + o: 'ó', + u: 'ú', + A: 'Á', + E: 'É', + I: 'Í', + O: 'Ó', + U: 'Ú', + }[e[0]]) || + '^', + baseFontFamily: 'cmr', + }; + }), + bt('\\~', '{:string}', { allowedInText: !0 }, function(t, e) { + return { + type: 'mord', + limits: 'nolimits', + symbol: !0, + isFunction: !1, + body: + (e[0] && + { n: 'ñ', N: 'Ñ', a: 'ã', o: 'õ', A: 'Ã', O: 'Õ' }[ + e[0] + ]) || + '´', + baseFontFamily: 'cmr', + }; + }), + bt('\\c', '{:string}', { allowedInText: !0 }, function(t, e) { + return { + type: 'mord', + limits: 'nolimits', + symbol: !0, + isFunction: !1, + body: (e[0] && { c: 'ç', C: 'Ç' }[e[0]]) || '', + baseFontFamily: 'cmr', + }; + }); + const vt = { + '\\#': '#', + '\\&': '&', + '\\$': '$', + '\\%': '%', + '\\_': '_', + '\\euro': '€', + '\\maltese': '✠', + '\\{': '{', + '\\}': '}', + '\\nobreakspace': ' ', + '\\ldots': '…', + '\\textellipsis': '…', + '\\backslash': '\\', + '`': '‘', + "'": '’', + '``': '“', + "''": '”', + '\\degree': '°', + '\\textasciicircum': '^', + '\\textasciitilde': '~', + '\\textasteriskcentered': '*', + '\\textbackslash': '\\', + '\\textbraceleft': '{', + '\\textbraceright': '}', + '\\textbullet': '•', + '\\textdollar': '$', + '\\textsterling': '£', + '–': '–', + '—': '—', + '‘': '‘', + '’': '’', + '“': '“', + '”': '”', + '"': '”', + '\\ss': 'ß', + '\\ae': 'æ', + '\\oe': 'œ', + '\\AE': 'Æ', + '\\OE': 'Œ', + '\\O': 'Ø', + '\\i': 'ı', + '\\j': 'ȷ', + '\\aa': 'å', + '\\AA': 'Å', + }, + wt = + 'undefined' != typeof navigator && + /firefox|edge/i.test(navigator.userAgent) + ? /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/ + : new RegExp('\\p{Letter}', 'u'), + St = + 'undefined' != typeof navigator && + /firefox|edge/i.test(navigator.userAgent) + ? /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/ + : new RegExp('[0-9\\p{Letter}]', 'u'); + var At = { + matchCodepoint: et, + commandAllowed: function(t, e) { + return ( + !(!V[e] || ('text' === t && !V[e].allowedInText)) || + !!{ text: vt, math: H }[t][e] + ); + }, + unicodeToMathVariant: at, + mathVariantToUnicode: function(t, e, i) { + if (!/[A-Za-z0-9]/.test(t)) return t; + if (!e && !i) return t; + const s = t.codePointAt(0); + for (let t = 0; t < st.length; t++) + if ( + (!e || st[t].variant === e) && + (!i || st[t].style === i) && + s >= st[t].offset && + s < st[t].offset + st[t].len + ) { + const e = st[t].start + s - st[t].offset; + return String.fromCodePoint(it[e] || e); + } + return t; + }, + unicodeStringToLatex: function(t, e) { + let i = ''; + for (const s of e) i += ot(t, s.codePointAt(0)); + return i; + }, + getInfo: function(t, e, i) { + if (0 === t.length) return null; + let s = null; + if ('\\' === t.charAt(0)) { + if (((s = V[t]), s)) + return 'math' === e || s.allowedInText ? s : null; + if ( + (s || + ('math' === e + ? (s = H[t]) + : vt[t] && (s = { value: vt[t] })), + !s) + ) { + const e = t.slice(1); + if (i && i[e]) { + let t = i[e]; + 'object' == typeof t && (t = t.def); + let a = 0; + for ( + /(^|[^\\])#1/.test(t) && (a = 1), + /(^|[^\\])#2/.test(t) && (a = 2), + /(^|[^\\])#3/.test(t) && (a = 3), + /(^|[^\\])#4/.test(t) && (a = 4), + /(^|[^\\])#5/.test(t) && (a = 5), + /(^|[^\\])#6/.test(t) && (a = 6), + /(^|[^\\])#7/.test(t) && (a = 7), + /(^|[^\\])#8/.test(t) && (a = 8), + /(^|[^\\])#9/.test(t) && (a = 9), + s = { + type: 'group', + allowedInText: !1, + params: [], + infix: !1, + }; + a >= 1; + + ) + s.params.push({ + optional: !1, + type: 'math', + defaultValue: null, + placeholder: null, + }), + (a -= 1); + } + } + } else + 'math' === e ? (s = H[t]) : vt[t] && (s = { value: vt[t] }); + return ( + !s || + 'mord' !== s.type || + ('f' !== s.value && + 'g' !== s.value && + 'h' !== s.value) || + (s.isFunction = !0), + s + ); + }, + getValue: function(t, e) { + return 'math' === t + ? H[e] && H[e].value + ? H[e].value + : e + : vt[e] + ? vt[e] + : e; + }, + getEnvironmentInfo: function(t) { + let e = U[t]; + return ( + e || + (e = { + params: '', + parser: null, + mathstyle: 'displaystyle', + tabular: !0, + colFormat: [], + lFence: '.', + rFence: '.', + }), + e + ); + }, + suggest: function(t) { + if (t.length <= 1) return []; + const e = []; + for (const i in V) + Object.prototype.hasOwnProperty.call(V, i) && + i.startsWith(t) && + !V[i].infix && + e.push({ match: i, frequency: V[i].frequency }); + for (const i in H) + Object.prototype.hasOwnProperty.call(H, i) && + i.startsWith(t) && + e.push({ match: i, frequency: H[i].frequency }); + return ( + e.sort((t, e) => + t.frequency === e.frequency + ? t.match.length - e.match.length + : (e.frequency || 0) - (t.frequency || 0) + ), + e + ); + }, + FREQUENCY_VALUE: X, + TEXT_SYMBOLS: vt, + MATH_SYMBOLS: H, + ENVIRONMENTS: U, + RIGHT_DELIM: { + '(': ')', + '{': '}', + '[': ']', + '|': '|', + '\\lbrace': '\\rbrace', + '\\{': '\\}', + '\\langle': '\\rangle', + '\\lfloor': '\\rfloor', + '\\lceil': '\\rceil', + '\\vert': '\\vert', + '\\lvert': '\\rvert', + '\\Vert': '\\Vert', + '\\lVert': '\\rVert', + '\\lbrack': '\\rbrack', + '\\ulcorner': '\\urcorner', + '\\llcorner': '\\lrcorner', + '\\lgroup': '\\rgroup', + '\\lmoustache': '\\rmoustache', + }, + FUNCTIONS: V, + MACROS: { + iff: '\\;⟺\\;', + nicefrac: '^{#1}\\!\\!/\\!_{#2}', + bra: '\\mathinner{\\langle{#1}|}', + ket: '\\mathinner{|{#1}\\rangle}', + braket: '\\mathinner{\\langle{#1}\\rangle}', + set: '\\mathinner{\\lbrace #1 \\rbrace}', + Bra: '\\left\\langle #1\\right|', + Ket: '\\left|#1\\right\\rangle', + Braket: '\\left\\langle{#1}\\right\\rangle', + Set: '\\left\\lbrace #1 \\right\\rbrace', + }, + COMMAND_MODE_CHARACTERS: /[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/, + LETTER: wt, + LETTER_AND_DIGITS: St, + }; + const Mt = $.makeSymbol, + Ct = $.makeSpan, + _t = $.makeVlist; + function Tt(t, e, i, s, a, o) { + const n = Mt('Size' + i + '-Regular', At.getValue('math', e)), + r = $.makeStyleWrap( + t, + Ct(n, 'delimsizing size' + i), + a.mathstyle, + M.TEXT, + o + ); + return ( + s && + r.setTop( + (1 - a.mathstyle.sizeMultiplier) * + a.mathstyle.metrics.axisHeight + ), + r.setStyle('color', a.color), + 'number' == typeof a.opacity && + r.setStyle('opacity', a.opacity), + r + ); + } + function Lt(t, e) { + let i = ''; + return ( + 'Size1-Regular' === e + ? (i = ' delim-size1') + : 'Size4-Regular' === e && (i = ' delim-size4'), + Ct(Mt(e, At.getValue('math', t)), 'delimsizinginner' + i) + ); + } + function Ft(t, e, i, s, a, o) { + let n, r, l, c; + (n = l = c = At.getValue('math', e)), (r = null); + let h = 'Size1-Regular'; + '\\vert' === e || + '\\lvert' === e || + '\\rvert' === e || + '\\mvert' === e || + '\\mid' === e + ? (l = n = c = '∣') + : '\\Vert' === e || + '\\lVert' === e || + '\\rVert' === e || + '\\mVert' === e || + '\\|' === e + ? (l = n = c = '∥') + : '\\uparrow' === e + ? (l = c = '⏐') + : '\\Uparrow' === e + ? (l = c = '‖') + : '\\downarrow' === e + ? (n = l = '⏐') + : '\\Downarrow' === e + ? (n = l = '‖') + : '\\updownarrow' === e + ? ((n = '↑'), (l = '⏐'), (c = '↓')) + : '\\Updownarrow' === e + ? ((n = '⇑'), (l = '‖'), (c = '⇓')) + : '[' === e || '\\lbrack' === e + ? ((n = '⎡'), (l = '⎢'), (c = '⎣'), (h = 'Size4-Regular')) + : ']' === e || '\\rbrack' === e + ? ((n = '⎤'), (l = '⎥'), (c = '⎦'), (h = 'Size4-Regular')) + : '\\lfloor' === e + ? ((l = n = '⎢'), (c = '⎣'), (h = 'Size4-Regular')) + : '\\lceil' === e + ? ((n = '⎡'), (l = c = '⎢'), (h = 'Size4-Regular')) + : '\\rfloor' === e + ? ((l = n = '⎥'), (c = '⎦'), (h = 'Size4-Regular')) + : '\\rceil' === e + ? ((n = '⎤'), (l = c = '⎥'), (h = 'Size4-Regular')) + : '(' === e + ? ((n = '⎛'), (l = '⎜'), (c = '⎝'), (h = 'Size4-Regular')) + : ')' === e + ? ((n = '⎞'), (l = '⎟'), (c = '⎠'), (h = 'Size4-Regular')) + : '\\{' === e || '\\lbrace' === e + ? ((n = '⎧'), + (r = '⎨'), + (c = '⎩'), + (l = '⎪'), + (h = 'Size4-Regular')) + : '\\}' === e || '\\rbrace' === e + ? ((n = '⎫'), + (r = '⎬'), + (c = '⎭'), + (l = '⎪'), + (h = 'Size4-Regular')) + : '\\lgroup' === e + ? ((n = '⎧'), (c = '⎩'), (l = '⎪'), (h = 'Size4-Regular')) + : '\\rgroup' === e + ? ((n = '⎫'), (c = '⎭'), (l = '⎪'), (h = 'Size4-Regular')) + : '\\lmoustache' === e + ? ((n = '⎧'), (c = '⎭'), (l = '⎪'), (h = 'Size4-Regular')) + : '\\rmoustache' === e + ? ((n = '⎫'), (c = '⎩'), (l = '⎪'), (h = 'Size4-Regular')) + : '\\surd' === e + ? ((n = ''), (c = '⎷'), (l = ''), (h = 'Size4-Regular')) + : '\\ulcorner' === e + ? ((n = '┌'), (l = c = ' ')) + : '\\urcorner' === e + ? ((n = '┐'), (l = c = ' ')) + : '\\llcorner' === e + ? ((c = '└'), (l = n = ' ')) + : '\\lrcorner' === e && ((n = '┘'), (l = n = ' ')); + const d = m.getCharacterMetrics(At.getValue('math', n), h), + p = d.height + d.depth, + u = m.getCharacterMetrics(At.getValue('math', l), h), + f = u.height + u.depth, + g = m.getCharacterMetrics(At.getValue('math', c), h), + y = g.height + g.depth; + let b = 0, + x = 1; + if (null !== r) { + const t = m.getCharacterMetrics(At.getValue('math', r), h); + (b = t.height + t.depth), (x = 2); + } + const k = p + y + b, + v = Math.ceil((i - k) / (x * f)), + w = k + v * x * f; + let S = a.mathstyle.metrics.axisHeight; + s && (S *= a.mathstyle.sizeMultiplier); + const A = w / 2 - S, + C = []; + if ((C.push(Lt(c, h)), null === r)) + for (let t = 0; t < v; t++) C.push(Lt(l, h)); + else { + for (let t = 0; t < v; t++) C.push(Lt(l, h)); + C.push(Lt(r, h)); + for (let t = 0; t < v; t++) C.push(Lt(l, h)); + } + C.push(Lt(n, h)); + const _ = _t(a, C, 'bottom', A); + return ( + _.setStyle('color', a.color), + 'number' == typeof a.opacity && + _.setStyle('opacity', a.opacity), + $.makeStyleWrap( + t, + Ct(_, 'delimsizing mult'), + a.mathstyle, + M.TEXT, + o + ) + ); + } + const Dt = [ + '(', + ')', + '[', + '\\lbrack', + ']', + '\\rbrack', + '\\{', + '\\lbrace', + '\\}', + '\\rbrace', + '\\lfloor', + '\\rfloor', + '\\lceil', + '\\rceil', + '\\surd', + ], + zt = [ + '\\uparrow', + '\\downarrow', + '\\updownarrow', + '\\Uparrow', + '\\Downarrow', + '\\Updownarrow', + '|', + '\\|', + '\\vert', + '\\Vert', + '\\lvert', + '\\rvert', + '\\lVert', + '\\rVert', + '\\mvert', + '\\mid', + '\\lgroup', + '\\rgroup', + '\\lmoustache', + '\\rmoustache', + ], + Et = [ + '<', + '>', + '\\langle', + '\\rangle', + '/', + '\\backslash', + '\\lt', + '\\gt', + ], + qt = [0, 1.2, 1.8, 2.4, 3], + Pt = [ + { type: 'small', mathstyle: M.SCRIPTSCRIPT }, + { type: 'small', mathstyle: M.SCRIPT }, + { type: 'small', mathstyle: M.TEXT }, + { type: 'large', size: 1 }, + { type: 'large', size: 2 }, + { type: 'large', size: 3 }, + { type: 'large', size: 4 }, + ], + It = [ + { type: 'small', mathstyle: M.SCRIPTSCRIPT }, + { type: 'small', mathstyle: M.SCRIPT }, + { type: 'small', mathstyle: M.TEXT }, + { type: 'stack' }, + ], + Bt = [ + { type: 'small', mathstyle: M.SCRIPTSCRIPT }, + { type: 'small', mathstyle: M.SCRIPT }, + { type: 'small', mathstyle: M.TEXT }, + { type: 'large', size: 1 }, + { type: 'large', size: 2 }, + { type: 'large', size: 3 }, + { type: 'large', size: 4 }, + { type: 'stack' }, + ]; + function Ot(t, e, i, s, a, o) { + if (!e || 0 === e.length || '.' === e) return Rt(t, a, t); + let n; + '<' === e || '\\lt' === e + ? (e = '\\langle') + : ('>' !== e && '\\gt' !== e) || (e = '\\rangle'), + (n = Et.includes(e) ? Pt : Dt.includes(e) ? Bt : It); + const r = (function(t, e, i, s) { + for ( + let o = Math.min(2, 3 - s.mathstyle.size); + o < i.length && 'stack' !== i[o].type; + o++ + ) { + const s = m.getCharacterMetrics( + t, + 'small' === (a = i[o]).type + ? 'Main-Regular' + : 'large' === a.type + ? 'Size' + a.size + '-Regular' + : 'Size4-Regular' + ); + if (s.defaultMetrics) + return { type: 'small', mathstyle: M.SCRIPT }; + let n = s.height + s.depth; + if ( + ('small' === i[o].type && + (n *= i[o].mathstyle.sizeMultiplier), + n > e) + ) + return i[o]; + } + var a; + return i[i.length - 1]; + })(At.getValue('math', e), i, n, a); + return 'small' === r.type + ? (function(t, e, i, s, a, o) { + const n = Mt('AMS-Regular', At.getValue('math', e)), + r = $.makeStyleWrap(t, n, a.mathstyle, i, o); + return ( + s && + r.setTop( + (1 - + a.mathstyle.sizeMultiplier / + i.sizeMultiplier) * + a.mathstyle.metrics.axisHeight + ), + r.setStyle('color', a.color), + 'number' == typeof a.opacity && + r.setStyle('opacity', a.opacity), + r + ); + })(t, e, r.mathstyle, s, a, o) + : 'large' === r.type + ? Tt(t, e, r.size, s, a, o) + : Ft(t, e, i, s, a, o); + } + function Rt(t, e, i) { + return $.makeSpanOfType( + t, + '', + 'sizing' + + e.mathstyle.adjustTo(M.TEXT) + + ' nulldelimiter ' + + (i || '') + ); + } + var Kt = { + makeSizedDelim: function(t, e, i, s, a) { + return '.' === e + ? Rt(t, s, a) + : ('<' === e || '\\lt' === e + ? (e = '\\langle') + : ('>' !== e && '\\gt' !== e) || (e = '\\rangle'), + Dt.includes(e) || Et.includes(e) + ? Tt(t, e, i, !1, s, a) + : zt.includes(e) + ? Ft(t, e, qt[i], !1, s, a) + : null); + }, + makeCustomSizedDelim: Ot, + makeLeftRightDelim: function(t, e, i, s, a, o) { + if ('.' === e) return Rt(t, a, o); + const n = + a.mathstyle.metrics.axisHeight * + a.mathstyle.sizeMultiplier, + r = 5 / m.METRICS.ptPerEm; + let l = s + n, + c = i - n; + c = Math.max(l, c); + let h = (901 * c) / 500; + return ( + (l = 2 * c - r), (h = Math.max(h, l)), Ot(t, e, h, !0, a, o) + ); + }, + }; + const Nt = $.makeSpan, + $t = $.makeOrd, + Wt = $.makeInner, + Ht = $.makeHlist, + Vt = $.makeVlist, + Ut = /\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/, + jt = /^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/, + Gt = { + size1: 0.5, + size2: 0.7, + size3: 0.8, + size4: 0.9, + size5: 1, + size6: 1.2, + size7: 1.44, + size8: 1.73, + size9: 2.07, + size10: 2.49, + }; + class Zt { + constructor(t, e, i, s) { + (this.mode = t), + (this.type = e), + (this.body = i), + this.applyStyle(s); + } + getStyle() { + return { + color: this.phantom ? 'transparent' : this.color, + backgroundColor: this.phantom + ? 'transparent' + : this.backgroundColor, + fontFamily: + this.baseFontFamily || + this.fontFamily || + this.autoFontFamily, + fontShape: this.fontShape, + fontSeries: this.fontSeries, + fontSize: this.fontSize, + cssId: this.cssId, + cssClass: this.cssClass, + }; + } + applyStyle(t) { + if ( + (Object.assign(this, t), + 'none' === this.fontFamily && (this.fontFamily = ''), + 'auto' === this.fontShape && (this.fontShape = ''), + 'auto' === this.fontSeries && (this.fontSeries = ''), + 'none' === this.color && (this.color = ''), + 'none' === this.backgroundColor && + (this.backgroundColor = ''), + 'auto' === this.fontSize && (this.fontSize = ''), + this.fontSize && (this.maxFontSize = Gt[this.fontSize]), + 'math' === this.mode) + ) { + const t = 'string' == typeof this.body ? this.body : ''; + (this.autoFontFamily = 'cmr'), + jt.test(t) + ? (this.autoFontFamily = 'math') + : /\\imath|\\jmath|\\pounds/.test(t) + ? (this.autoFontFamily = 'mainit') + : Ut.test(t) || + 'math' !== this.baseFontFamily || + (this.autoFontFamily = 'cmr'); + } else + 'text' === this.mode && + ('root' !== this.type && (this.type = ''), + delete this.baseFontFamily, + delete this.autoFontFamily); + } + getInitialBaseElement() { + let t = this; + return ( + Array.isArray(this.body) && + this.body.length > 0 && + ('first' !== this.body[0].type + ? (t = this.body[0].getInitialBaseElement()) + : this.body[1] && + (t = this.body[1].getInitialBaseElement())), + t + ); + } + getFinalBaseElement() { + return Array.isArray(this.body) && this.body.length > 0 + ? this.body[this.body.length - 1].getFinalBaseElement() + : this; + } + isCharacterBox() { + const t = this.getInitialBaseElement(); + return /minner|mbin|mrel|mpunct|mopen|mclose|textord/.test( + t.type + ); + } + forEach(t) { + if ((t(this), Array.isArray(this.body))) + for (const e of this.body) e && e.forEach(t); + else this.body && 'object' == typeof this.body && t(this.body); + if (this.superscript) + for (const e of this.superscript) e && e.forEach(t); + if (this.subscript) + for (const e of this.subscript) e && e.forEach(t); + if (this.overscript) + for (const e of this.overscript) e && e.forEach(t); + if (this.underscript) + for (const e of this.underscript) e && e.forEach(t); + if (this.numer) for (const e of this.numer) e && e.forEach(t); + if (this.denom) for (const e of this.denom) e && e.forEach(t); + if (this.index) for (const e of this.index) e && e.forEach(t); + if (this.array) + for (const e of this.array) + for (const i of e) for (const e of i) e.forEach(t); + } + filter(t) { + let e = []; + t(this) && e.push(this); + for (const i of [ + 'body', + 'superscript', + 'subscript', + 'overscript', + 'underscript', + 'numer', + 'denom', + 'index', + ]) + if (Array.isArray(this[i])) + for (const s of this[i]) + s && (e = e.concat(s.filter(t))); + if (Array.isArray(this.array)) + for (const i of this.array) + for (const s of i) s && (e = e.concat(s.filter(t))); + return e; + } + decomposeGroup(t) { + const e = t.clone({ mathstyle: this.mathstyle }), + i = $t(Qt(e, this.body)); + return ( + this.cssId && (i.cssId = this.cssId), + i.applyStyle({ + backgroundColor: this.backgroundColor, + cssClass: this.cssClass, + }), + i + ); + } + decomposeArray(t) { + let e = this.colFormat; + e && 0 === e.length && (e = [{ align: 'l' }]), + e || + (e = [ + { align: 'l' }, + { align: 'l' }, + { align: 'l' }, + { align: 'l' }, + { align: 'l' }, + { align: 'l' }, + { align: 'l' }, + { align: 'l' }, + { align: 'l' }, + { align: 'l' }, + ]); + const i = []; + let s = 0; + for (const t of e) t.align && s++; + for (const t of this.array) { + let e = 0; + for (; e < t.length; ) { + const a = [], + o = Math.min(t.length, e + s); + for (; e < o; ) a.push(t[e++]); + i.push(a); + } + } + 1 === i[i.length - 1].length && + 0 === i[i.length - 1][0].length && + i.pop(); + const a = M.toMathstyle(this.mathstyle) || t.mathstyle, + o = (this.arraystretch || 1) * h.baselineskip, + n = 0.7 * o, + r = 0.3 * o; + let l = 0, + c = 0; + const d = [], + p = i.length; + for (let e = 0; e < p; ++e) { + const s = i[e]; + c = Math.max(c, s.length); + let a = n, + o = r; + const h = []; + for (let e = 0; e < s.length; ++e) { + const i = + Qt( + t.clone({ mathstyle: this.mathstyle }), + s[e] + ) || [], + n = [$t(null)].concat(i); + (o = Math.max(o, $.depth(n))), + (a = Math.max(a, $.height(n))), + h.push(n); + } + let m = e === p - 1 ? 0 : this.jot || 0; + this.rowGaps && + this.rowGaps[e] && + ((m = this.rowGaps[e]), + m > 0 && ((m += r), o < m && (o = m), (m = 0))), + (h.height = a), + (h.depth = o), + (l += a), + (h.pos = l), + (l += o + m), + d.push(h); + } + const m = l / 2 + a.metrics.axisHeight, + u = []; + for (let e = 0; e < c; e++) { + const i = []; + for (const t of d) { + const s = t[e]; + s && + ((s.depth = t.depth), + (s.height = t.height), + i.push(s), + i.push(t.pos - m)); + } + i.length > 0 && u.push(Vt(t, i, 'individualShift')); + } + const f = []; + let g = !1, + y = !1, + b = 0, + x = !this.lFence; + for (const i of e) { + if (i.align && b >= u.length) break; + if (i.align && b < u.length) + g + ? f.push(Xt(2 * h.arraycolsep)) + : (y || x) && f.push(Xt(h.arraycolsep)), + f.push(Nt(u[b], 'col-align-' + i.align)), + b++, + (g = !0), + (y = !1), + (x = !1); + else if (void 0 !== i.gap) + 'number' == typeof i.gap + ? f.push(Xt(i.gap)) + : f.push(Jt(t, d, m, i.gap)), + (g = !1), + (y = !1), + (x = !1); + else if (i.rule) { + const e = Nt(null, 'vertical-separator'); + e.setStyle('height', l, 'em'), + e.setStyle( + 'margin-top', + 3 * t.mathstyle.metrics.axisHeight - m, + 'em' + ), + e.setStyle('vertical-align', 'top'); + let i = 0; + y + ? (i = h.doubleRuleSep - h.arrayrulewidth) + : g && (i = h.arraycolsep - h.arrayrulewidth), + e.setLeft(i, 'em'), + f.push(e), + (g = !1), + (y = !0), + (x = !1); + } + } + if ( + (g && !this.rFence && f.push(Xt(h.arraycolsep)), + !( + (this.lFence && '.' !== this.lFence) || + (this.rFence && '.' !== this.rFence) + )) + ) + return $t(f, 'mtable'); + const k = Nt(f, 'mtable'), + v = $.height(k), + w = $.depth(k); + return $t([ + this.bind( + t, + Kt.makeLeftRightDelim('mopen', this.lFence, v, w, t) + ), + k, + this.bind( + t, + Kt.makeLeftRightDelim('mclose', this.rFence, v, w, t) + ), + ]); + } + decomposeGenfrac(t) { + const e = + 'auto' === this.mathstyle + ? t.mathstyle + : M.toMathstyle(this.mathstyle), + i = t.clone({ mathstyle: e }); + let s = []; + this.numerPrefix && s.push($t(this.numerPrefix)); + const a = this.continuousFraction ? e : e.fracNum(); + s = s.concat(Qt(i.clone({ mathstyle: a }), this.numer)); + const o = Ht(s, t.mathstyle.adjustTo(a)); + let n = []; + this.denomPrefix && n.push($t(this.denomPrefix)); + const r = this.continuousFraction ? e : e.fracDen(); + n = n.concat(Qt(i.clone({ mathstyle: r }), this.denom)); + const l = Ht(n, t.mathstyle.adjustTo(r)), + c = this.hasBarLine + ? h.defaultRuleThickness / e.sizeMultiplier + : 0; + let d, p, m; + e.size === M.DISPLAY.size + ? ((d = e.metrics.num1), + (p = c > 0 ? 3 * c : 7 * h.defaultRuleThickness), + (m = e.metrics.denom1)) + : (c > 0 + ? ((d = e.metrics.num2), (p = c)) + : ((d = e.metrics.num3), + (p = 3 * h.defaultRuleThickness)), + (m = e.metrics.denom2)); + const u = o ? o.depth : 0, + f = l ? l.height : 0; + let g; + if (0 === c) { + const t = d - u - (f - m); + t < p && ((d += 0.5 * (p - t)), (m += 0.5 * (p - t))), + (g = Vt(i, [o, -d, l, m], 'individualShift')); + } else { + const t = e.metrics.axisHeight; + d - u - (t + 0.5 * c) < p && + (d += p - (d - u - (t + 0.5 * c))), + t - 0.5 * c - (f - m) < p && + (m += p - (t - 0.5 * c - (f - m))); + const s = Nt(null, ' frac-line'); + s.applyStyle(this.getStyle()), (s.height = c); + const a = []; + o && (a.push(o), a.push(-d)), + a.push(s), + a.push(c / 2 - t), + l && (a.push(l), a.push(m)), + (g = Vt(i, a, 'individualShift')); + } + (g.classes += ' mfrac'), + (g.height *= e.sizeMultiplier / t.mathstyle.sizeMultiplier), + (g.depth *= e.sizeMultiplier / t.mathstyle.sizeMultiplier); + const y = + e.size === M.DISPLAY.size + ? e.metrics.delim1 + : e.metrics.delim2, + b = this.bind( + t, + Kt.makeCustomSizedDelim( + 'mopen', + this.leftDelim, + y, + !0, + t.clone({ mathstyle: e }) + ) + ), + x = this.bind( + t, + Kt.makeCustomSizedDelim( + 'mclose', + this.rightDelim, + y, + !0, + t.clone({ mathstyle: e }) + ) + ); + b.applyStyle(this.getStyle()), x.applyStyle(this.getStyle()); + const k = $t( + [b, g, x], + t.parentSize !== t.size + ? 'sizing reset-' + t.parentSize + ' ' + t.size + : '' + ); + return this.bind(t, k); + } + decomposeLeftright(t) { + if (!this.body) + return this.leftDelim + ? new Zt('math', 'mopen', this.leftDelim).decompose(t) + : this.rightDelim + ? new Zt('math', 'mclose', this.rightDelim).decompose(t) + : null; + const e = t.clone(), + i = Qt(e, this.body), + s = e.mathstyle; + let a = 0, + o = 0, + n = []; + if ( + ((a = $.height(i) * s.sizeMultiplier), + (o = $.depth(i) * s.sizeMultiplier), + this.leftDelim && + (n.push( + this.bind( + t, + Kt.makeLeftRightDelim( + 'mopen', + this.leftDelim, + a, + o, + e + ) + ) + ), + n[n.length - 1].applyStyle(this.getStyle())), + i) + ) { + for (let s = 0; s < i.length; s++) + if (i[s].delim) { + const n = i[s].caret, + r = /ML__selected/.test(i[s].classes); + (i[s] = this.bind( + t, + Kt.makeLeftRightDelim( + 'minner', + i[s].delim, + a, + o, + e + ) + )), + (i[s].caret = n), + i[s].selected(r); + } + n = n.concat(i); + } + if (this.rightDelim) { + let i, + s = this.rightDelim; + '?' === s && + ((s = { + '(': ')', + '\\{': '\\}', + '\\[': '\\]', + '\\lbrace': '\\rbrace', + '\\langle': '\\rangle', + '\\lfloor': '\\rfloor', + '\\lceil': '\\rceil', + '\\vert': '\\vert', + '\\lvert': '\\rvert', + '\\Vert': '\\Vert', + '\\lVert': '\\rVert', + '\\lbrack': '\\rbrack', + '\\ulcorner': '\\urcorner', + '\\llcorner': '\\lrcorner', + '\\lgroup': '\\rgroup', + '\\lmoustache': '\\rmoustache', + }[this.leftDelim]), + (s = s || this.leftDelim), + (i = 'ML__smart-fence__close')), + n.push( + this.bind( + t, + Kt.makeLeftRightDelim('mclose', s, a, o, e, i) + ) + ), + n[n.length - 1].applyStyle(this.getStyle()); + } + return this.inner ? Wt(n, s.cls()) : n; + } + decomposeSurd(t) { + const e = t.mathstyle, + i = Qt(t.cramp(), this.body), + s = h.defaultRuleThickness / e.sizeMultiplier; + let a = s; + e.id < M.TEXT.id && (a = e.metrics.xHeight); + let o = s + a / 4; + const n = + Math.max( + 2 * a, + ($.height(i) + $.depth(i)) * e.sizeMultiplier + ) + + (o + s), + r = Nt( + Kt.makeCustomSizedDelim('', '\\surd', n, !1, t), + 'sqrt-sign' + ); + r.applyStyle(this.getStyle()); + const l = r.height + r.depth - s; + l > $.height(i) + $.depth(i) + o && + (o = (o + l - ($.height(i) + $.depth(i))) / 2), + r.setTop(r.height - $.height(i) - (o + s)); + const c = Nt(null, t.mathstyle.adjustTo(M.TEXT) + ' sqrt-line'); + c.applyStyle(this.getStyle()), (c.height = s); + const d = Vt(t, [i, o, c, s]); + if (!this.index) return this.bind(t, $t([r, d], 'sqrt')); + const p = t.clone({ mathstyle: M.SCRIPTSCRIPT }), + m = Nt(Qt(p, this.index), e.adjustTo(M.SCRIPTSCRIPT)), + u = Math.max(r.height, d.height), + f = Math.max(r.depth, d.depth), + g = Vt(t, [m], 'shift', -0.6 * (u - f)); + return this.bind(t, $t([Nt(g, 'root'), r, d], 'sqrt')); + } + decomposeAccent(t) { + const e = t.mathstyle; + let i = Qt(t.cramp(), this.body); + (this.superscript || this.subscript) && + (i = this.attachSupsub(t, $t(i), 'mord')); + let s = 0; + Array.isArray(this.body) && + 1 === this.body.length && + this.body[0].isCharacterBox() && + (s = $.skew(i)); + const a = Math.min($.height(i), e.metrics.xHeight), + o = $.makeSymbol('Main-Regular', this.accent, 'math'); + o.italic = 0; + const n = '⃗' === this.accent ? ' accent-vec' : ''; + let r = Nt(Nt(o), 'accent-body' + n); + return ( + (r = Vt(t, [i, -a, r])), + r.children[1].setLeft(2 * s), + $t(r, 'accent') + ); + } + decomposeLine(t) { + const e = t.mathstyle, + i = Qt(t.cramp(), this.body), + s = h.defaultRuleThickness / e.sizeMultiplier, + a = Nt( + null, + t.mathstyle.adjustTo(M.TEXT) + + ' ' + + this.position + + '-line' + ); + let o; + if ( + ((a.height = s), + (a.maxFontSize = 1), + 'overline' === this.position) + ) + o = Vt(t, [i, 3 * s, a, s]); + else { + const e = Nt(i); + o = Vt(t, [s, a, 3 * s, e], 'top', $.height(e)); + } + return $t(o, this.position); + } + decomposeOverunder(t) { + const e = Qt(t, this.body), + i = t.clone({ mathstyle: 'scriptstyle' }), + s = this.overscript + ? Nt( + Qt(i, this.overscript), + t.mathstyle.adjustTo(i.mathstyle) + ) + : null, + a = this.underscript + ? Nt( + Qt(i, this.underscript), + t.mathstyle.adjustTo(i.mathstyle) + ) + : null; + return Yt(t, e, 0, 0, s, a, this.mathtype || 'mrel'); + } + decomposeOverlap(t) { + const e = Nt(Qt(t, this.body), 'inner'); + return $t( + [e, Nt(null, 'fix')], + 'left' === this.align ? 'llap' : 'rlap' + ); + } + decomposeRule(t) { + const e = t.mathstyle, + i = $t('', 'rule'); + let s = this.shift && !isNaN(this.shift) ? this.shift : 0; + s /= e.sizeMultiplier; + const a = this.width / e.sizeMultiplier, + o = this.height / e.sizeMultiplier; + return ( + i.setStyle('border-right-width', a, 'em'), + i.setStyle('border-top-width', o, 'em'), + i.setStyle('margin-top', -(o - s), 'em'), + i.setStyle('border-color', t.color), + (i.width = a), + (i.height = o + s), + (i.depth = -s), + i + ); + } + decomposeOp(t) { + const e = t.mathstyle; + let i, + s = !1; + e.size === M.DISPLAY.size && + 'string' == typeof this.body && + '\\smallint' !== this.body && + (s = !0); + let a = 0, + o = 0; + if (this.symbol) { + const n = s ? 'Size2-Regular' : 'Size1-Regular'; + (i = $.makeSymbol( + n, + this.body, + 'op-symbol ' + (s ? 'large-op' : 'small-op') + )), + (i.type = 'mop'), + (a = + (i.height - i.depth) / 2 - + e.metrics.axisHeight * e.sizeMultiplier), + (o = i.italic), + this.bind(t, i); + } else + Array.isArray(this.body) + ? ((i = $.makeOp(Qt(t, this.body))), this.bind(t, i)) + : (i = this.makeSpan(t, this.body)); + if (this.superscript || this.subscript) { + const s = this.limits || 'auto'; + return this.alwaysHandleSupSub || + 'limits' === s || + ('auto' === s && e.size === M.DISPLAY.size) + ? this.attachLimits(t, i, a, o) + : this.attachSupsub(t, i, 'mop'); + } + return this.symbol && i.setTop(a), i; + } + decomposeBox(t) { + const e = $t(Qt(t, this.body)), + i = Nt(); + i.setStyle('position', 'absolute'); + const s = + 'number' == typeof this.padding ? this.padding : h.fboxsep; + i.setStyle('height', e.height + e.depth + 2 * s, 'em'), + 0 !== s + ? i.setStyle('width', 'calc(100% + ' + 2 * s + 'em)') + : i.setStyle('width', '100%'), + i.setStyle('top', -s, 'em'), + i.setStyle('left', -s, 'em'), + i.setStyle('z-index', '-1'), + this.backgroundcolor && + i.setStyle('background-color', this.backgroundcolor), + this.framecolor && + i.setStyle( + 'border', + h.fboxrule + 'em solid ' + this.framecolor + ), + this.border && i.setStyle('border', this.border), + e.setStyle('display', 'inline-block'), + e.setStyle('height', e.height + e.depth, 'em'), + e.setStyle('vertical-align', -e.depth + s, 'em'); + const a = Nt([i, e]); + return ( + a.setStyle('position', 'relative'), + a.setStyle('vertical-align', -s + e.depth, 'em'), + (a.height = e.height + s), + (a.depth = e.depth + s), + a.setLeft(s), + a.setRight(s), + a + ); + } + decomposeEnclose(t) { + const e = $t(Qt(t, this.body)), + i = 'auto' === this.padding ? 0.2 : this.padding; + e.setStyle('padding', i, 'em'), + e.setStyle('display', 'inline-block'), + e.setStyle('height', e.height + e.depth, 'em'), + e.setStyle('left', -i, 'em'), + this.backgroundcolor && + 'transparent' !== this.backgroundcolor && + e.setStyle('background-color', this.backgroundcolor); + let s = ''; + if ( + (this.notation.box && + e.setStyle('border', this.borderStyle), + this.notation.actuarial && + (e.setStyle('border-top', this.borderStyle), + e.setStyle('border-right', this.borderStyle)), + this.notation.madruwb && + (e.setStyle('border-bottom', this.borderStyle), + e.setStyle('border-right', this.borderStyle)), + this.notation.roundedbox && + (e.setStyle( + 'border-radius', + ($.height(e) + $.depth(e)) / 2, + 'em' + ), + e.setStyle('border', this.borderStyle)), + this.notation.circle && + (e.setStyle('border-radius', '50%'), + e.setStyle('border', this.borderStyle)), + this.notation.top && + e.setStyle('border-top', this.borderStyle), + this.notation.left && + e.setStyle('border-left', this.borderStyle), + this.notation.right && + e.setStyle('border-right', this.borderStyle), + this.notation.bottom && + e.setStyle('border-bottom', this.borderStyle), + this.notation.horizontalstrike && + ((s += ' 0 + ? i.setWidth(this.width) + : i.setStyle('margin-left', this.width, 'em'); + else { + const t = + { + qquad: 'qquad', + quad: 'quad', + enspace: 'enspace', + ';': 'thickspace', + ':': 'mediumspace', + ',': 'thinspace', + '!': 'negativethinspace', + }[this.body] || 'quad'; + i = Nt('​', 'mspace ' + t); + } + else + 'mathstyle' === this.type + ? t.setMathstyle(this.mathstyle) + : 'box' === this.type + ? (i = this.decomposeBox(t)) + : 'enclose' === this.type + ? (i = this.decomposeEnclose(t)) + : 'command' === this.type || 'error' === this.type + ? ((i = this.makeSpan(t, this.body)), + (i.classes = ''), + this.error && (i.classes += ' ML__error'), + this.suggestion && (i.classes += ' ML__suggestion')) + : 'placeholder' === this.type + ? (i = this.makeSpan(t, '⬚')) + : 'first' === this.type && (i = this.makeSpan(t, '​')); + if (!i) return i; + if ( + (this.caret && + 'styling' !== this.type && + 'msubsup' !== this.type && + 'command' !== this.type && + 'placeholder' !== this.type && + 'first' !== this.type && + (Array.isArray(i) + ? (i[i.length - 1].caret = this.caret) + : (i.caret = this.caret)), + !this.limits && (this.superscript || this.subscript)) + ) + if (Array.isArray(i)) { + const e = i[i.length - 1]; + i[i.length - 1] = this.attachSupsub(t, e, e.type); + } else i = [this.attachSupsub(t, i, i.type)]; + return Array.isArray(i) ? i : [i]; + } + attachSupsub(t, e, i) { + if (!this.superscript && !this.subscript) return e; + const s = t.mathstyle; + let a = null, + o = null; + if (this.superscript) { + const e = Qt(t.sup(), this.superscript); + a = Nt(e, s.adjustTo(s.sup())); + } + if (this.subscript) { + const e = Qt(t.sub(), this.subscript); + o = Nt(e, s.adjustTo(s.sub())); + } + let n, + r = 0, + l = 0; + this.isCharacterBox() || + ((r = $.height(e) - s.metrics.supDrop), + (l = $.depth(e) + s.metrics.subDrop)), + (n = + s === M.DISPLAY + ? s.metrics.sup1 + : s.cramped + ? s.metrics.sup3 + : s.metrics.sup2); + const c = M.TEXT.sizeMultiplier * s.sizeMultiplier, + d = 0.5 / h.ptPerEm / c; + let p = null; + if (o && a) { + (r = Math.max(r, n, a.depth + 0.25 * s.metrics.xHeight)), + (l = Math.max(l, s.metrics.sub2)); + const i = h.defaultRuleThickness; + if (r - $.depth(a) - ($.height(o) - l) < 4 * i) { + l = 4 * i - (r - a.depth) + $.height(o); + const t = 0.8 * s.metrics.xHeight - (r - $.depth(a)); + t > 0 && ((r += t), (l -= t)); + } + (p = Vt(t, [o, l, a, -r], 'individualShift')), + this.symbol && p.children[0].setLeft(-$.italic(e)); + } else + o && !a + ? ((l = Math.max( + l, + s.metrics.sub1, + $.height(o) - 0.8 * s.metrics.xHeight + )), + (p = Vt(t, [o], 'shift', l)), + p.children[0].setRight(d), + this.isCharacterBox() && + p.children[0].setLeft(-$.italic(e))) + : !o && + a && + ((r = Math.max( + r, + n, + a.depth + 0.25 * s.metrics.xHeight + )), + (p = Vt(t, [a], 'shift', -r)), + p.children[0].setRight(d)); + const m = Nt(p, 'msubsup'); + return ( + this.caret && (m.caret = this.caret), + $.makeSpanOfType(i, [e, m]) + ); + } + attachLimits(t, e, i, s) { + const a = this.superscript + ? Nt( + Qt(t.sup(), this.superscript), + t.mathstyle.adjustTo(t.mathstyle.sup()) + ) + : null, + o = this.subscript + ? Nt( + Qt(t.sub(), this.subscript), + t.mathstyle.adjustTo(t.mathstyle.sub()) + ) + : null; + return Yt(t, e, i, s, a, o, 'mop'); + } + bind(t, e) { + return ( + 'first' !== this.type && + '​' !== this.body && + ((this.id = (function(t) { + let e; + return ( + 'boolean' == typeof t.generateID && t.generateID + ? (e = + Date.now() + .toString(36) + .slice(-2) + + Math.floor( + 1e5 * Math.random() + ).toString(36)) + : 'object' == typeof t.generateID && + ((e = t.generateID.overrideID + ? t.generateID.overrideID + : t.generateID.seed.toString(36)), + (t.generateID.seed += 1)), + e + ); + })(t)), + this.id && + (e.attributes || (e.attributes = {}), + (e.attributes['data-atom-id'] = this.id))), + e + ); + } + makeSpan(t, e) { + const i = 'textord' === this.type ? 'mord' : this.type, + s = $.makeSpanOfType(i, e), + a = this.getStyle(); + s.applyStyle(a); + const o = a && a.fontSize ? a.fontSize : 'size5'; + return ( + o !== t.parentSize + ? ((s.classes += ' sizing reset-' + t.parentSize), + (s.classes += ' ' + o)) + : t.parentSize !== t.size && + ((s.classes += ' sizing reset-' + t.parentSize), + (s.classes += ' ' + t.size)), + (s.maxFontSize = Math.max( + s.maxFontSize, + t.sizeMultiplier || 1 + )), + 'text' === this.mode && (s.classes += ' ML__text'), + t.mathstyle.isTight() && (s.isTight = !0), + 'math' !== this.mode && (s.italic = 0), + s.setRight(s.italic), + 'number' == typeof t.opacity && + s.setStyle('opacity', t.opacity), + this.bind(t, s), + this.caret && + (this.superscript || + this.subscript || + ((s.caret = this.caret), + t.mathstyle.isTight() && (s.isTight = !0))), + s + ); + } + } + function Xt(t) { + const e = Nt('​', 'arraycolsep'); + return e.setWidth(t, 'em'), e; + } + function Jt(t, e, i, s) { + const a = []; + for (const o of e) { + const e = Nt(Qt(t, s)); + (e.depth = o.depth), + (e.height = o.height), + a.push(e), + a.push(o.pos - i); + } + return Vt(t, a, 'individualShift'); + } + function Yt(t, e, i, s, a, o, n) { + if (!a && !o) return e; + e = Nt(e); + let r = 0, + l = 0; + a && (r = Math.max(h.bigOpSpacing1, h.bigOpSpacing3 - a.depth)), + o && + (l = Math.max(h.bigOpSpacing2, h.bigOpSpacing4 - o.height)); + let c = null; + if (o && a) { + const n = + h.bigOpSpacing5 + + $.height(o) + + $.depth(o) + + l + + $.depth(e) + + i; + (c = Vt( + t, + [h.bigOpSpacing5, o, l, e, r, a, h.bigOpSpacing5], + 'bottom', + n + )), + c.children[0].setLeft(-s), + c.children[2].setLeft(s); + } else if (o && !a) { + const a = $.height(e) - i; + (c = Vt(t, [h.bigOpSpacing5, o, l, e], 'top', a)), + c.children[0].setLeft(-s); + } else if (!o && a) { + const o = $.depth(e) + i; + (c = Vt(t, [e, r, a, h.bigOpSpacing5], 'bottom', o)), + c.children[1].setLeft(s); + } + return $.makeSpanOfType(n, c, 'op-limits'); + } + function Qt(t, e) { + function i(t) { + return 'mord' === t.type && /[0-9,.]/.test(t.latex); + } + function s(t) { + return 'text' === t.mode; + } + t instanceof _ || (t = new _(t)); + const a = !t.generateID || !t.generateID.groupNumbers; + let o = []; + if (Array.isArray(e)) { + if (0 === e.length) return o; + if (1 === e.length) + (o = e[0].decompose(t)), + o && + a && + e[0].isSelected && + o.forEach(t => t.selected(!0)); + else { + let n = 'none', + r = e[1].type, + l = [], + c = null, + h = !0, + d = null; + for (let p = 0; p < e.length; p++) { + 'mbin' === e[p].type && + (/first|none|mrel|mpunct|mopen|mbin|mop/.test(n) || + /none|mrel|mpunct|mclose/.test(r)) && + (e[p].type = 'mord'), + ('​' === e[p].body && + (e[p].superscript || e[p].subscript)) || + (d = null), + t.generateID.groupNumbers && + c && + ((h && i(e[p])) || (!h && s(e[p]))) && + (t.generateID.overrideID = c); + const m = e[p].decompose(t, d); + if ( + (t.generateID && (t.generateID.overrideID = null), + m) + ) { + const n = [].concat.apply([], m); + (d = n), + t.generateID && + t.generateID.groupNumbers && + ((i(e[p]) || s(e[p])) && + ((c && h === i(e[p])) || + ((h = i(e[p])), (c = e[p].id))), + ((!i(e[p]) && !s(e[p])) || + e[p].superscript || + e[p].subscript) && + c && + (c = null)), + a && e[p].isSelected + ? ((l = l.concat(n)), + l.forEach(t => t.selected(!0))) + : (l.length > 0 && + ((o = [...o, ...l]), (l = [])), + (o = o.concat(n))); + } + (n = e[p].getFinalBaseElement().type), + (r = e[p + 1] + ? e[p + 1].getInitialBaseElement().type + : 'none'); + } + l.length > 0 && ((o = [...o, ...l]), (l = [])); + } + } else + e && + ((o = e.decompose(t)), + o && a && e.isSelected && o.forEach(t => t.selected(!0))); + if (!o || 0 === o.length) return null; + if (t.mathstyle !== t.parentMathstyle) { + const e = + t.mathstyle.sizeMultiplier / + t.parentMathstyle.sizeMultiplier; + for (const t of o) (t.height *= e), (t.depth *= e); + } + if (t.size !== t.parentSize) { + const e = Gt[t.size] / Gt[t.parentSize]; + for (const t of o) (t.height *= e), (t.depth *= e); + } + return o; + } + var te = { + MathAtom: Zt, + decompose: Qt, + makeRoot: function(t, e) { + const i = new Zt((t = t || 'math'), 'root', e || []); + return ( + (0 !== i.body.length && 'first' === i.body[0].type) || + i.body.unshift(new Zt('', 'first')), + i + ); + }, + GREEK_REGEX: Ut, + }; + const ee = { + m0: '#3f3d99', + m1: '#993d71', + m2: '#998b3d', + m3: '#3d9956', + m4: '#3d5a99', + m5: '#993d90', + m6: '#996d3d', + m7: '#43993d', + m8: '#3d7999', + m9: '#843d99', + }, + ie = { + apricot: '#FBB982', + aquamarine: '#00B5BE', + bittersweet: '#C04F17', + black: '#221E1F', + blue: '#2D2F92', + bluegreen: '#00B3B8', + blueviolet: '#473992', + brickred: '#B6321C', + brown: '#792500', + burntorange: '#F7921D', + cadetblue: '#74729A', + carnationpink: '#F282B4', + cerulean: '#00A2E3', + cornflowerblue: '#41B0E4', + cyan: '#00AEEF', + dandelion: '#FDBC42', + darkorchid: '#A4538A', + emerald: '#00A99D', + forestgreen: '#009B55', + fuchsia: '#8C368C', + goldenrod: '#FFDF42', + gray: '#949698', + green: '#00A64F', + greenyellow: '#DFE674', + junglegreen: '#00A99A', + lavender: '#F49EC4', + limegreen: '#8DC73E', + magenta: '#EC008C', + mahogany: '#A9341F', + maroon: '#AF3235', + melon: '#F89E7B', + midnightblue: '#006795', + mulberry: '#A93C93', + navyblue: '#006EB8', + olivegreen: '#3C8031', + orange: '#F58137', + orangered: '#ED135A', + orchid: '#AF72B0', + peach: '#F7965A', + periwinkle: '#7977B8', + pinegreen: '#008B72', + plum: '#92268F', + processblue: '#00B0F0', + purple: '#99479B', + rawsienna: '#974006', + red: '#ED1B23', + redorange: '#F26035', + redviolet: '#A1246B', + rhodamine: '#EF559F', + royalblue: '#0071BC', + royalpurple: '#613F99', + rubinered: '#ED017D', + salmon: '#F69289', + seagreen: '#3FBC9D', + sepia: '#671800', + skyblue: '#46C5DD', + springgreen: '#C6DC67', + tan: '#DA9D76', + tealblue: '#00AEB3', + thistle: '#D883B7', + turquoise: '#00B4CE', + violet: '#58429B', + violetred: '#EF58A0', + white: '#FFFFFF', + wildstrawberry: '#EE2967', + yellow: '#FFF200', + yellowgreen: '#98CC70', + yelloworange: '#FAA21A', + }; + var se = function(t) { + const e = t.toLowerCase().split('!'); + let i, + s, + a, + o = 255, + n = 255, + r = 255, + l = -1; + const c = e.length > 0 && '-' === e[0].charAt(0); + c && (e[0] = e[0].slice(1)); + for (let t = 0; t < e.length; t++) { + (i = o), (s = n), (a = r); + let c = e[t].match(/([a-z0-9]*)/); + c && (c = c[1]); + let h = ie[c] || ee[c]; + h || (h = e[t]); + let d = h.match( + /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i + ); + if (d && d[1] && d[2] && d[3]) + (o = Math.max(0, Math.min(255, parseInt(d[1], 16)))), + (n = Math.max( + 0, + Math.min(255, parseInt(d[2], 16)) + )), + (r = Math.max( + 0, + Math.min(255, parseInt(d[3], 16)) + )); + else if (((d = h.match(/^#([0-9a-f]{3})$/i)), d && d[1])) { + const t = parseInt(d[1][0], 16), + e = parseInt(d[1][1], 16), + i = parseInt(d[1][2], 16); + (o = Math.max(0, Math.min(255, 16 * t + t))), + (n = Math.max(0, Math.min(255, 16 * e + e))), + (r = Math.max(0, Math.min(255, 16 * i + i))); + } else { + if ( + ((d = h.match( + /^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i + )), + !(d && d[1] && d[2] && d[3])) + ) + return null; + (o = Math.max(0, Math.min(255, parseInt(d[1])))), + (n = Math.max(0, Math.min(255, parseInt(d[2])))), + (r = Math.max(0, Math.min(255, parseInt(d[3])))); + } + l >= 0 && + ((o = (1 - l) * o + l * i), + (n = (1 - l) * n + l * s), + (r = (1 - l) * r + l * a), + (l = -1)), + t + 1 < e.length && + (l = + Math.max(0, Math.min(100, parseInt(e[++t]))) / + 100); + } + return ( + l >= 0 && + ((o = l * o + (1 - l) * i), + (n = l * n + (1 - l) * s), + (r = l * r + (1 - l) * a)), + c && ((o = 255 - o), (n = 255 - n), (r = 255 - r)), + '#' + + ('00' + Math.round(o).toString(16)).slice(-2) + + ('00' + Math.round(n).toString(16)).slice(-2) + + ('00' + Math.round(r).toString(16)).slice(-2) + ); + }, + ae = function(t) { + let e = t.toUpperCase(); + for (const t in ie) + if (ie[t] === e) { + e = t; + break; + } + for (const t in ee) + if (ee[t] === e) { + e = t; + break; + } + return e; + }, + oe = [ + '#d35d60', + '#7293cb', + '#e1974d', + '#84bb5d', + '#9066a7', + '#aD6a58', + '#f5a4ce', + '#fff590', + '#212121', + '#818787', + '#d4d5d2', + '#ffffff', + ], + ne = [ + '#cc2428', + '#3769b1', + '#da7e30', + '#409852', + '#6b4c9a', + '#922426', + '#e7298a', + '#ffe907', + '#000000', + '#525055', + '#adafaa', + '#ffffff', + ]; + const re = te.MathAtom; + class le { + constructor(t, e, i) { + (this.tokens = t), + (this.index = 0), + (this.args = e), + (this.macros = i), + (this.mathList = []), + (this.style = {}), + (this.parseMode = 'math'), + (this.tabularMode = !1), + (this.endCount = 0); + } + swapMathList(t) { + const e = this.mathList; + return (this.mathList = t || []), e; + } + swapParseMode(t) { + const e = this.parseMode; + return (this.parseMode = t), e; + } + end() { + return ( + this.endCount++, + this.index >= this.tokens.length || this.endCount > 1e3 + ); + } + get() { + return ( + (this.endCount = 0), + this.index < this.tokens.length + ? this.tokens[this.index++] + : null + ); + } + peek(t) { + const e = this.index + (t || 0); + return e < this.tokens.length ? this.tokens[e] : null; + } + lastMathAtom() { + const t = + 0 === this.mathList.length + ? 'none' + : this.mathList[this.mathList.length - 1].type; + if ('mop' !== t && 'msubsup' !== t) { + const t = new re(this.parseMode, 'msubsup', '​'); + (t.attributes = { 'aria-hidden': !0 }), + this.mathList.push(t); + } + return this.mathList[this.mathList.length - 1]; + } + hasToken(t) { + const e = this.index; + return e < this.tokens.length && this.tokens[e].type === t; + } + hasLiteral(t) { + const e = this.index; + return ( + e < this.tokens.length && + 'literal' === this.tokens[e].type && + (!t || this.tokens[e].value === t) + ); + } + hasLiteralPattern(t) { + return ( + this.hasToken('literal') && + t.test(this.tokens[this.index].value) + ); + } + hasCommand(t) { + const e = this.index; + return ( + e < this.tokens.length && + 'command' === this.tokens[e].type && + this.tokens[e].value === t + ); + } + hasInfixCommand() { + const t = this.index; + if ( + t < this.tokens.length && + 'command' === this.tokens[t].type + ) { + const e = At.getInfo( + '\\' + this.tokens[t].value, + this.parseMode, + this.macros + ); + return e && e.infix; + } + return !1; + } + hasColumnSeparator() { + const t = this.index; + return ( + !!(this.tabularMode && t < this.tokens.length) && + 'literal' === this.tokens[t].type && + '&' === this.tokens[t].value + ); + } + hasRowSeparator() { + const t = this.index; + return ( + !!(this.tabularMode && t < this.tokens.length) && + 'command' === this.tokens[t].type && + ('\\' === this.tokens[t].value || + 'cr' === this.tokens[t].value) + ); + } + parseColumnSeparator() { + return !!this.hasColumnSeparator() && (this.index++, !0); + } + placeholder() { + if (this.args && 'string' == typeof this.args['?']) + return ce( + n(this.args['?']), + this.parseMode, + null, + this.macros + ); + const t = new re( + this.parseMode, + 'placeholder', + '?', + this.style + ); + return (t.captureSelection = !0), [t]; + } + hasImplicitCommand(t) { + if (this.index < this.tokens.length) { + const e = this.tokens[this.index]; + if ('command' === e.type) return t.includes(e.value); + } + return !1; + } + parseRowSeparator() { + return !!this.hasRowSeparator() && (this.index++, !0); + } + parseToken(t) { + return !!this.hasToken(t) && (this.index++, !0); + } + skipWhitespace() { + let t = !1; + for (; this.hasToken('space'); ) this.index++, (t = !0); + return t; + } + skipUntilToken(t) { + for (; !this.end() && !this.parseToken(t); ) this.get(); + } + parseCommand(t) { + return !!this.hasCommand(t) && (this.index++, !0); + } + parseLiteral(t) { + return !!this.hasLiteral(t) && (this.index++, !0); + } + parseFiller() { + let t = !1, + e = !1; + do { + const i = this.skipWhitespace(), + s = this.parseCommand('relax'); + (t = t || i || s), (e = !i && !s); + } while (!e); + return t; + } + parseKeyword(t) { + const e = this.index; + let i = this.end(), + s = ''; + for (; !i; ) { + const e = this.get(); + 'literal' === e.type && (s += e.value), + (i = + this.end() || + 'literal' !== e.type || + s.length >= t.length); + } + const a = t.toUpperCase() === s.toUpperCase(); + return a || (this.index = e), a; + } + scanString() { + let t = '', + e = this.end(); + for (; !e; ) { + if (this.hasLiteral(']')) e = !0; + else if (this.hasToken('literal')) t += this.get().value; + else if (this.skipWhitespace()) t += ' '; + else if (this.hasToken('command')) { + const e = this.get(); + 'space' === e.value ? (t += ' ') : (t += e.value); + } else e = !0; + e = e || this.end(); + } + return t; + } + scanColor() { + return se(this.scanString()); + } + scanNumber(t) { + const e = this.parseLiteral('-'); + e || this.parseLiteral('+'), this.skipWhitespace(), (t = !!t); + let i = 10, + s = /[0-9]/; + this.parseLiteral("'") + ? ((i = 8), (s = /[0-7]/), (t = !0)) + : (this.parseLiteral('"') || this.parseLiteral('x')) && + ((i = 16), (s = /[0-9A-F]/), (t = !0)); + let a = ''; + for (; this.hasLiteralPattern(s); ) a += this.get().value; + if (!t && (this.parseLiteral('.') || this.parseLiteral(','))) + for (a += '.'; this.hasLiteralPattern(s); ) + a += this.get().value; + const o = t ? parseInt(a, i) : parseFloat(a); + return e ? -o : o; + } + scanDimen() { + const t = this.scanNumber(!1); + let e; + return ( + this.skipWhitespace(), + (e = this.parseKeyword('pt') + ? m.toEm(t, 'pt') + : this.parseKeyword('mm') + ? m.toEm(t, 'mm') + : this.parseKeyword('cm') + ? m.toEm(t, 'cm') + : this.parseKeyword('ex') + ? m.toEm(t, 'ex') + : this.parseKeyword('px') + ? m.toEm(t, 'px') + : this.parseKeyword('em') + ? m.toEm(t, 'em') + : this.parseKeyword('bp') + ? m.toEm(t, 'bp') + : this.parseKeyword('dd') + ? m.toEm(t, 'dd') + : this.parseKeyword('pc') + ? m.toEm(t, 'pc') + : this.parseKeyword('in') + ? m.toEm(t, 'in') + : this.parseKeyword('mu') + ? m.toEm(t, 'mu') + : m.toEm(t, 'pt')), + e + ); + } + scanSkip() { + const t = this.scanDimen(); + return ( + this.skipWhitespace(), + this.parseKeyword('plus') && this.scanDimen(), + this.skipWhitespace(), + this.parseKeyword('minus') && this.scanDimen(), + t + ); + } + scanColspec() { + this.skipWhitespace(); + const t = []; + for ( + ; + !this.end() && !this.hasToken('}') && !this.hasLiteral(']'); + + ) + if (this.hasLiteral()) { + const e = this.get().value; + if ('lcr'.includes(e)) t.push({ align: e }); + else if ('|' === e) t.push({ rule: !0 }); + else if ('@' === e) { + if (this.parseToken('{')) { + const e = this.swapParseMode('math'); + t.push({ + gap: this.scanImplicitGroup( + t => '}' === t.type + ), + }), + this.swapParseMode(e); + } + this.parseToken('}'); + } + } + return t; + } + scanModeSet() { + let t; + if ( + (this.parseCommand('(') && (t = ')'), + !t && this.parseCommand('[') && (t = ']'), + !t) + ) + return null; + const e = this.swapParseMode('math'), + i = new re('math', 'group'); + return ( + (i.mathstyle = ')' === t ? 'textstyle' : 'displaystyle'), + (i.body = this.scanImplicitGroup( + e => 'command' === e.type && e.value === t + )), + this.parseCommand(t), + this.swapParseMode(e), + i.body && 0 !== i.body.length ? i : null + ); + } + scanModeShift() { + if (!this.hasToken('$') && !this.hasToken('$$')) return null; + const t = this.get().type, + e = new re('math', 'group'); + (e.mathstyle = '$' === t ? 'textstyle' : 'displaystyle'), + (e.latexOpen = 'textstyle' === e.mathstyle ? '$' : '$$'), + (e.latexClose = e.latexOpen); + const i = this.swapParseMode('math'); + return ( + (e.body = this.scanImplicitGroup(e => e.type === t)), + this.parseToken(t), + this.swapParseMode(i), + e.body && 0 !== e.body.length ? e : null + ); + } + scanEnvironment() { + if (!this.parseCommand('begin')) return null; + const t = this.scanArg('string'), + e = At.getEnvironmentInfo(t), + i = []; + if (e && e.params) + for (const t of e.params) + if (t.optional) { + const e = this.scanOptionalArg(t.type); + i.push(e); + } else i.push(this.scanArg(t.type)); + const s = this.parseMode, + a = this.tabularMode, + o = this.swapMathList([]); + this.tabularMode = e.tabular; + const n = [], + r = []; + let l = [], + c = !1; + do { + if ( + ((c = this.end()), + !c && + this.parseCommand('end') && + (c = this.scanArg('string') === t), + !c) + ) + if (this.parseColumnSeparator()) + l.push(this.swapMathList([])); + else if (this.parseRowSeparator()) { + l.push(this.swapMathList([])); + let t = 0; + this.skipWhitespace(), + this.parseLiteral('[') && + ((t = this.scanDimen()), + this.skipWhitespace(), + this.parseLiteral(']')), + r.push(t || 0), + n.push(l), + (l = []); + } else + this.mathList = this.mathList.concat( + this.scanImplicitGroup() + ); + } while (!c); + l.push(this.swapMathList([])), l.length > 0 && n.push(l); + const h = this.swapMathList(o); + if ( + ((this.parseMode = s), + (this.tabularMode = a), + !e.tabular && 0 === h.length) + ) + return null; + if (e.tabular && 0 === n.length) return null; + const d = new re( + this.parseMode, + 'array', + h, + e.parser ? e.parser(t, i, n) : {} + ); + return ( + (d.array = n), + (d.rowGaps = r), + (d.env = { ...e }), + (d.env.name = t), + d + ); + } + scanImplicitGroup(t) { + const e = this.style; + t || + (t = t => + '}' === t.type || + ('literal' === t.type && '&' === t.value) || + ('command' === t.type && + /^(end|cr|\\)$/.test(t.value))); + let i = null, + s = null; + const a = this.swapMathList([]); + for (; !this.end() && !t(this.peek()); ) + if ( + this.hasImplicitCommand([ + 'displaystyle', + 'textstyle', + 'scriptstyle', + 'scriptscriptstyle', + ]) + ) { + this.parseMode = 'math'; + const t = new re('math', 'mathstyle'); + (t.mathstyle = this.get().value), this.mathList.push(t); + } else + this.hasInfixCommand() && !i + ? ((i = this.get()), (s = this.swapMathList([]))) + : this.parseAtom(); + let o; + if (i) { + const t = this.swapMathList(a), + e = At.getInfo('\\' + i.value, 'math', this.macros); + o = e + ? [ + new re( + this.parseMode, + e.type, + e.value || i.value, + e.parse + ? e.parse('\\' + i.value, [s, t]) + : null + ), + ] + : [new re(this.parseMode, 'mop', i.value)]; + } else o = this.swapMathList(a); + return (this.style = e), o; + } + scanGroup() { + if (!this.parseToken('{')) return null; + const t = new re(this.parseMode, 'group'); + return ( + (t.body = this.scanImplicitGroup(t => '}' === t.type)), + this.parseToken('}'), + (t.latexOpen = '{'), + (t.latexClose = '}'), + t + ); + } + scanSmartFence() { + if ((this.skipWhitespace(), !this.parseLiteral('('))) + return null; + const t = new re(this.parseMode, 'leftright'); + (t.leftDelim = '('), (t.inner = !1); + const e = this.swapMathList([]); + let i = 1; + for (; !this.end() && 0 !== i; ) + this.hasLiteral('(') && (i += 1), + this.hasLiteral(')') && (i -= 1), + 0 !== i && this.parseAtom(); + return ( + 0 === i && this.parseLiteral(')'), + (t.rightDelim = 0 === i ? ')' : '?'), + (t.body = this.swapMathList(e)), + t + ); + } + scanDelim() { + this.skipWhitespace(); + const t = this.get(); + if (!t) return null; + let e = '.'; + 'command' === t.type + ? (e = '\\' + t.value) + : 'literal' === t.type && (e = t.value); + const i = At.getInfo(e, 'math', this.macros); + return i + ? 'mopen' === i.type || 'mclose' === i.type + ? e + : /^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test( + e + ) + ? e + : null + : null; + } + scanLeftRight() { + if (this.parseCommand('right') || this.parseCommand('mright')) + return null; + const t = this.style; + let e = 'right'; + if (!this.parseCommand('left')) { + if (!this.parseCommand('mleft')) return null; + e = 'mright'; + } + const i = this.scanDelim(); + if (!i) return null; + const s = this.swapMathList([]); + for (; !this.end() && !this.parseCommand(e); ) this.parseAtom(); + this.style = t; + const a = this.scanDelim(), + o = new re(this.parseMode, 'leftright'); + return ( + (o.leftDelim = i), + (o.rightDelim = a), + (o.inner = 'right' === e), + (o.body = this.swapMathList(s)), + o + ); + } + parseSupSub() { + if ('math' !== this.parseMode) return !1; + let t = !1; + for ( + ; + this.hasLiteral('^') || + this.hasLiteral('_') || + this.hasLiteral("'"); + + ) { + let e; + if ( + (this.hasLiteral('^') + ? (e = 'superscript') + : this.hasLiteral('_') && (e = 'subscript'), + this.parseLiteral('^') || this.parseLiteral('_')) + ) { + const i = this.scanArg(); + if (i) { + const s = this.lastMathAtom(); + (s[e] = s[e] || []), + (s[e] = s[e].concat(i)), + (t = !0); + } + } else if (this.parseLiteral("'")) { + const e = this.lastMathAtom(); + (e.superscript = e.superscript || []), + e.superscript.push( + new re(e.parseMode, 'mord', '′') + ), + (t = !0); + } + } + return t; + } + parseLimits() { + if (this.parseCommand('limits')) { + const t = this.lastMathAtom(); + return (t.limits = 'limits'), (t.explicitLimits = !0), !0; + } + if (this.parseCommand('nolimits')) { + const t = this.lastMathAtom(); + return (t.limits = 'nolimits'), (t.explicitLimits = !0), !0; + } + return !1; + } + scanOptionalArg(t) { + if ( + ((t = t && 'auto' !== t ? t : this.parseMode), + this.skipWhitespace(), + !this.parseLiteral('[')) + ) + return null; + const e = this.parseMode; + this.parseMode = t; + const i = this.swapMathList(); + let s; + for (; !this.end() && !this.parseLiteral(']'); ) + if ('string' === t) s = this.scanString(); + else if ('number' === t) s = this.scanNumber(); + else if ('dimen' === t) s = this.scanDimen(); + else if ('skip' === t) s = this.scanSkip(); + else if ('colspec' === t) s = this.scanColspec(); + else if ('color' === t) s = this.scanColor() || '#ffffff'; + else if ('bbox' === t) { + const t = this.scanString() + .toLowerCase() + .trim() + .split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/); + for (const e of t) { + const t = se(e); + if (t) (s = s || {}), (s.backgroundcolor = t); + else { + const t = e.match( + /^\s*([0-9.]+)\s*([a-z][a-z])/ + ); + if (t) + (s = s || {}), + (s.padding = m.toEm(t[1], t[2])); + else { + const t = e.match(/^\s*border\s*:\s*(.*)/); + t && ((s = s || {}), (s.border = t[1])); + } + } + } + } else + this.mathList = this.mathList.concat( + this.scanImplicitGroup( + t => 'literal' === t.type && ']' === t.value + ) + ); + this.parseMode = e; + const a = this.swapMathList(i); + return s || a; + } + scanArg(t) { + let e; + if ( + ((t = t && 'auto' !== t ? t : this.parseMode), + this.parseFiller(), + !this.parseToken('{')) + ) { + if ('delim' === t) return this.scanDelim() || '.'; + if (/^(math|text)$/.test(t)) { + const e = this.parseMode; + this.parseMode = t; + const i = this.scanToken(); + return ( + (this.parseMode = e), + Array.isArray(i) ? i : i ? [i] : null + ); + } + } + if (this.hasToken('#')) { + const t = this.get(); + return ( + this.skipUntilToken('}'), + '?' === t.value + ? this.placeholder() + : this.args + ? void 0 === this.args[t.value] && + void 0 !== this.args['?'] + ? this.placeholder() + : this.args[t.value] || null + : null + ); + } + const i = this.parseMode; + this.parseMode = t; + const s = this.swapMathList([]); + if ('string' === t) + (e = this.scanString()), this.skipUntilToken('}'); + else if ('number' === t) + (e = this.scanNumber()), this.skipUntilToken('}'); + else if ('dimen' === t) + (e = this.scanDimen()), this.skipUntilToken('}'); + else if ('skip' === t) + (e = this.scanSkip()), this.skipUntilToken('}'); + else if ('colspec' === t) + (e = this.scanColspec()), this.skipUntilToken('}'); + else if ('color' === t) + (e = this.scanColor() || '#ffffff'), + this.skipUntilToken('}'); + else if ('delim' === t) + (e = this.scanDelim() || '.'), this.skipUntilToken('}'); + else + do { + this.mathList = this.mathList.concat( + this.scanImplicitGroup() + ); + } while (!this.parseToken('}') && !this.end()); + this.parseMode = i; + const a = this.swapMathList(s); + return e || a; + } + scanToken() { + const t = this.get(); + if (!t) return null; + let e = null; + if ('space' === t.type) + 'text' === this.parseMode && + (e = new re('text', '', ' ', this.style)); + else if ('placeholder' === t.type) + (e = new re(this.parseMode, 'placeholder', t.value)), + (e.captureSelection = !0); + else if ('command' === t.type) { + if ('placeholder' === t.value) + (e = new re( + this.parseMode, + 'placeholder', + this.scanArg('string'), + this.style + )), + (e.captureSelection = !0); + else if ('char' === t.value) { + let t = Math.floor(this.scanNumber(!0)); + (!isFinite(t) || t < 0 || t > 1114111) && (t = 10067), + (e = new re( + this.parseMode, + 'math' === this.parseMode ? 'mord' : '', + String.fromCodePoint(t) + )), + (e.latex = + '{\\char"' + + ('000000' + t.toString(16)) + .toUpperCase() + .substr(-6) + + '}'); + } else if ('hskip' === t.value || 'kern' === t.value) { + const i = this.scanSkip(); + isFinite(i) && + ((e = new re( + this.parseMode, + 'spacing', + null, + this.style + )), + (e.width = i)), + (e.latex = '\\' + t.value); + } else if (((e = this.scanMacro(t.value)), !e)) { + const i = At.getInfo( + '\\' + t.value, + this.parseMode, + this.macros + ), + s = []; + let a = '', + o = ''; + if (i && i.params) + for (const t of i.params) + if (t.optional) { + const e = this.scanOptionalArg(t.type); + s.push(e); + } else if (t.type.endsWith('*')) + o = t.type.slice(0, -1); + else { + const e = this.scanArg(t.type); + if ( + (e && + 1 === e.length && + 'placeholder' === e[0].type && + t.placeholder && + (e[0].value = t.placeholder), + e) + ) + s.push(e); + else if (t.placeholder) { + const e = new re( + this.parseMode, + 'placeholder', + t.placeholder + ); + (e.captureSelection = !0), s.push([e]); + } else s.push(this.placeholder()); + 'math' !== t.type && + 'string' == typeof e && + (a += e); + } + if (i && !i.infix) { + if (i.parse) { + const a = i.parse('\\' + t.value, s); + if (a.type) + e = new re( + this.parseMode, + i.type, + o ? this.scanArg(o) : null, + { ...this.style, ...a } + ); + else { + const t = this.parseMode; + if ( + (a.mode && + ((this.parseMode = a.mode), + delete a.mode), + o) + ) { + const t = this.style; + (this.style = { ...this.style, ...a }), + (e = this.scanArg(o)), + (this.style = t); + } else this.style = { ...this.style, ...a }; + this.parseMode = t; + } + } else { + const s = { ...this.style }; + i.baseFontFamily && + (s.baseFontFamily = i.baseFontFamily), + (e = new re( + this.parseMode, + i.type || 'mop', + i.value || t.value, + s + )), + i.skipBoundary && (e.skipBoundary = !0); + } + if ( + e && + !/^(llap|rlap|class|cssId)$/.test(t.value) && + ((e.latex = '\\' + t.value), + a && (e.latex += '{' + a + '}'), + e.isFunction && this.smartFence) + ) { + const t = this.scanSmartFence(); + t && (e = [e, t]); + } + } + i || + ((e = new re( + this.parseMode, + 'error', + '\\' + t.value + )), + (e.latex = '\\' + t.value)); + } + } else if ('literal' === t.type) { + const i = At.getInfo(t.value, this.parseMode, this.macros); + if (i) { + const s = { ...this.style }; + i.baseFontFamily && + (s.baseFontFamily = i.baseFontFamily), + (e = new re( + this.parseMode, + i.type, + i.value || t.value, + s + )), + i.isFunction && (e.isFunction = !0); + } else + e = new re( + this.parseMode, + 'math' === this.parseMode ? 'mord' : '', + t.value, + this.style + ); + if ( + ((e.latex = At.matchCodepoint( + this.parseMode, + t.value.codePointAt(0) + )), + i && i.isFunction && this.smartFence) + ) { + const t = this.scanSmartFence(); + t && (e = [e, t]); + } + } else if ('#' === t.type) + if ('?' === t.value) e = this.placeholder(); + else if (this.args) + if ( + ((e = this.args[t.value] || null), + Array.isArray(e) && 1 === e.length) + ) + e = e[0]; + else if (Array.isArray(e)) { + const t = new re(this.parseMode, 'group'); + (t.body = e), (e = t); + } else e = this.placeholder(); + return e; + } + scanMacro(t) { + if (!this.macros || !this.macros[t]) return null; + const e = {}; + let i, + s = 0; + 'string' == typeof this.macros[t] + ? ((i = this.macros[t]), + /(^|[^\\])#1/.test(i) && (s = 1), + /(^|[^\\])#2/.test(i) && (s = 2), + /(^|[^\\])#3/.test(i) && (s = 3), + /(^|[^\\])#4/.test(i) && (s = 4), + /(^|[^\\])#5/.test(i) && (s = 5), + /(^|[^\\])#6/.test(i) && (s = 6), + /(^|[^\\])#7/.test(i) && (s = 7), + /(^|[^\\])#8/.test(i) && (s = 8), + /(^|[^\\])#9/.test(i) && (s = 9)) + : ((i = this.macros[t].def), + (s = this.macros[t].args || 0)); + for (let t = 1; t <= s; t++) e[t] = this.scanArg(); + this.args && + 'string' == typeof this.args['?'] && + (e['?'] = this.args['?']); + const a = new re( + this.parseMode, + 'group', + ce(n(i), this.parseMode, e, this.macros) + ); + (a.captureSelection = !0), (a.latex = '\\' + t); + let o = ''; + for (let t = 1; t <= s; t++) { + if (((o += '{'), Array.isArray(e[t]))) + for (let i = 0; i < e[t].length; i++) + o += e[t][i].latex; + o += '}'; + } + return (a.latex += o || ''), a; + } + parseAtom() { + let t = + this.scanEnvironment() || + this.scanModeShift() || + this.scanModeSet() || + this.scanGroup() || + this.scanLeftRight(); + return ( + !(t || (!this.parseSupSub() && !this.parseLimits())) || + (t || (t = this.scanToken()), + Array.isArray(t) + ? (this.mathList = this.mathList.concat(t)) + : t && this.mathList.push(t), + null !== t) + ); + } + } + function ce(t, e, i, s, a) { + let o = []; + const n = new le(t, i, s); + for ( + n.parseMode = e || 'math', a && (n.smartFence = !0); + !n.end(); + + ) + o = o.concat(n.scanImplicitGroup()); + return o; + } + var he = { Parser: le, parseTokens: ce }; + function de(t, e) { + let i = ''; + for (const e of t) i += e.relation + ':' + e.offset + '/'; + return e && (i += '#' + e), i; + } + function pe(t) { + const e = { path: [], extent: 0 }, + i = t.split('#'); + i.length > 1 && (e.extent = parseInt(i[1])); + const s = i[0].split('/'); + for (const t of s) { + const i = t.match(/([^:]*):(.*)/); + i && e.path.push({ relation: i[1], offset: parseInt(i[2]) }); + } + return e; + } + var me = { + pathFromString: pe, + pathToString: de, + pathDistance: function(t, e) { + let i = 0, + s = -1, + a = !1; + for (; !a; ) + (s += 1), + (a = s >= t.length || s >= e.length), + (a = + a || + !( + t[s].relation === e[s].relation && + t[s].offset === e[s].offset + )); + return ( + (i = + s === t.length && s === e.length + ? 0 + : s + 1 === t.length && + s + 1 === e.length && + t[s].relation === e[s].relation + ? 1 + : 2), + i + ); + }, + pathCommonAncestor: function(t, e) { + const i = [], + s = Math.min(t.length - 1, e.length - 1); + let a = 0; + for ( + ; + a <= s && + t[a].relation === e[a].relation && + t[a].offset === e[a].offset; + + ) + i.push(t[a]), (a += 1); + return i; + }, + clone: function(t) { + return pe(de(t)).path; + }, + }; + const ue = { + Left: 'moveToPreviousChar', + Right: 'moveToNextChar', + Up: 'moveUp', + Down: 'moveDown', + 'Shift-Left': 'extendToPreviousChar', + 'Shift-Right': 'extendToNextChar', + 'Shift-Up': 'extendUp', + 'Shift-Down': 'extendDown', + Backspace: 'deletePreviousChar', + 'Alt-Del': 'deletePreviousChar', + Del: 'deleteNextChar', + 'Alt-Backspace': 'deleteNextChar', + 'Alt-Left': 'moveToPreviousWord', + 'Alt-Right': 'moveToNextWord', + 'Alt-Shift-Left': 'extendToPreviousWord', + 'Alt-Shift-Right': 'extendToNextWord', + 'Ctrl-Left': 'moveToGroupStart', + 'Ctrl-Right': 'moveToGroupEnd', + 'Ctrl-Shift-Left': 'extendToGroupStart', + 'Ctrl-Shift-Right': 'extendToGroupEnd', + 'math:Spacebar': 'moveAfterParent', + 'math:Shift-Spacebar': 'moveBeforeParent', + Home: 'moveToMathFieldStart', + 'mac:Meta-Left': 'moveToMathFieldStart', + 'Shift-Home': 'extendToMathFieldStart', + 'mac:Meta-Shift-Left': 'extendToMathFieldStart', + End: 'moveToMathFieldEnd', + 'mac:Meta-Right': 'moveToMathFieldEnd', + 'Shift-End': 'extendToMathFieldEnd', + 'mac:Meta-Shift-Right': 'extendToMathFieldEnd', + PageUp: 'moveToGroupStart', + PageDown: 'moveToGroupEnd', + 'math:Tab': 'moveToNextPlaceholder', + 'math:F8': 'moveToNextPlaceholder', + 'math:Shift-Tab': 'moveToPreviousPlaceholder', + 'math:Shift-F8': 'moveToPreviousPlaceholder', + 'text:Tab': 'moveToNextPlaceholder', + 'text:F8': 'moveToNextPlaceholder', + 'text:Shift-Tab': 'moveToPreviousPlaceholder', + 'text:Shift-F8': 'moveToPreviousPlaceholder', + 'math:Esc': ['switch-mode', 'command'], + 'math:Backslash': ['switch-mode', 'command'], + 'math:IntlBackslash': ['switch-mode', 'command'], + 'math:Alt-Equal': ['apply-style', { mode: 'text' }], + 'text:Alt-Equal': ['apply-style', { mode: 'math' }], + 'command:Esc': ['complete', { discard: !0 }], + 'command:Tab': ['complete', { acceptSuggestion: !0 }], + 'command:Return': 'complete', + 'command:Enter': 'complete', + 'command:Shift-Esc': ['complete', { discard: !0 }], + 'command:Down': 'nextSuggestion', + 'ios:command:Tab': 'nextSuggestion', + 'command:Up': 'previousSuggestion', + '!mac:Ctrl-KeyA': 'selectAll', + 'mac:Meta-KeyA': 'selectAll', + Cut: 'cut', + Copy: 'copy', + Paste: 'paste', + Clear: 'delete', + '!mac:Ctrl-KeyZ': 'undo', + 'mac:Meta-KeyZ': 'undo', + Undo: 'undo', + '!mac:Ctrl-KeyY': 'redo', + 'mac:Meta-Shift-KeyY': 'redo', + '!mac:Ctrl-Shift-KeyZ': 'redo', + 'mac:Meta-Shift-KeyZ': 'redo', + Redo: 'redo', + EraseEof: 'deleteToGroupEnd', + 'mac:Ctrl-KeyB': 'moveToPreviousChar', + 'mac:Ctrl-KeyF': 'moveToNextChar', + 'mac:Ctrl-KeyP': 'moveUp', + 'mac:Ctrl-KeyN': 'moveDown', + 'mac:Ctrl-KeyA': 'moveToMathFieldStart', + 'mac:Ctrl-KeyE': 'moveToMathFieldEnd', + 'mac:Ctrl-Shift-KeyB': 'extendToPreviousChar', + 'mac:Ctrl-Shift-KeyF': 'extendToNextChar', + 'mac:Ctrl-Shift-KeyP': 'extendUp', + 'mac:Ctrl-Shift-KeyN': 'extendDown', + 'mac:Ctrl-Shift-KeyA': 'extendToMathFieldStart', + 'mac:Ctrl-Shift-KeyE': 'extendToMathFieldEnd', + 'mac:Ctrl-Alt-KeyB': 'moveToPreviousWord', + 'mac:Ctrl-Alt-KeyF': 'moveToNextWord', + 'mac:Ctrl-Shift-Alt-KeyB': 'extendToPreviousWord', + 'mac:Ctrl-Shift-Alt-KeyF': 'extendToNextWord', + 'mac:Ctrl-KeyH': 'deletePreviousChar', + 'mac:Ctrl-KeyD': 'deleteNextChar', + 'mac:Ctrl-KeyL': 'scrollIntoView', + 'mac:Ctrl-KeyT': 'transpose', + 'math:Shift-Quote': ['switch-mode', 'text', '', '“'], + 'text:Shift-Quote': ['switch-mode', 'math', '”', ''], + 'math:Ctrl-Digit2': ['insert', '\\sqrt{#0}'], + 'math:Ctrl-Digit5': 'moveToOpposite', + 'math:Ctrl-Digit6': 'moveToSuperscript', + 'math:Ctrl-Minus': 'moveToSubscript', + 'math:Alt-BracketLeft': [ + 'insert', + '\\left\\lbrack #0 \\right\\rbrack', + ], + 'math:Alt-Shift-BracketLeft': [ + 'insert', + '\\left\\lbrace #0 \\right\\rbrace', + ], + 'math:Return': 'addRowAfter', + 'math:Enter': 'addRowAfter', + 'math:Ctrl-Comma': 'addColumnAfter', + 'math:Alt-KeyQ': ['insert', '\\theta'], + 'math:Alt-KeyP': ['insert', '\\pi'], + 'math:Alt-KeyV': ['insert', '\\sqrt{#0}'], + 'math:Alt-KeyW': ['insert', '\\sum_{i=#?}^{#?}'], + 'math:Alt-KeyB': ['insert', '\\int_{#?}^{#?}'], + 'math:Alt-KeyU': ['insert', '\\cup'], + 'math:Alt-KeyN': ['insert', '\\cap'], + 'math:Alt-KeyO': ['insert', '\\emptyset'], + 'math:Alt-KeyD': ['insert', '\\differentialD'], + 'math:Alt-Shift-KeyO': ['insert', '\\varnothing'], + 'math:Alt-Shift-KeyD': ['insert', '\\partial'], + 'math:Alt-Shift-KeyP': ['insert', '\\prod_{i=#?}^{#?}'], + 'math:Alt-Shift-KeyU': ['insert', '\\bigcup'], + 'math:Alt-Shift-KeyN': ['insert', '\\bigcap'], + 'math:Alt-Shift-KeyA': ['insert', '\\forall'], + 'math:Alt-Shift-KeyE': ['insert', '\\exists'], + 'math:Alt-Digit5': ['insert', '\\infty'], + 'math:Alt-Digit6': ['insert', '\\wedge'], + 'math:Alt-Shift-Digit6': ['insert', '\\vee'], + 'math:Alt-Digit9': ['insert', '('], + 'math:Alt-Digit0': ['insert', ')'], + 'math:Alt-Shift-Backslash': ['insert', '|'], + 'math:Alt-Backslash': ['insert', '\\backslash'], + 'math:Slash': ['insert', '\\frac{#@}{#?}'], + 'math:Alt-Slash': ['insert', '\\frac{#?}{#@}'], + 'math:NumpadDivide': ['insert', '\\frac{#@}{#?}'], + 'math:Alt-NumpadDivide': ['insert', '\\frac{#?}{#@}'], + 'math:Shift-Backquote': ['insert', '\\~'], + 'math:Alt-Shift-Slash': ['insert', '\\/'], + 'Alt-Shift-KeyK': 'toggleKeystrokeCaption', + 'Alt-Space': 'toggleVirtualKeyboard', + 'mac:Ctrl-Meta-Up': [ + 'speak', + 'parent', + { withHighlighting: !1 }, + ], + '!mac:Ctrl-Alt-Up': [ + 'speak', + 'parent', + { withHighlighting: !1 }, + ], + 'mac:Ctrl-Meta-Down': [ + 'speak', + 'all', + { withHighlighting: !1 }, + ], + '!mac:Ctrl-Alt-Down': [ + 'speak', + 'all', + { withHighlighting: !1 }, + ], + 'mac:Ctrl-Meta-Left': [ + 'speak', + 'left', + { withHighlighting: !1 }, + ], + '!mac:Ctrl-Alt-Left': [ + 'speak', + 'left', + { withHighlighting: !1 }, + ], + 'mac:Ctrl-Meta-Right': [ + 'speak', + 'right', + { withHighlighting: !1 }, + ], + '!mac:Ctrl-Alt-Right': [ + 'speak', + 'right', + { withHighlighting: !1 }, + ], + '!mac:Ctrl-Alt-Period': [ + 'speak', + 'selection', + { withHighlighting: !1 }, + ], + 'mac:Ctrl-Meta-Period': [ + 'speak', + 'selection', + { withHighlighting: !1 }, + ], + 'mac:Ctrl-Meta-Shift-Up': [ + 'speak', + 'parent', + { withHighlighting: !0 }, + ], + '!mac:Ctrl-Alt-Shift-Up': [ + 'speak', + 'parent', + { withHighlighting: !0 }, + ], + 'mac:Ctrl-Meta-Shift-Down': [ + 'speak', + 'all', + { withHighlighting: !0 }, + ], + '!mac:Ctrl-Alt-Shift-Down': [ + 'speak', + 'all', + { withHighlighting: !0 }, + ], + 'mac:Ctrl-Meta-Shift-Left': [ + 'speak', + 'left', + { withHighlighting: !0 }, + ], + '!mac:Ctrl-Alt-Shift-Left': [ + 'speak', + 'left', + { withHighlighting: !0 }, + ], + 'mac:Ctrl-Meta-Shift-Right': [ + 'speak', + 'right', + { withHighlighting: !0 }, + ], + '!mac:Ctrl-Alt-Shift-Right': [ + 'speak', + 'right', + { withHighlighting: !0 }, + ], + '!mac:Ctrl-Alt-Shift-Period': [ + 'speak', + 'selection', + { withHighlighting: !0 }, + ], + 'mac:Ctrl-Meta-Shift-Period': [ + 'speak', + 'selection', + { withHighlighting: !0 }, + ], + }, + fe = { + '\\theta': 'Alt-KeyQ', + '\\sqrt': ['Alt-KeyV', 'Ctrl-Digit2'], + '\\pi': 'Alt-KeyP', + '\\prod': 'Alt-Shift-KeyP', + '\\sum': 'Alt-KeyW', + '\\int': 'Alt-KeyB', + '\\cup': 'Alt-KeyU', + '\\cap': 'Alt-KeyN', + '\\bigcup': 'Alt-Shift-KeyU', + '\\bigcap': 'Alt-Shift-KeyN', + '\\forall': 'Alt-Shift-KeyA', + '\\exists': 'Alt-Shift-KeyE', + '\\infty': 'Alt-Digit5', + '\\wedge': 'Alt-Digit5', + '\\vee': 'Alt-Shift-Digit6', + '\\differentialD': 'Alt-keyD', + '\\partial': 'Alt-Shift-KeyD', + '\\frac': 'Slash', + '\\emptyset': 'Alt-KeyO', + '\\varnothing': 'Alt-Shift-KeyO', + '\\~': '~', + }, + ge = { + "''": { mode: 'math', value: '^{\\doubleprime}' }, + alpha: '\\alpha', + delta: '\\delta', + Delta: '\\Delta', + pi: { mode: 'math', value: '\\pi' }, + 'pi ': { mode: 'text', value: '\\pi ' }, + Pi: { mode: 'math', value: '\\Pi' }, + theta: '\\theta', + Theta: '\\Theta', + ii: { + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\imaginaryI', + }, + jj: { + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\imaginaryJ', + }, + ee: { + mode: 'math', + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\exponentialE', + }, + nabla: { mode: 'math', value: '\\nabla' }, + grad: { mode: 'math', value: '\\nabla' }, + del: { mode: 'math', value: '\\partial' }, + '∞': '\\infty', + oo: { + mode: 'math', + after: + 'nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space', + value: '\\infty', + }, + '∑': { mode: 'math', value: '\\sum' }, + sum: { mode: 'math', value: '\\sum_{#?}^{#?}' }, + prod: { mode: 'math', value: '\\prod_{#?}^{#?}' }, + sqrt: { mode: 'math', value: '\\sqrt' }, + '∆': { mode: 'math', value: '\\differentialD' }, + '∂': { mode: 'math', value: '\\differentialD' }, + sin: { mode: 'math', value: '\\sin' }, + cos: { mode: 'math', value: '\\cos' }, + tan: { mode: 'math', value: '\\tan' }, + tanh: { mode: 'math', value: '\\tanh' }, + log: { mode: 'math', value: '\\log' }, + ln: { mode: 'math', value: '\\ln' }, + exp: { mode: 'math', value: '\\exp' }, + lim: { mode: 'math', value: '\\lim_{#?}' }, + dx: '\\differentialD x', + dy: '\\differentialD y', + dt: '\\differentialD t', + AA: { mode: 'math', value: '\\forall' }, + EE: { mode: 'math', value: '\\exists' }, + '!EE': { mode: 'math', value: '\\nexists' }, + '&&': { mode: 'math', value: '\\land' }, + xin: { + mode: 'math', + after: 'nothing+text+relop+punct+openfence+space', + value: 'x \\in', + }, + in: { + mode: 'math', + after: 'nothing+letter+closefence', + value: '\\in', + }, + '!in': { mode: 'math', value: '\\notin' }, + NN: '\\N', + ZZ: '\\Z', + QQ: '\\Q', + RR: '\\R', + CC: '\\C', + PP: '\\P', + xx: '\\times', + '+-': '\\pm', + '!=': '\\ne', + '>=': '\\ge', + '<=': '\\le', + '<<': '\\ll', + '>>': '\\gg', + '~~': '\\approx', + '≈': '\\approx', + '?=': '\\questeq', + '÷': '\\div', + '¬': '\\neg', + ':=': '\\coloneq', + '::': '\\Colon', + '(:': '\\langle', + ':)': '\\rangle', + beta: '\\beta', + chi: '\\chi', + epsilon: '\\epsilon', + varepsilon: '\\varepsilon', + eta: { + mode: 'math', + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\eta', + }, + 'eta ': { + mode: 'text', + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\eta ', + }, + gamma: '\\gamma', + Gamma: '\\Gamma', + iota: '\\iota', + kappa: '\\kappa', + lambda: '\\lambda', + Lambda: '\\Lambda', + mu: { + mode: 'math', + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\mu', + }, + 'mu ': { + mode: 'text', + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\mu ', + }, + nu: { + mode: 'math', + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\nu', + }, + 'nu ': { + mode: 'text', + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\nu ', + }, + µ: '\\mu', + phi: { + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\phi', + }, + Phi: { + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\Phi', + }, + varphi: '\\varphi', + psi: { + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\psi', + }, + Psi: { + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\Psi', + }, + rho: { + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\rho', + }, + sigma: '\\sigma', + Sigma: '\\Sigma', + tau: { + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\tau', + }, + vartheta: '\\vartheta', + upsilon: '\\upsilon', + xi: { + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\xi', + }, + Xi: { + after: + 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', + value: '\\Xi', + }, + zeta: '\\zeta', + omega: '\\omega', + Omega: '\\Omega', + Ω: '\\omega', + forall: '\\forall', + exists: { mode: 'math', value: '\\exists' }, + '!exists': { mode: 'math', value: '\\nexists' }, + ':.': { mode: 'math', value: '\\therefore' }, + liminf: '\\operatorname*{lim~inf}_{#?}', + limsup: '\\operatorname*{lim~sup}_{#?}', + argmin: '\\operatorname*{arg~min}_{#?}', + argmax: '\\operatorname*{arg~max}_{#?}', + det: '\\det', + mod: { mode: 'math', value: '\\mod' }, + max: { mode: 'math', value: '\\max' }, + min: { mode: 'math', value: '\\min' }, + erf: '\\operatorname{erf}', + erfc: '\\operatorname{erfc}', + bessel: { mode: 'math', value: '\\operatorname{bessel}' }, + mean: { mode: 'math', value: '\\operatorname{mean}' }, + median: { mode: 'math', value: '\\operatorname{median}' }, + fft: { mode: 'math', value: '\\operatorname{fft}' }, + lcm: { mode: 'math', value: '\\operatorname{lcm}' }, + gcd: { mode: 'math', value: '\\operatorname{gcd}' }, + randomReal: '\\operatorname{randomReal}', + randomInteger: '\\operatorname{randomInteger}', + Re: { mode: 'math', value: '\\operatorname{Re}' }, + Im: { mode: 'math', value: '\\operatorname{Im}' }, + mm: { + mode: 'math', + after: 'nothing+digit', + value: '\\operatorname{mm}', + }, + cm: { + mode: 'math', + after: 'nothing+digit', + value: '\\operatorname{cm}', + }, + km: { + mode: 'math', + after: 'nothing+digit', + value: '\\operatorname{km}', + }, + kg: { + mode: 'math', + after: 'nothing+digit', + value: '\\operatorname{kg}', + }, + '...': '\\ldots', + '+...': '+\\cdots', + '-...': '-\\cdots', + '->...': '\\to\\cdots', + '->': '\\to', + '|->': '\\mapsto', + '--\x3e': '\\longrightarrow', + '<--': '\\longleftarrow', + '=>': '\\Rightarrow', + '==>': '\\Longrightarrow', + '<=>': '\\Leftrightarrow', + '<->': '\\leftrightarrow', + '(.)': '\\odot', + '(+)': '\\oplus', + '(/)': '\\oslash', + '(*)': '\\otimes', + '(-)': '\\ominus', + '||': '\\Vert', + '{': '\\{', + '}': '\\}', + '*': '\\cdot', + }; + function ye(t, e, i) { + if (!i) return i; + if ('string' == typeof i) return i; + if ('string' == typeof i.mode && i.mode !== t) return null; + if (!e) return i ? i.value : void 0; + let s = !1, + a = !1, + o = !1, + n = !1, + r = !1, + l = !1, + c = !1, + h = !1, + d = !1, + p = !1, + m = !1, + u = !1, + f = !1, + g = !1, + y = e[e.length - 1], + b = e.length - 1; + for (; y && /msubsup|placeholder/.test(y.type); ) + (b -= 1), (y = e[b]); + return ( + (s = !y || 'first' === y.type), + y && + ((f = 'text' === y.mode), + (a = !f && 'mord' === y.type && At.LETTER.test(y.body)), + (o = !f && 'mord' === y.type && /[0-9]+$/.test(y.body)), + (n = !f && y.isFunction), + (r = 'genfrac' === y.type), + (l = 'surd' === y.type), + (c = 'mbin' === y.type), + (h = 'mrel' === y.type), + (d = 'mpunct' === y.type || 'minner' === y.type), + (p = y.array), + (m = 'mopen' === y.type), + (u = 'mclose' === y.type || 'leftright' === y.type), + (g = 'space' === y.type)), + void 0 !== i.after + ? (/nothing/.test(i.after) && s) || + (/letter/.test(i.after) && a) || + (/digit/.test(i.after) && o) || + (/function/.test(i.after) && n) || + (/frac/.test(i.after) && r) || + (/surd/.test(i.after) && l) || + (/binop/.test(i.after) && c) || + (/relop/.test(i.after) && h) || + (/punct/.test(i.after) && d) || + (/array/.test(i.after) && p) || + (/openfence/.test(i.after) && m) || + (/closefence/.test(i.after) && u) || + (/text/.test(i.after) && f) || + (/space/.test(i.after) && g) + ? i.value + : null + : i.value + ); + } + function be(t) { + let e = 'other'; + return ( + navigator && + navigator.platform && + navigator.userAgent && + (/^(mac)/i.test(navigator.platform) + ? (e = 'mac') + : /^(win)/i.test(navigator.platform) + ? (e = 'win') + : /(android)/i.test(navigator.userAgent) + ? (e = 'android') + : /(iphone)/i.test(navigator.userAgent) || + /(ipod)/i.test(navigator.userAgent) || + /(ipad)/i.test(navigator.userAgent) + ? (e = 'ios') + : /\bCrOS\b/i.test(navigator.userAgent) && + (e = 'chromeos')), + e === t ? t : '!' + t + ); + } + function xe(t) { + let e = t; + return ( + Array.isArray(e) && + e.length > 0 && + (e = e[0] + '(' + e.slice(1).join('') + ')'), + e + ); + } + function ke(t, e) { + let i = ''; + Array.isArray(t) || (t = [t]); + for (const s of t) { + let t; + const a = s.match(/(^[^:]*):/), + o = a ? a[1] : ''; + if ( + o === be('mac') || + o === be('win') || + o === be('ios') || + o === be('android') || + o === be('chromeos') || + o === be('other') + ) { + const e = s.match(/:([^:]*)$/); + t = e ? e[1] : s; + } else if ( + ![ + 'mac', + '!mac', + 'win', + '!win', + 'ios', + '!ios', + 'android', + '!android', + 'chromeos', + '!chromeos', + 'other', + '!other', + ].includes(o) + ) { + const e = s.match(/:([^:]*)$/); + t = e ? e[1] : s; + } + if (t) { + const s = 'mac' === be('mac') || 'ios' === be('ios'), + a = t.length > 1 ? t.split('-') : [t]; + let o = ''; + for (const t of a) + !s && + o.length > 0 && + (o += '+'), + 'Key' === t.substr(0, 3) + ? (o += t.substr(3, 1)) + : 'Digit' === t.substr(0, 5) + ? (o += t.substr(5, 1)) + : (o += + { + Meta: s ? '⌘' : 'command', + Shift: s ? '⇧' : 'shift', + Alt: s ? '⌥' : 'alt', + Ctrl: s ? '⌃' : 'control', + '\n': s ? '⏎' : 'return', + Return: s ? '⏎' : 'return', + Enter: s ? '⌤' : 'enter', + Tab: s ? '⇥' : 'tab', + Esc: 'esc', + Backspace: s ? '⌫' : 'backspace', + Del: s ? '⌦' : 'del', + PageUp: s ? '⇞' : 'page up', + PageDown: s ? '⇟' : 'page down', + Home: s ? '⤒' : 'home', + End: s ? '⤓' : 'end', + Spacebar: 'space', + Semicolon: ';', + Period: '.', + Comma: ',', + Minus: '-', + Equal: '=', + Quote: "'", + BracketLeft: '[', + BracketRight: ']', + Backslash: '\\', + IntlBackslash: '\\', + Backquote: '`', + Slash: '/', + NumpadMultiply: '* 🔢', + NumpadDivide: '/ 🔢', + NumpadSubtract: '- 🔢', + NumpadAdd: '+ 🔢', + NumpadDecimal: '. 🔢', + NumpadComma: ', 🔢', + Help: 'help', + Left: '⇠', + Up: '⇡', + Right: '⇢', + Down: '⇣', + }[t] || t); + i.length > 0 && (i += e || ' or '), (i += o); + } + } + return i; + } + var ve = { + KEYBOARD_SHORTCUTS: ue, + INLINE_SHORTCUTS: ge, + stringify: ke, + startsWithString: function(t, e) { + const i = []; + for (let s = 0; s <= t.length - 1; s++) { + const a = t.substring(s); + (e && e.overrideDefaultInlineShortcuts) || + Object.keys(ge).forEach(t => { + t.startsWith(a) && !i.includes(t) && i.push(t); + }); + const o = e && e.inlineShortcuts ? e.inlineShortcuts : null; + o && + Object.keys(o).forEach(t => { + t.startsWith(a) && i.push(t); + }); + } + return i; + }, + forString: function(t, e, i, s) { + let a = ''; + (s && s.overrideDefaultInlineShortcuts) || + (a = ye(t, e, ge[i])); + const o = s && s.inlineShortcuts ? s.inlineShortcuts : null; + let n; + return o && (n = ye(t, e, o[i])), n || a; + }, + selectorForKeystroke: function(t, e) { + for (const i of [ + be('mac') + ':' + t + ':' + e, + be('win') + ':' + t + ':' + e, + be('ios') + ':' + t + ':' + e, + be('android') + ':' + t + ':' + e, + be('chromeos') + ':' + t + ':' + e, + be('other') + ':' + t + ':' + e, + be('mac') + ':' + e, + be('win') + ':' + e, + be('ios') + ':' + e, + be('android') + ':' + e, + be('chromeos') + ':' + e, + t + ':' + e, + e, + ]) + if (ue[i]) return ue[i]; + return ''; + }, + forCommand: function(t) { + let e = []; + if ('string' == typeof t) { + const i = fe[t]; + Array.isArray(i) ? (e = i.slice()) : i && e.push(i); + } + t = xe(t); + const i = new RegExp( + '^' + + t + .replace('\\', '\\\\') + .replace('|', '\\|') + .replace('*', '\\*') + .replace('$', '\\$') + .replace('^', '\\^') + + '([^*a-zA-Z]|$)' + ); + return ( + Object.keys(ue).forEach(t => { + if (i.test(xe(ue[t]))) { + const i = t.match(/:([^:]*)$/); + i && e.push(i[1]); + } + }), + ke(e) + ); + }, + }; + function we(t, e) { + (this.root = te.makeRoot()), + (this.path = [{ relation: 'body', offset: 0 }]), + (this.extent = 0), + (this.config = t ? { ...t } : {}), + (this.target = e), + (this.suppressChangeNotifications = !1); + } + function Se(t) { + const e = Object.assign(new we(t.config, t.target), t); + return (e.path = me.clone(t.path)), e; + } + function Ae(t, e) { + let i = 0; + for (let s = 0; s < e.row; s++) + for (let e = 0; e < t[s].length; e++) i += 1; + return (i += e.col), i; + } + function Me(t, e) { + if ('string' == typeof e) { + const t = e.match(/cell([0-9]*)$/); + t && (e = parseInt(t[1])); + } + const i = { row: 0, col: 0 }; + for (; e > 0; ) + (i.col += 1), + (!t[i.row] || i.col >= t[i.row].length) && + ((i.col = 0), (i.row += 1)), + (e -= 1); + return i; + } + function Ce(t, e) { + let i; + return ( + 'object' != typeof e && (e = Me(t, e)), + Array.isArray(t[e.row]) && (i = t[e.row][e.col] || null), + !i || + (0 !== i.length && 'first' === i[0].type) || + i.unshift(Be()), + i + ); + } + function _e(t) { + let e = 0, + i = 0, + s = 1; + for (const e of t) (i += 1), e.length > s && (s = e.length); + return (e = i * s), e; + } + function Te(t, e, i) { + if (!t) return []; + e || (e = ','); + let s, + a = []; + for (let o of t) + o && o.length > 0 && 'first' === o[0].type && (o = o.slice(1)), + o && + o.length > 0 && + (s + ? a.push(s) + : (s = new te.MathAtom('math', 'mpunct', e, i)), + (a = a.concat(o))); + return a; + } + function Le(t, e, i) { + const s = { ...e }; + if (((s.row += i), s.row < 0)) { + if (((s.col += i), (s.row = t.length - 1), s.col < 0)) + return null; + for (; s.row >= 0 && !Ce(t, s); ) s.row -= 1; + if (s.row < 0) return null; + } else if (s.row >= t.length) { + for (s.col += i, s.row = 0; s.row < t.length && !Ce(t, s); ) + s.row += 1; + if (s.row > t.length - 1) return null; + } + return s; + } + function Fe(t) { + return ( + !!t && + (('mord' === t.type && /[0-9.]/.test(t.body)) || + ('mpunct' === t.type && ',' === t.body)) + ); + } + function De(t, e) { + if (!t) return !1; + if (Array.isArray(t)) { + for (const i of t) if (De(i, e)) return !0; + } else { + if (t === e) return !0; + if ( + [ + 'body', + 'numer', + 'denom', + 'index', + 'subscript', + 'superscript', + 'underscript', + 'overscript', + ].some(function(i) { + return i === e || De(t[i], e); + }) + ) + return !0; + if (t.array) + for (let i = _e(t.array); i >= 0; i--) + if (De(Ce(t.array, i), e)) return !0; + } + return !1; + } + function ze(t) { + if (t) + return ( + 1 === t.length && + 'leftright' === t[0].type && + '(' === t[0].leftDelim && + (t = t[0].body), + t + ); + } + function Ee(t, e) { + if (!t) return ''; + if (t.length <= 1) return t; + if (!e || 'ASCIIMath' !== e.format) { + if (t.startsWith('$$') && t.endsWith('$$')) + return t.substring(2, t.length - 2); + if (t.startsWith('$') && t.endsWith('$')) + return t.substring(1, t.length - 1); + if (((t = t.replace(/\\\\([^\s\n])/g, '\\$1')), /\\/.test(t))) + return t; + } + return qe( + (t = (t = (t = (t = (t = (t = t.replace( + /\u2061/gu, + '' + )).replace(/\u3016/gu, '{')).replace(/\u3017/gu, '}')).replace( + /([^\\])sinx/g, + '$1\\sin x' + )).replace(/([^\\])cosx/g, '$1\\cos x ')).replace( + /\u2013/g, + '-' + )), + e + ); + } + function qe(t, e) { + if (!t) return ''; + let i, + s = !1; + if ( + (s || + ('^' !== t[0] && '_' !== t[0]) || + ((i = Pe(t.substr(1), { ...e, noWrap: !0 })), + (t = t[0] + '{' + i.match + '}'), + (t += qe(i.rest, e)), + (s = !0)), + s || + ((i = t.match(/^(sqrt|\u221a)(.*)/)), + i && + ((i = Pe(i[2], { ...e, noWrap: !0 })), + (t = '\\sqrt{' + i.match + '}'), + (t += qe(i.rest, e)), + (s = !0))), + s || + ((i = t.match(/^(\\cbrt|\u221b)(.*)/)), + i && + ((i = Pe(i[2], { ...e, noWrap: !0 })), + (t = '\\sqrt[3]{' + i.match + '}'), + (t += qe(i.rest, e)), + (s = !0))), + s || + ((i = t.match(/^abs(.*)/)), + i && + ((i = Pe(i[1], { ...e, noWrap: !0 })), + (t = '\\left|' + i.match + '\\right|'), + (t += qe(i.rest, e)), + (s = !0))), + s || + ((i = t.match(/^["”“](.*?)["”“](.*)/)), + i && + ((t = '\\text{' + i[1] + '}'), + (t += qe(i[2], e)), + (s = !0))), + s || + ((i = t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/)), + i && ((t = Ie(i[1], e)), (t += qe(i[2], e)), (s = !0))), + !s && + /^(f|g|h)[^a-zA-Z]/.test(t) && + ((i = Pe(t.substring(1), { ...e, noWrap: !0 })), + (t = + '(' === t[1] + ? t[0] + '\\mleft(' + i.match + '\\mright)' + : t[0] + i.match), + (t += qe(i.rest, e)), + (s = !0)), + s || + ((i = t.match(/^([a-zA-Z]+)(.*)/)), + i && ((t = Ie(i[1], e)), (t += qe(i[2], e)), (s = !0))), + !s) + ) + if ( + ((i = Pe(t, { ...e, noWrap: !0 })), + i.match && '/' === i.rest[0]) + ) { + const a = Pe(i.rest.substr(1), { ...e, noWrap: !0 }); + a.match && + (t = + '\\frac{' + + i.match + + '}{' + + a.match + + '}' + + qe(a.rest, e)), + (s = !0); + } else + i.match && + ((t = + '(' === t[0] + ? '\\left(' + + i.match + + '\\right)' + + qe(i.rest, e) + : i.match + qe(i.rest, e)), + (s = !0)); + return ( + s || + ((i = t.match(/^(\s+)(.*)$/)), + i && ((t = ' ' + qe(i[2], e)), (s = !0))), + t + ); + } + function Pe(t, e) { + let i = '', + s = (t = t.trim()), + a = t.charAt(0), + o = { '(': ')', '{': '}', '[': ']' }[a]; + if (o) { + let n = 1, + r = 1; + for (; r < t.length && n > 0; ) + t[r] === a && n++, t[r] === o && n--, r++; + 0 === n + ? (e.noWrap && '(' === a + ? (i = qe(t.substring(1, r - 1), e)) + : ('{' === a && + '}' === o && + ((a = '\\{'), (o = '\\}')), + (i = + '\\left' + + a + + qe(t.substring(1, r - 1), e) + + '\\right' + + o)), + (s = t.substring(r))) + : ((i = t.substring(1, r)), (s = '')); + } else { + let a = t.match(/^([a-zA-Z]+)/); + if (a) { + let i = ve.forString('math', null, t, e); + if (i) + return ( + (i = i.replace('_{#?}', '')), + (i = i.replace('^{#?}', '')), + { match: i, rest: t.substring(i.length) } + ); + } + if (((a = t.match(/^([a-zA-Z])/)), a)) + return { match: a[1], rest: t.substring(1) }; + if (((a = t.match(/^(-)?\d+(\.\d*)?/)), a)) + return { match: a[0], rest: t.substring(a[0].length) }; + /^\\(left|right)/.test(t) || + ((a = t.match(/^(\\[a-zA-Z]+)/)), + a && ((s = t.substring(a[1].length)), (i = a[1]))); + } + return { match: i, rest: s }; + } + function Ie(t, e) { + let i = ve.forString('math', null, t, e); + return ( + i + ? ((i = i.replace('_{#?}', '')), + (i = i.replace('^{#?}', '')), + (i += ' ')) + : (i = t), + i + ); + } + function Be() { + return new te.MathAtom('', 'first'); + } + (we.prototype._announce = function(t, e, i) { + 'function' == typeof this.config.onAnnounce && + this.config.onAnnounce(this.target, t, e, i); + }), + (we.prototype.filter = function(t, e) { + e = e < 0 ? -1 : 1; + const i = [], + s = new we(); + (s.path = me.clone(this.path)), + (s.extent = this.extent), + (s.root = this.root), + e >= 0 + ? s.collapseForward() + : (s.collapseBackward(), s.move(1)); + const a = s.anchor(); + do { + t.bind(s)(s.path, s.anchor()) && i.push(s.toString()), + e >= 0 + ? s.next({ iterateAll: !0 }) + : s.previous({ iterateAll: !0 }); + } while (a !== s.anchor()); + return i; + }), + (we.prototype.forEach = function(t) { + this.root.forEach(t); + }), + (we.prototype.forEachSelected = function(t, e) { + (e = e || {}).recursive = void 0 !== e.recursive && e.recursive; + const i = this.siblings(), + s = this.startOffset() + 1, + a = this.endOffset() + 1; + if (e.recursive) + for (let e = s; e < a; e++) + i[e] && 'first' !== i[e].type && i[e].forEach(t); + else + for (let e = s; e < a; e++) + i[e] && 'first' !== i[e].type && t(i[e]); + }), + (we.prototype.toString = function() { + return me.pathToString(this.path, this.extent); + }), + (we.prototype.adjustPlaceholder = function() { + const t = this.siblings(); + if (t && t.length <= 1) { + let e; + const i = this.relation(); + if ( + ('numer' === i + ? (e = 'numerator') + : 'denom' === i + ? (e = 'denominator') + : 'surd' === this.parent().type && 'body' === i + ? (e = 'radicand') + : 'overunder' === this.parent().type && 'body' === i + ? (e = 'base') + : ('underscript' !== i && 'overscript' !== i) || + (e = 'annotation'), + e) + ) { + const e = [ + new te.MathAtom( + 'math', + 'placeholder', + '⬚', + this.anchorStyle() + ), + ]; + Array.prototype.splice.apply(t, [1, 0].concat(e)); + } + } + }), + (we.prototype.selectionWillChange = function() { + 'function' != typeof this.config.onSelectionWillChange || + this.suppressChangeNotifications || + this.config.onSelectionWillChange(this.target); + }), + (we.prototype.selectionDidChange = function() { + 'function' != typeof this.config.onSelectionDidChange || + this.suppressChangeNotifications || + this.config.onSelectionDidChange(this.target); + }), + (we.prototype.contentWillChange = function() { + 'function' != typeof this.config.onContentWillChange || + this.suppressChangeNotifications || + this.config.onContentWillChange(this.target); + }), + (we.prototype.contentDidChange = function() { + 'function' != typeof this.config.onContentDidChange || + this.suppressChangeNotifications || + this.config.onContentDidChange(this.target); + }), + (we.prototype.setPath = function(t, e) { + if ('string' == typeof t) t = me.pathFromString(t); + else if (Array.isArray(t)) { + const i = me.clone(t), + s = this.path; + (this.path = i), + 0 === e && + 'placeholder' === this.anchor().type && + ((i[i.length - 1].offset = 0), (e = 1)), + (t = { path: i, extent: e || 0 }), + (this.path = s); + } + const i = 0 !== me.pathDistance(this.path, t.path), + s = t.extent !== this.extent; + return ( + (i || s) && + (i && this.adjustPlaceholder(), + this.selectionWillChange(), + (this.path = me.clone(t.path)), + this.siblings().length < this.anchorOffset() + ? ((this.path = [{ relation: 'body', offset: 0 }]), + (this.extent = 0)) + : this.setExtent(t.extent), + this.selectionDidChange()), + i || s + ); + }), + (we.prototype.wordBoundary = function(t, e) { + e = e < 0 ? -1 : 1; + const i = new we(); + (i.path = me.clone(t)), (i.root = this.root); + let s = 0; + for ( + ; + i.sibling(s) && + 'text' === i.sibling(s).mode && + At.LETTER_AND_DIGITS.test(i.sibling(s).body); + + ) + s += e; + return ( + i.sibling(s) || (s -= e), + (i.path[i.path.length - 1].offset += s), + i.path + ); + }), + (we.prototype.wordBoundaryOffset = function(t, e) { + e = e < 0 ? -1 : 1; + const i = this.siblings(); + if (!i[t]) return t; + if ('text' !== i[t].mode) return t; + let s; + if (At.LETTER_AND_DIGITS.test(i[t].body)) { + let a, + o = t; + do { + (a = + 'text' === i[o].mode && + At.LETTER_AND_DIGITS.test(i[o].body)), + (o += e); + } while (i[o] && a); + s = i[o] ? o - 2 * e : o - e; + } else if (/\s/.test(i[t].body)) { + let a = t; + for ( + ; + i[a] && 'text' === i[a].mode && /\s/.test(i[a].body); + + ) + a += e; + if (i[a]) { + let t = !0; + do { + (t = 'text' === i[a].mode && !/\s/.test(i[a].body)), + (a += e); + } while (i[a] && t); + s = i[a] ? a - 2 * e : a - e; + } else s = a - e; + } else { + let a = t; + for ( + ; + i[a] && 'text' === i[a].mode && !/\s/.test(i[a].body); + + ) + a += e; + s = i[a] ? a : a - e; + let o = !0; + for (; i[a] && o; ) + (o = 'text' === i[a].mode && /\s/.test(i[a].body)), + o && (s = a), + (a += e); + s = i[a] ? a - 2 * e : a - e; + } + return s - (e > 0 ? 0 : 1); + }), + (we.prototype.setRange = function(t, e, i) { + i = i || {}; + const s = me.pathDistance(t, e); + if (0 === s) + return i.extendToWordBoundary + ? ((t = this.wordBoundary(t, -1)), + (e = this.wordBoundary(e, 1)), + this.setRange(t, e)) + : this.setPath(me.clone(t), 0); + if (1 === s) { + const s = e[e.length - 1].offset - t[t.length - 1].offset; + return i.extendToWordBoundary + ? ((t = this.wordBoundary(t, s < 0 ? 1 : -1)), + (e = this.wordBoundary(e, s < 0 ? -1 : 1)), + this.setRange(t, e)) + : this.setPath(me.clone(t), s); + } + let a = me.pathCommonAncestor(t, e); + const o = a.length; + if ( + t.length === o || + e.length === o || + t[o].relation !== e[o].relation + ) + return this.setPath(a, -1); + a.push(t[o]), (a = me.clone(a)); + let n = e[o].offset - t[o].offset + 1; + return ( + n <= 0 + ? e.length > o + 1 + ? ((a[o].relation = e[o].relation), + (a[o].offset = e[o].offset), + (a[a.length - 1].offset -= 1), + (n = 2 - n)) + : ((a[o].relation = e[o].relation), + (a[o].offset = e[o].offset), + (n = 1 - n)) + : e.length <= t.length + ? (a[a.length - 1].offset -= 1) + : e.length > t.length && (a[o].offset -= 1), + this.setPath(a, n) + ); + }), + (we.prototype.ancestor = function(t) { + if (t > this.path.length) return null; + let e = this.root; + for (let i = 0; i < this.path.length - t; i++) { + const t = this.path[i]; + if (e.array) e = Ce(e.array, t.relation)[t.offset]; + else { + if (!e[t.relation]) return null; + { + (0 !== e[t.relation].length && + 'first' === e[t.relation][0].type) || + e[t.relation].unshift(Be()); + const i = Math.min( + t.offset, + e[t.relation].length - 1 + ); + e = e[t.relation][i]; + } + } + } + return e; + }), + (we.prototype.anchor = function() { + if (this.parent().array) + return Ce(this.parent().array, this.relation())[ + this.anchorOffset() + ]; + const t = this.siblings(); + return t[Math.min(t.length - 1, this.anchorOffset())]; + }), + (we.prototype.parent = function() { + return this.ancestor(1); + }), + (we.prototype.relation = function() { + return this.path.length > 0 + ? this.path[this.path.length - 1].relation + : ''; + }), + (we.prototype.anchorOffset = function() { + return this.path.length > 0 + ? this.path[this.path.length - 1].offset + : 0; + }), + (we.prototype.focusOffset = function() { + return this.path.length > 0 + ? this.path[this.path.length - 1].offset + this.extent + : 0; + }), + (we.prototype.startOffset = function() { + return Math.min(this.focusOffset(), this.anchorOffset()); + }), + (we.prototype.endOffset = function() { + return Math.max(this.focusOffset(), this.anchorOffset()); + }), + (we.prototype.insertFirstAtom = function() { + this.siblings(); + }), + (we.prototype.siblings = function() { + if (0 === this.path.length) return []; + let t; + return ( + this.parent().array + ? (t = Ce(this.parent().array, this.relation())) + : ((t = this.parent()[this.relation()] || []), + 'string' == typeof t && (t = [])), + (0 !== t.length && 'first' === t[0].type) || + t.unshift(Be()), + t + ); + }), + (we.prototype.sibling = function(t) { + return this.siblings()[this.startOffset() + t]; + }), + (we.prototype.isCollapsed = function() { + return 0 === this.extent; + }), + (we.prototype.setExtent = function(t) { + this.extent = t; + }), + (we.prototype.collapseForward = function() { + return ( + 0 !== this.extent && + (this.setSelection(this.endOffset()), !0) + ); + }), + (we.prototype.collapseBackward = function() { + return ( + 0 !== this.extent && + (this.setSelection(this.startOffset()), !0) + ); + }), + (we.prototype.selectGroup_ = function() { + const t = this.siblings(); + if ('text' === this.anchorMode()) { + let e = this.startOffset(), + i = this.endOffset(); + for ( + ; + t[e] && + 'text' === t[e].mode && + At.LETTER_AND_DIGITS.test(t[e].body); + + ) + e -= 1; + for ( + ; + t[i] && + 'text' === t[i].mode && + At.LETTER_AND_DIGITS.test(t[i].body); + + ) + i += 1; + if (((i -= 1), e >= i)) + return void this.setSelection(this.endOffset() - 1, 1); + this.setSelection(e, i - e); + } else if ( + 'mord' === this.sibling(0).type && + /[0-9,.]/.test(this.sibling(0).body) + ) { + let e = this.startOffset(), + i = this.endOffset(); + for (; Fe(t[e]); ) e -= 1; + for (; Fe(t[i]); ) i += 1; + (i -= 1), this.setSelection(e, i - e); + } else this.setSelection(0, 'end'); + }), + (we.prototype.selectAll_ = function() { + (this.path = [{ relation: 'body', offset: 0 }]), + this.setSelection(0, 'end'); + }), + (we.prototype.deleteAll_ = function() { + this.selectAll_(), this.delete_(); + }), + (we.prototype.contains = function(t) { + if (this.isCollapsed()) return !1; + const e = this.siblings(), + i = this.startOffset(), + s = this.endOffset(); + for (let a = i; a < s; a++) if (De(e[a], t)) return !0; + return !1; + }), + (we.prototype.getSelectedAtoms = function() { + if (this.isCollapsed()) return null; + const t = [], + e = this.siblings(), + i = this.startOffset() + 1, + s = this.endOffset() + 1; + for (let a = i; a < s; a++) + e[a] && 'first' !== e[a].type && t.push(e[a]); + return t; + }), + (we.prototype.commandOffsets = function() { + const t = this.siblings(); + if (t.length <= 1) return null; + let e = Math.min(this.endOffset(), t.length - 1); + if ('command' !== t[e].type) return null; + for (; e > 0 && 'command' === t[e].type; ) e -= 1; + let i = this.startOffset() + 1; + for (; i <= t.length - 1 && 'command' === t[i].type; ) i += 1; + return i > e ? { start: e + 1, end: i } : null; + }), + (we.prototype.extractCommandStringAroundInsertionPoint = function( + t + ) { + let e = ''; + const i = this.commandOffsets(); + if (i) { + const s = t ? this.anchorOffset() + 1 : i.end, + a = this.siblings(); + for (let t = i.start; t < s; t++) e += a[t].body || ''; + } + return e; + }), + (we.prototype.decorateCommandStringAroundInsertionPoint = function( + t + ) { + const e = this.commandOffsets(); + if (e) { + const i = this.siblings(); + for (let s = e.start; s < e.end; s++) i[s].error = t; + } + }), + (we.prototype.commitCommandStringBeforeInsertionPoint = function() { + const t = this.commandOffsets(); + if (t) { + const e = this.siblings(), + i = this.anchorOffset() + 1; + for (let s = t.start; s < i; s++) + e[s] && (e[s].suggestion = !1); + } + }), + (we.prototype.spliceCommandStringAroundInsertionPoint = function( + t + ) { + const e = this.commandOffsets(); + if (e) { + if ((this.contentWillChange(), t)) { + Array.prototype.splice.apply( + this.siblings(), + [e.start, e.end - e.start].concat(t) + ); + let i = []; + for (const e of t) + i = i.concat( + e.filter(t => 'placeholder' === t.type) + ); + this.setExtent(0), + (this.path[this.path.length - 1].offset = + e.start - 1), + (0 !== i.length && this.leap(1, !1)) || + this.setSelection(e.start + t.length - 1); + } else + this.siblings().splice(e.start, e.end - e.start), + this.setSelection(e.start - 1, 0); + this.contentDidChange(); + } + }), + (we.prototype.removeCommandString = function() { + this.contentWillChange(); + const t = this.suppressChangeNotifications; + (this.suppressChangeNotifications = !0), + (function t(e) { + if (e) + if (Array.isArray(e)) + for (let i = e.length - 1; i >= 0; i--) + 'command' === e[i].type + ? e.splice(i, 1) + : t(e[i]); + else if ( + (t(e.body), + t(e.superscript), + t(e.subscript), + t(e.underscript), + t(e.overscript), + t(e.numer), + t(e.denom), + t(e.index), + e.array) + ) + for (let i = _e(e.array); i >= 0; i--) + t(Ce(e.array, i)); + })(this.root.body), + (this.suppressChangeNotifications = t), + this.contentDidChange(); + }), + (we.prototype.extractArgBeforeInsertionPoint = function() { + const t = this.siblings(); + if (t.length <= 1) return []; + const e = []; + let i = this.startOffset(); + if ('text' === t[i].mode) + for (; i >= 1 && 'text' === t[i].mode; ) + e.unshift(t[i]), i--; + else + for ( + ; + i >= 1 && + /^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type); + + ) + e.unshift(t[i]), i--; + return e; + }), + (we.prototype.setSelection = function(t, e, i) { + (t = t || 0), (e = e || 0); + const s = this.path[this.path.length - 1].relation; + i || (i = s); + const a = this.parent(); + if (!a && 'body' !== i) return !1; + const o = i.startsWith('cell'); + if ((!o && !a[i]) || (o && !a.array)) return !1; + const n = i !== s; + this.path[this.path.length - 1].relation = i; + const r = this.siblings().length; + this.path[this.path.length - 1].relation = s; + const l = this.extent; + 'end' === e ? (e = r - t - 1) : 'start' === e && (e = -t), + this.setExtent(e); + const c = this.extent !== l; + this.setExtent(l), + t < 0 && (t = r + t), + (t = Math.max(0, Math.min(t, r - 1))); + const h = this.path[this.path.length - 1].offset; + return ( + (n || h !== t || c) && + (n && this.adjustPlaceholder(), + this.selectionWillChange(), + (this.path[this.path.length - 1].relation = i), + (this.path[this.path.length - 1].offset = t), + this.setExtent(e), + this.selectionDidChange()), + !0 + ); + }), + (we.prototype.next = function(t) { + t = t || {}; + const e = { + body: 'numer', + numer: 'denom', + denom: 'index', + index: 'overscript', + overscript: 'underscript', + underscript: 'subscript', + subscript: 'superscript', + }; + if (this.anchorOffset() === this.siblings().length - 1) { + this.adjustPlaceholder(); + let i = e[this.relation()]; + const s = this.parent(); + for (; i && !s[i]; ) i = e[i]; + if (i) return void this.setSelection(0, 0, i); + if (this.parent().array) { + const t = _e(this.parent().array); + let e = + parseInt( + this.relation().match(/cell([0-9]*)$/)[1] + ) + 1; + for (; e < t; ) { + if ( + Ce(this.parent().array, e) && + this.setSelection(0, 0, 'cell' + e) + ) + return void this.selectionDidChange(); + e += 1; + } + } + if (1 === this.path.length) + (this.suppressChangeNotifications || + !this.config.onMoveOutOf || + this.config.onMoveOutOf(this, 'forward')) && + (this.path[0].offset = 0); + else { + const e = !t.iterateAll && this.parent().skipBoundary; + this.path.pop(), e && this.next(t); + } + return void this.selectionDidChange(); + } + this.setSelection(this.anchorOffset() + 1); + const i = this.anchor(); + if (i && !i.captureSelection) { + let s; + if (i.array) { + let t = 0; + s = ''; + const e = _e(i.array); + for (; !s && t < e; ) + Ce(i.array, t) && (s = 'cell' + t.toString()), + (t += 1); + return ( + this.path.push({ relation: s, offset: 0 }), + void this.setSelection(0, 0, s) + ); + } + for (s = 'body'; s; ) { + if (Array.isArray(i[s])) + return ( + this.path.push({ relation: s, offset: 0 }), + this.insertFirstAtom(), + void ( + !t.iterateAll && + i.skipBoundary && + this.next(t) + ) + ); + s = e[s]; + } + } + }), + (we.prototype.previous = function(t) { + const e = { + numer: 'body', + denom: 'numer', + index: 'denom', + overscript: 'index', + underscript: 'overscript', + subscript: 'underscript', + superscript: 'subscript', + }; + if ( + (!(t = t || {}).iterateAll && + 1 === this.anchorOffset() && + this.parent() && + this.parent().skipBoundary && + this.setSelection(0), + this.anchorOffset() < 1) + ) { + let t = e[this.relation()]; + for (; t && !this.setSelection(-1, 0, t); ) t = e[t]; + const i = this.parent() ? this.parent().type : 'none'; + if ( + ('body' !== t || + ('msubsup' !== i && 'mop' !== i) || + (t = null), + t) + ) + return; + if ( + (this.adjustPlaceholder(), + this.selectionWillChange(), + this.relation().startsWith('cell')) + ) { + let t = + parseInt( + this.relation().match(/cell([0-9]*)$/)[1] + ) - 1; + for (; t >= 0; ) { + if ( + Ce(this.parent().array, t) && + this.setSelection(-1, 0, 'cell' + t) + ) + return void this.selectionDidChange(); + t -= 1; + } + } + return ( + 1 === this.path.length + ? (this.suppressChangeNotifications || + !this.config.onMoveOutOf || + this.config.onMoveOutOf.bind(this)(-1)) && + (this.path[0].offset = this.root.body.length - 1) + : (this.path.pop(), + this.setSelection(this.anchorOffset() - 1)), + void this.selectionDidChange() + ); + } + const i = this.anchor(); + if (!i.captureSelection) { + let t; + if (i.array) { + t = ''; + const e = _e(i.array); + let s = e - 1; + for (; !t && s < e; ) + Ce(i.array, s) && (t = 'cell' + s.toString()), + (s -= 1); + return ( + (s += 1), + this.path.push({ + relation: t, + offset: Ce(i.array, s).length - 1, + }), + void this.setSelection(-1, 0, t) + ); + } + for (t = 'superscript'; t; ) { + if (Array.isArray(i[t])) + return ( + this.path.push({ + relation: t, + offset: i[t].length - 1, + }), + void this.setSelection(-1, 0, t) + ); + t = e[t]; + } + } + this.setSelection(this.anchorOffset() - 1), + !t.iterateAll && + this.sibling(0) && + this.sibling(0).skipBoundary && + this.previous(t); + }), + (we.prototype.move = function(t, e) { + const i = (e = e || { extend: !1 }).extend || !1; + if ((this.removeSuggestion(), i)) this.extend(t, e); + else { + const e = Se(this); + if (t > 0) + for (this.collapseForward() && t--; t > 0; ) + this.next(), t--; + else if (t < 0) + for (this.collapseBackward() && t++; 0 !== t; ) + this.previous(), t++; + this._announce('move', e); + } + }), + (we.prototype.up = function(t) { + const e = (t = t || { extend: !1 }).extend || !1; + this.collapseBackward(); + const i = this.relation(); + if ('denom' === i) + e + ? (this.selectionWillChange(), + this.path.pop(), + (this.path[this.path.length - 1].offset -= 1), + this.setExtent(1), + this.selectionDidChange()) + : this.setSelection(this.anchorOffset(), 0, 'numer'), + this._announce('moveUp'); + else if (this.parent().array) { + let e = Me(this.parent().array, i); + (e = Le(this.parent().array, e, -1)), + e && Ce(e) + ? ((this.path[this.path.length - 1].relation = + 'cell' + Ae(this.parent().array, e)), + this.setSelection(this.anchorOffset()), + this._announce('moveUp')) + : this.move(-1, t); + } else this._announce('line'); + }), + (we.prototype.down = function(t) { + const e = (t = t || { extend: !1 }).extend || !1; + this.collapseForward(); + const i = this.relation(); + if ('numer' === i) + e + ? (this.selectionWillChange(), + this.path.pop(), + (this.path[this.path.length - 1].offset -= 1), + this.setExtent(1), + this.selectionDidChange()) + : this.setSelection(this.anchorOffset(), 0, 'denom'), + this._announce('moveDown'); + else if (this.parent().array) { + let e = Me(this.parent().array, i); + (e = Le(this.parent().array, e, 1)), + e && Ce(e) + ? ((this.path[this.path.length - 1].relation = + 'cell' + Ae(this.parent().array, e)), + this.setSelection(this.anchorOffset()), + this._announce('moveDown')) + : this.move(1, t); + } else this._announce('line'); + }), + (we.prototype.extend = function(t) { + let e = this.path[this.path.length - 1].offset, + i = 0; + const s = Se(this); + i = this.extent + t; + const a = e + i; + if (a < 0 && 0 !== i) { + if (this.path.length > 1) + return ( + this.selectionWillChange(), + this.path.pop(), + this.setExtent(-1), + this.selectionDidChange(), + void this._announce('move', s) + ); + (e = this.path[this.path.length - 1].offset), + (i = this.extent); + } else if (a >= this.siblings().length) { + if (this.path.length > 1) + return ( + this.selectionWillChange(), + this.path.pop(), + (this.path[this.path.length - 1].offset -= 1), + this.setExtent(1), + this.selectionDidChange(), + void this._announce('move', s) + ); + this.isCollapsed() && (e -= 1), (i -= 1); + } + this.setSelection(e, i), this._announce('move', s); + }), + (we.prototype.skip = function(t, e) { + const i = (e = e || { extend: !1 }).extend || !1; + t = t < 0 ? -1 : 1; + const s = Se(this), + a = this.siblings(), + o = this.focusOffset(); + let n = o + t; + if ( + (i && (n = Math.min(Math.max(0, n), a.length - 1)), + n < 0 || n >= a.length) + ) + this.move(t, e); + else { + if (a[n] && 'text' === a[n].mode) { + if (((n = this.wordBoundaryOffset(n, t)), n < 0 && !i)) + return void this.setSelection(0); + if (n > a.length) + return ( + this.setSelection(a.length - 1), + void this.move(t, e) + ); + } else { + const e = a[n] ? a[n].type : ''; + if ( + ('mopen' === e && t > 0) || + ('mclose' === e && t < 0) + ) { + let i = 'mopen' === e ? 1 : -1; + for ( + n += t > 0 ? 1 : -1; + n >= 0 && n < a.length && 0 !== i; + + ) + 'mopen' === a[n].type + ? (i += 1) + : 'mclose' === a[n].type && (i -= 1), + (n += t); + 0 !== i && (n = o + t), t > 0 && (n -= 1); + } else { + for ( + ; + a[n] && 'math' === a[n].mode && a[n].type === e; + + ) + n += t; + n -= t > 0 ? 1 : 0; + } + } + if (i) { + const t = this.anchorOffset(); + this.setSelection(t, n - t); + } else this.setSelection(n); + this._announce('move', s); + } + }), + (we.prototype.jump = function(t, e) { + const i = (e = e || { extend: !1 }).extend || !1; + t = t < 0 ? -1 : 1; + const s = this.siblings(); + let a = this.focusOffset(); + t > 0 && (a = Math.min(a + 1, s.length - 1)); + const o = t < 0 ? 0 : s.length - 1; + i ? this.extend(o - a) : this.move(o - a); + }), + (we.prototype.jumpToMathFieldBoundary = function(t, e) { + const i = (e = e || { extend: !1 }).extend || !1; + t = (t = t || 1) < 0 ? -1 : 1; + const s = Se(this), + a = [{ relation: 'body', offset: this.path[0].offset }]; + let o; + i + ? t < 0 + ? a[0].offset > 0 && (o = -a[0].offset) + : a[0].offset < this.siblings().length - 1 && + (o = this.siblings().length - 1 - a[0].offset) + : ((a[0].offset = t < 0 ? 0 : this.root.body.length - 1), + (o = 0)), + this.setPath(a, o), + this._announce('move', s); + }), + (we.prototype.leap = function(t, e) { + (t = (t = t || 1) < 0 ? -1 : 1), (e = e || !0); + const i = this.suppressChangeNotifications; + this.suppressChangeNotifications = !0; + const s = Se(this), + a = this.extent; + this.move(t), + 'placeholder' === this.anchor().type && this.move(t); + const o = this.filter( + (t, e) => + 'placeholder' === e.type || + (t.length > 1 && 1 === this.siblings().length), + t + ); + if (0 === o.length) { + if ((this.setPath(s, a), e)) + if (this.config.onTabOutOf) + this.config.onTabOutOf( + this.target, + t > 0 ? 'forward' : 'backward' + ); + else if (document.activeElement) { + const e = + 'a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])', + i = Array.prototype.filter.call( + document.querySelectorAll(e), + t => + ((t.offsetWidth > 0 || + t.offsetHeight > 0) && + !t.contains( + document.activeElement + )) || + t === document.activeElement + ); + let s = i.indexOf(document.activeElement) + t; + s < 0 && (s = i.length - 1), + s >= i.length && (s = 0), + i[s].focus(); + } + return (this.suppressChangeNotifications = i), !1; + } + return ( + this.selectionWillChange(), + this.setPath(o[0]), + 'placeholder' === this.anchor().type && this.setExtent(-1), + this._announce('move', s), + this.selectionDidChange(), + (this.suppressChangeNotifications = i), + !0 + ); + }), + (we.prototype.anchorMode = function() { + const t = this.isCollapsed() ? this.anchor() : this.sibling(1); + let e; + if (t) { + if ('commandliteral' === t.type || 'command' === t.type) + return 'command'; + e = t.mode; + } + let i = 1, + s = this.ancestor(i); + for (; !e && s; ) + s && (e = s.mode), (i += 1), (s = this.ancestor(i)); + return e; + }), + (we.prototype.anchorStyle = function() { + const t = this.isCollapsed() ? this.anchor() : this.sibling(1); + let e; + if (t && 'first' !== t.type) { + if ('commandliteral' === t.type || 'command' === t.type) + return {}; + e = { + color: t.color, + backgroundColor: t.backgroundColor, + fontFamily: t.fontFamily, + fontShape: t.fontShape, + fontSeries: t.fontSeries, + fontSize: t.fontSize, + }; + } + let i = 1, + s = this.ancestor(i); + for (; !e && s; ) + s && + (e = { + color: s.color, + backgroundColor: s.backgroundColor, + fontFamily: s.fontFamily, + fontShape: s.fontShape, + fontSeries: s.fontSeries, + fontSize: s.fontSize, + }), + (i += 1), + (s = this.ancestor(i)); + return e; + }), + (we.prototype.simplifyParen = function(t) { + if (t && this.config.removeExtraneousParentheses) { + for (let e = 0; t[e]; e++) + if ( + 'leftright' === t[e].type && + '(' === t[e].leftDelim && + Array.isArray(t[e].body) + ) { + let i = 0, + s = 0, + a = 0; + for (let o = 0; t[e].body[o]; o++) + 'genfrac' === t[e].body[o].type && + (i++, (s = o)), + 'first' !== t[e].body[o].type && a++; + 0 === a && 1 === i && (t[e] = t[e].body[s]); + } + t.forEach(t => { + if ( + ('genfrac' === t.type && + (this.simplifyParen(t.numer), + this.simplifyParen(t.denom), + (t.numer = ze(t.numer)), + (t.denom = ze(t.denom))), + t.superscript && + (this.simplifyParen(t.superscript), + (t.superscript = ze(t.superscript))), + t.subscript && + (this.simplifyParen(t.subscript), + (t.subscript = ze(t.subscript))), + t.underscript && + (this.simplifyParen(t.underscript), + (t.underscript = ze(t.underscript))), + t.overscript && + (this.simplifyParen(t.overscript), + (t.overscript = ze(t.overscript))), + t.index && + (this.simplifyParen(t.index), + (t.index = ze(t.index))), + 'surd' === t.type + ? (this.simplifyParen(t.body), + (t.body = ze(t.body))) + : t.body && + Array.isArray(t.body) && + this.simplifyParen(t.body), + t.array) + ) + for (let e = _e(t.array); e >= 0; e--) + this.simplifyParen(Ce(t.array, e)); + }); + } + }), + (we.prototype.insert = function(t, e) { + if ( + (e = e || {}).smartFence && + this._insertSmartFence(t, e.style) + ) + return; + const i = this.suppressChangeNotifications; + e.suppressChangeNotifications && + (this.suppressChangeNotifications = !0), + this.contentWillChange(); + const s = this.suppressChangeNotifications; + (this.suppressChangeNotifications = !0), + e.insertionMode || (e.insertionMode = 'replaceSelection'), + e.selectionMode || (e.selectionMode = 'placeholder'), + e.format || (e.format = 'auto'), + (e.macros = e.macros || this.config.macros); + const a = e.mode || this.anchorMode(); + let o; + const r = [this.getSelectedAtoms()]; + void 0 !== e.placeholder && (r['?'] = e.placeholder), + 'replaceSelection' !== e.insertionMode || this.isCollapsed() + ? 'replaceAll' === e.insertionMode + ? (this.root.body.splice(1), + (this.path = [{ relation: 'body', offset: 0 }]), + (this.extent = 0)) + : 'insertBefore' === e.insertionMode + ? this.collapseBackward() + : 'insertAfter' === e.insertionMode && + this.collapseForward() + : this.delete_(); + const l = this.siblings(), + c = this.startOffset(); + if ( + (c + 1 < l.length && + l[c + 1] && + 'placeholder' === l[c + 1].type + ? this.delete_(1) + : c > 0 && + l[c] && + 'placeholder' === l[c].type && + this.delete_(-1), + 'math' === a && 'ASCIIMath' === e.format) + ) + (t = Ee(t, { ...this.config, format: 'ASCIIMath' })), + (o = he.parseTokens(n(t), 'math', null, e.macros, !1)), + this.simplifyParen(o); + else if ('text' !== a && 'auto' === e.format) + if ('command' === a) { + o = []; + for (const e of t) + At.COMMAND_MODE_CHARACTERS.test(e) && + o.push( + new te.MathAtom('command', 'command', e) + ); + } else + '' === t + ? (o = [ + new te.MathAtom('command', 'command', '\\'), + ]) + : ((t = Ee(t, this.config)), + r[0] + ? (t = t.replace(/(^|[^\\])#@/g, '$1#0')) + : /(^|[^\\])#@/.test(t) + ? ((t = t.replace(/(^|[^\\])#@/g, '$1#0')), + (r[0] = this.extractArgBeforeInsertionPoint()), + this._deleteAtoms(-r[0].length), + Array.isArray(r[0]) && + 0 === r[0].length && + (r[0] = void 0)) + : (t = t.replace(/(^|[^\\])#@/g, '$1#?')), + (o = he.parseTokens( + n(t), + a, + r, + e.macros, + e.smartFence + )), + this.simplifyParen(o)); + else + 'latex' === e.format + ? (o = he.parseTokens( + n(t), + a, + r, + e.macros, + e.smartFence + )) + : ('text' !== a && 'text' !== e.format) || + ((t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = t.replace( + /\\/g, + '\\textbackslash ' + )).replace(/#/g, '\\#')).replace( + /\$/g, + '\\$' + )).replace(/%/g, '\\%')).replace( + /&/g, + '\\&' + )).replace(/_/g, '\\_')).replace( + /{/g, + '\\textbraceleft ' + )).replace(/}/g, '\\textbraceright ')).replace( + /\^/g, + '\\textasciicircum ' + )).replace(/~/g, '\\textasciitilde ')).replace( + /£/g, + '\\textsterling ' + )), + (o = he.parseTokens(n(t), 'text', r, e.macros, !1))); + !(function t(e, i) { + e && + i && + (Array.isArray(e) + ? e.forEach(e => t(e, i)) + : 'object' == typeof e && + (e.color || + e.backgroundColor || + e.fontFamily || + e.fontShape || + e.fontSeries || + e.fontSize || + (e.applyStyle(i), + t(e.body, i), + t(e.numer, i), + t(e.denom, i), + t(e.index, i), + t(e.overscript, i), + t(e.underscript, i), + t(e.subscript, i), + t(e.superscript, i)))); + })(o, e.style); + const h = this.parent(); + if ( + (this.config.removeExtraneousParentheses && + h && + 'leftright' === h.type && + '(' === h.leftDelim && + (function(t) { + return ( + 0 === t.length || + (1 === t.length && 'first' === t[0].type) + ); + })(h.body) && + o && + 1 === o.length && + 'genfrac' === o[0].type + ? (this.path.pop(), + (this.siblings()[this.anchorOffset()] = o[0])) + : Array.prototype.splice.apply( + this.siblings(), + [this.anchorOffset() + 1, 0].concat(o) + ), + this.insertFirstAtom(), + (this.suppressChangeNotifications = s), + 'placeholder' === e.selectionMode) + ) { + let t = []; + for (const e of o) + t = t.concat(e.filter(t => 'placeholder' === t.type)); + 0 !== t.length && this.leap(1, !1) + ? this._announce('move') + : this.setSelection(this.anchorOffset() + o.length); + } else + 'before' === e.selectionMode || + ('after' === e.selectionMode + ? this.setSelection(this.anchorOffset() + o.length) + : 'item' === e.selectionMode && + this.setSelection(this.anchorOffset(), o.length)); + this.contentDidChange(), (this.suppressChangeNotifications = i); + }), + (we.prototype._insertSmartFence = function(t, e) { + const i = this.parent(); + if ( + 'leftright' === i.type && + '|' !== i.leftDelim && + /\||\\vert|\\Vert|\\mvert|\\mid/.test(t) + ) + return ( + this.insert('\\,\\middle' + t + '\\, ', { + mode: 'math', + format: 'latex', + style: e, + }), + !0 + ); + ('{' !== t && '\\{' !== t) || (t = '\\lbrace'), + ('}' !== t && '\\}' !== t) || (t = '\\rbrace'), + ('[' !== t && '\\[' !== t) || (t = '\\lbrack'), + (']' !== t && '\\]' !== t) || (t = '\\rbrack'); + const s = At.RIGHT_DELIM[t]; + if (s && ('leftright' !== i.type || '|' !== i.leftDelim)) { + let i = ''; + const a = + this.isCollapsed() || + 'placeholder' === this.anchor().type; + (i = this.sibling(0).isFunction + ? '\\mleft' + t + '\\mright' + : '\\left' + t + '\\right'), + (i += a ? '?' : s); + let o = []; + return ( + a && + (o = this.siblings().splice( + this.anchorOffset() + 1, + this.siblings().length + )), + this.insert(i, { + mode: 'math', + format: 'latex', + style: e, + }), + a && ((this.sibling(0).body = o), this.move(-1)), + !0 + ); + } + let a; + if ( + (Object.keys(At.RIGHT_DELIM).forEach(e => { + t === At.RIGHT_DELIM[e] && (a = e); + }), + a) + ) { + if ( + i && + 'leftright' === i.type && + this.endOffset() === this.siblings().length - 1 + ) + return ( + this.contentWillChange(), + (i.rightDelim = t), + this.move(1), + this.contentDidChange(), + !0 + ); + const s = this.siblings(); + let a; + for ( + a = this.endOffset(); + a >= 0 && + ('leftright' !== s[a].type || '?' !== s[a].rightDelim); + a-- + ); + if (a >= 0) + return ( + this.contentWillChange(), + (s[a].rightDelim = t), + (s[a].body = s[a].body.concat( + s.slice(a + 1, this.endOffset() + 1) + )), + s.splice(a + 1, this.endOffset() - a), + this.setSelection(a), + this.contentDidChange(), + !0 + ); + if (i && 'leftright' === i.type && '?' === i.rightDelim) { + this.contentWillChange(), (i.rightDelim = t); + const e = s.slice(this.endOffset() + 1); + return ( + s.splice(this.endOffset() + 1), + this.path.pop(), + Array.prototype.splice.apply( + this.siblings(), + [this.endOffset() + 1, 0].concat(e) + ), + this.contentDidChange(), + !0 + ); + } + const o = this.ancestor(2); + return o && + 'leftright' === o.type && + '?' === o.rightDelim && + this.endOffset() === s.length - 1 + ? (this.move(1), this._insertSmartFence(t, e)) + : (this.insert(t, { + mode: 'math', + format: 'latex', + style: e, + }), + !0); + } + return !1; + }), + (we.prototype.positionInsertionPointAfterCommitedCommand = function() { + const t = this.siblings(), + e = this.commandOffsets(); + let i = e.start; + for (; i < e.end && !t[i].suggestion; ) i++; + this.setSelection(i - 1); + }), + (we.prototype.removeSuggestion = function() { + const t = this.siblings(); + for (let e = t.length - 1; e >= 0; e--) + t[e].suggestion && t.splice(e, 1); + }), + (we.prototype.insertSuggestion = function(t, e) { + this.removeSuggestion(); + const i = [], + s = t.substr(e); + for (const t of s) { + const e = new te.MathAtom('command', 'command', t); + (e.suggestion = !0), i.push(e); + } + Array.prototype.splice.apply( + this.siblings(), + [this.anchorOffset() + 1, 0].concat(i) + ); + }), + (we.prototype._deleteAtoms = function(t) { + t > 0 + ? this.siblings().splice(this.anchorOffset() + 1, t) + : (this.siblings().splice(this.anchorOffset() + t + 1, -t), + this.setSelection(this.anchorOffset() + t)); + }), + (we.prototype.delete = function(t) { + if (0 === (t = t || 0)) this.delete_(0); + else if (t > 0) for (; t > 0; ) this.delete_(1), t--; + else for (; t < 0; ) this.delete_(-1), t++; + }), + (we.prototype.delete_ = function(t) { + this.contentWillChange(), this.selectionWillChange(); + const e = this.suppressChangeNotifications; + if ( + ((this.suppressChangeNotifications = !0), + (t = (t = t || 0) < 0 ? -1 : t > 0 ? 1 : t), + this.removeSuggestion(), + this.parent().array && t < 0 && 0 === this.startOffset()) + ) { + const t = this.parent().array; + if ( + (function(t) { + const e = { col: 0, row: 0 }; + for (; e.row < t.length && !Ce(t, e); ) e.row += 1; + return Ce(t, e) ? 'cell' + Ae(t, e) : ''; + })(t) === this.relation() + ) { + const e = (function(t, e, i) { + e || (e = [';', ',']); + let s, + a = []; + for (const i of t) + s + ? a.push(s) + : (s = new te.MathAtom( + 'math', + 'mpunct', + e[0], + void 0 + )), + (a = a.concat(Te(i, e[1]))); + return a; + })(t); + this.path.pop(), + this.siblings().splice( + this.anchorOffset(), + 1, + ...e + ), + this.setSelection( + this.anchorOffset() - 1, + e.length + ); + } else { + const e = Me(t, this.relation()); + if (0 === e.col) { + const i = Le(t, e, -1); + (i.col = t[i.row].length - 1), + (this.path[this.path.length - 1].relation = + 'cell' + Ae(t, i)); + const s = t[i.row][i.col].length, + a = Te(t[e.row]); + (t[i.row][i.col] = t[i.row][i.col].concat(a)), + this.setSelection(s - 1, a.length), + (function(t, e) { + t.splice(e, 1); + })(t, e.row); + } else if ( + 0 === + (function(t, e) { + let i = 0; + const s = { col: e, row: 0 }; + for (; s.row < t.length; ) { + const e = Ce(t, s); + if (e && e.length > 0) { + let t = e.length; + 'first' === e[0].type && (t -= 1), + t > 0 && (i += 1); + } + s.row += 1; + } + return i; + })(t, e.col) + ) { + !(function(t, e) { + let i = 0; + for (; i < t.length; ) + t[i][e] && t[i].splice(e, 1), (i += 1); + })(t, e.col), + (e.col -= 1), + (this.path[this.path.length - 1].relation = + 'cell' + Ae(t, e)); + const i = t[e.row][e.col]; + this.setSelection(i.length - 1, 0); + } + } + return ( + (this.suppressChangeNotifications = e), + this.selectionDidChange(), + void this.contentDidChange() + ); + } + const i = this.siblings(); + if (this.isCollapsed()) { + const e = this.anchorOffset(); + if (t < 0) + if (0 !== e) { + const t = this.sibling(0); + 'leftright' === t.type + ? ((t.rightDelim = '?'), this.move(-1)) + : !t.captureSelection && + /^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test( + t.type + ) + ? this.move(-1) + : (this._announce( + 'delete', + null, + i.slice(e, e + 1) + ), + i.splice(e, 1), + this.setSelection(e - 1)); + } else { + const t = this.relation(); + if ('superscript' === t || 'subscript' === t) { + const e = this.parent()[t].filter( + t => + 'placeholder' !== t.type && + 'first' !== t.type + ); + (this.parent()[t] = null), + this.path.pop(), + Array.prototype.splice.apply( + this.siblings(), + [this.anchorOffset(), 0].concat(e) + ), + this.setSelection(this.anchorOffset() - 1), + this._announce('deleted: ' + t); + } else if ('denom' === t) { + const t = this.parent().numer.filter( + t => + 'placeholder' !== t.type && + 'first' !== t.type + ), + e = this.parent().denom.filter( + t => + 'placeholder' !== t.type && + 'first' !== t.type + ); + this.path.pop(), + Array.prototype.splice.apply( + this.siblings(), + [this.anchorOffset(), 1].concat(e) + ), + Array.prototype.splice.apply( + this.siblings(), + [this.anchorOffset(), 0].concat(t) + ), + this.setSelection( + this.anchorOffset() + t.length - 1 + ), + this._announce('deleted: denominator'); + } else if ('body' === t) { + const t = this.siblings().filter( + t => 'placeholder' !== t.type + ); + this.path.length > 1 && + (t.shift(), + this.path.pop(), + Array.prototype.splice.apply( + this.siblings(), + [this.anchorOffset(), 1].concat(t) + ), + this.setSelection(this.anchorOffset() - 1), + this._announce('deleted: root')); + } else this.move(-1), this.delete(-1); + } + else if (t > 0) + if (e !== i.length - 1) + /^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test( + this.sibling(1).type + ) + ? this.move(1) + : (this._announce( + 'delete', + null, + i.slice(e + 1, e + 2) + ), + i.splice(e + 1, 1)); + else if ('numer' === this.relation()) { + const t = this.parent().numer.filter( + t => + 'placeholder' !== t.type && + 'first' !== t.type + ), + e = this.parent().denom.filter( + t => + 'placeholder' !== t.type && + 'first' !== t.type + ); + this.path.pop(), + Array.prototype.splice.apply( + this.siblings(), + [this.anchorOffset(), 1].concat(e) + ), + Array.prototype.splice.apply( + this.siblings(), + [this.anchorOffset(), 0].concat(t) + ), + this.setSelection( + this.anchorOffset() + t.length - 1 + ), + this._announce('deleted: numerator'); + } else this.move(1), this.delete(-1); + } else { + const t = this.startOffset() + 1, + e = this.endOffset() + 1; + this._announce('deleted', null, i.slice(t, e)), + i.splice(t, e - t), + this.setSelection(t - 1); + } + (this.suppressChangeNotifications = e), + this.selectionDidChange(), + this.contentDidChange(); + }), + (we.prototype.moveToNextPlaceholder_ = function() { + this.leap(1); + }), + (we.prototype.moveToPreviousPlaceholder_ = function() { + this.leap(-1); + }), + (we.prototype.moveToNextChar_ = function() { + this.move(1); + }), + (we.prototype.moveToPreviousChar_ = function() { + this.move(-1); + }), + (we.prototype.moveUp_ = function() { + this.up(); + }), + (we.prototype.moveDown_ = function() { + this.down(); + }), + (we.prototype.moveToNextWord_ = function() { + this.skip(1); + }), + (we.prototype.moveToPreviousWord_ = function() { + this.skip(-1); + }), + (we.prototype.moveToGroupStart_ = function() { + this.setSelection(0); + }), + (we.prototype.moveToGroupEnd_ = function() { + this.setSelection(-1); + }), + (we.prototype.moveToMathFieldStart_ = function() { + this.jumpToMathFieldBoundary(-1); + }), + (we.prototype.moveToMathFieldEnd_ = function() { + this.jumpToMathFieldBoundary(1); + }), + (we.prototype.deleteNextChar_ = function() { + this.delete_(1); + }), + (we.prototype.deletePreviousChar_ = function() { + this.delete_(-1); + }), + (we.prototype.deleteNextWord_ = function() { + this.extendToNextBoundary(), this.delete_(); + }), + (we.prototype.deletePreviousWord_ = function() { + this.extendToPreviousBoundary(), this.delete_(); + }), + (we.prototype.deleteToGroupStart_ = function() { + this.extendToGroupStart(), this.delete_(); + }), + (we.prototype.deleteToGroupEnd_ = function() { + this.extendToMathFieldStart(), this.delete_(); + }), + (we.prototype.deleteToMathFieldEnd_ = function() { + this.extendToMathFieldEnd(), this.delete_(); + }), + (we.prototype.transpose_ = function() {}), + (we.prototype.extendToNextChar_ = function() { + this.extend(1); + }), + (we.prototype.extendToPreviousChar_ = function() { + this.extend(-1); + }), + (we.prototype.extendToNextWord_ = function() { + this.skip(1, { extend: !0 }); + }), + (we.prototype.extendToPreviousWord_ = function() { + this.skip(-1, { extend: !0 }); + }), + (we.prototype.extendUp_ = function() { + this.up({ extend: !0 }); + }), + (we.prototype.extendDown_ = function() { + this.down({ extend: !0 }); + }), + (we.prototype.extendToNextBoundary_ = function() { + this.skip(1, { extend: !0 }); + }), + (we.prototype.extendToPreviousBoundary_ = function() { + this.skip(-1, { extend: !0 }); + }), + (we.prototype.extendToGroupStart_ = function() { + this.setExtent(-this.anchorOffset()); + }), + (we.prototype.extendToGroupEnd_ = function() { + this.setExtent(this.siblings().length - this.anchorOffset()); + }), + (we.prototype.extendToMathFieldStart_ = function() { + this.jumpToMathFieldBoundary(-1, { extend: !0 }); + }), + (we.prototype.extendToMathFieldEnd_ = function() { + this.jumpToMathFieldBoundary(1, { extend: !0 }); + }), + (we.prototype.moveToSuperscript_ = function() { + if ((this.collapseForward(), !this.anchor().superscript)) + if (this.anchor().subscript) + this.anchor().superscript = [Be()]; + else { + const t = this.sibling(1); + t && t.superscript + ? (this.path[this.path.length - 1].offset += 1) + : t && t.subscript + ? ((this.path[this.path.length - 1].offset += 1), + (this.anchor().superscript = [Be()])) + : ('limits' !== this.anchor().limits && + (this.siblings().splice( + this.anchorOffset() + 1, + 0, + new te.MathAtom( + this.parent().anchorMode, + 'msubsup', + '​', + this.anchorStyle() + ) + ), + (this.path[ + this.path.length - 1 + ].offset += 1)), + (this.anchor().superscript = [Be()])); + } + this.path.push({ relation: 'superscript', offset: 0 }), + this.selectGroup_(); + }), + (we.prototype.moveToSubscript_ = function() { + if ((this.collapseForward(), !this.anchor().subscript)) + if (this.anchor().superscript) + this.anchor().subscript = [Be()]; + else { + const t = this.sibling(1); + t && t.subscript + ? (this.path[this.path.length - 1].offset += 1) + : t && t.superscript + ? ((this.path[this.path.length - 1].offset += 1), + (this.anchor().subscript = [Be()])) + : ('limits' !== this.anchor().limits && + (this.siblings().splice( + this.anchorOffset() + 1, + 0, + new te.MathAtom( + this.parent().anchorMode, + 'msubsup', + '​', + this.anchorStyle() + ) + ), + (this.path[ + this.path.length - 1 + ].offset += 1)), + (this.anchor().subscript = [Be()])); + } + this.path.push({ relation: 'subscript', offset: 0 }), + this.selectGroup_(); + }), + (we.prototype.moveToOpposite_ = function() { + const t = { + superscript: 'subscript', + subscript: 'superscript', + denom: 'numer', + numer: 'denom', + }[this.relation()]; + t || this.moveToSuperscript_(), + this.parent()[t] || (this.parent()[t] = [Be()]), + this.setSelection(0, 'end', t); + }), + (we.prototype.moveBeforeParent_ = function() { + this.path.length > 1 + ? (this.path.pop(), + this.setSelection(this.anchorOffset() - 1)) + : this._announce('plonk'); + }), + (we.prototype.moveAfterParent_ = function() { + if (this.path.length > 1) { + const t = Se(this); + this.path.pop(), + this.setExtent(0), + this._announce('move', t); + } else this._announce('plonk'); + }), + (we.prototype._addCell = function(t) { + const e = this.parent(); + if (e && 'array' === e.type && Array.isArray(e.array)) { + const i = this.relation(); + if (e.array) { + const s = Me(e.array, i); + 'after row' === t || 'before row' === t + ? ((s.col = 0), + (s.row = s.row + ('after row' === t ? 1 : 0)), + e.array.splice(s.row, 0, [[]])) + : ((s.col += 'after column' === t ? 1 : 0), + e.array[s.row].splice(s.col, 0, [])); + const a = Ae(e.array, s); + this.path.pop(), + this.path.push({ + relation: 'cell' + a.toString(), + offset: 0, + }), + this.insertFirstAtom(); + } + } + }), + (we.prototype.convertParentToArray = function() { + const t = this.parent(); + if ('leftright' === t.type) { + t.type = 'array'; + const e = + { + '(': 'pmatrix', + '\\lbrack': 'bmatrix', + '\\lbrace': 'cases', + }[t.leftDelim] || 'matrix', + i = At.getEnvironmentInfo(e), + s = [[t.body]]; + i.parser && Object.assign(t, i.parser(e, [], s)), + (t.tabularMode = i.tabular), + (t.parseMode = this.anchorMode()), + (t.env = { ...i }), + (t.env.name = e), + (t.array = s), + (t.rowGaps = [0]), + delete t.body, + (this.path[this.path.length - 1].relation = 'cell0'); + } + }), + (we.prototype.addRowAfter_ = function() { + this.contentWillChange(), + this.convertParentToArray(), + this._addCell('after row'), + this.contentDidChange(); + }), + (we.prototype.addRowBefore_ = function() { + this.contentWillChange(), + this.convertParentToArray(), + this._addCell('before row'), + this.contentDidChange(); + }), + (we.prototype.addColumnAfter_ = function() { + this.contentWillChange(), + this.convertParentToArray(), + this._addCell('after column'), + this.contentDidChange(); + }), + (we.prototype.addColumnBefore_ = function() { + this.contentWillChange(), + this.convertParentToArray(), + this._addCell('before column'), + this.contentDidChange(); + }), + (we.prototype._applyStyle = function(t) { + if (this.isCollapsed()) return; + const e = this; + function i(t, i) { + let s = !0; + return ( + e.forEachSelected( + e => { + s = s && e[t] === i; + }, + { recursive: !0 } + ), + s + ); + } + t.color && i('color', t.color) && (t.color = 'none'), + t.backgroundColor && + i('backgroundColor', t.backgroundColor) && + (t.backgroundColor = 'none'), + t.fontFamily && + i('fontFamily', t.fontFamily) && + (t.fontFamily = 'none'), + t.series && (t.fontSeries = t.series), + t.fontSeries && + i('fontSeries', t.fontSeries) && + (t.fontSeries = 'auto'), + t.shape && (t.fontShape = t.shape), + t.fontShape && + i('fontShape', t.fontShape) && + (t.fontShape = 'auto'), + t.size && (t.fontSize = t.size), + t.fontSize && + i('fontSize', t.fontSize) && + (t.fontSize = 'size5'), + this.contentWillChange(), + this.forEachSelected(e => e.applyStyle(t), { + recursive: !0, + }), + this.contentDidChange(); + }); + var Oe = { EditableMathlist: we, parseMathString: Ee }; + const Re = { + '#': '#', + '|': '|', + '[': 'BracketLeft', + ']': 'BracketRight', + '-': 'Minus', + '+': 'Plus', + '=': 'Equal', + '/': 'Slash', + '\\': 'Backslash', + }, + Ke = { + Space: 'Spacebar', + ' ': 'Spacebar', + Escape: 'Esc', + ArrowLeft: 'Left', + ArrowUp: 'Up', + ArrowRight: 'Right', + ArrowDown: 'Down', + Delete: 'Del', + }, + Ne = { + q: 'KeyQ', + w: 'KeyW', + e: 'KeyE', + r: 'KeyR', + t: 'KeyT', + y: 'KeyY', + u: 'KeyU', + i: 'KeyI', + o: 'KeyO', + p: 'KeyP', + a: 'KeyA', + s: 'KeyS', + d: 'KeyD', + f: 'KeyF', + g: 'KeyG', + h: 'KeyH', + j: 'KeyJ', + k: 'KeyK', + l: 'KeyL', + z: 'KeyZ', + x: 'KeyX', + c: 'KeyC', + v: 'KeyV', + b: 'KeyB', + n: 'KeyN', + m: 'KeyM', + 1: 'Digit1', + 2: 'Digit2', + 3: 'Digit3', + 4: 'Digit4', + 5: 'Digit5', + 6: 'Digit6', + 7: 'Digit7', + 8: 'Digit8', + 9: 'Digit9', + 0: 'Digit0', + '!': 'Shift-Digit1', + '@': 'Shift-Digit2', + '#': 'Shift-Digit3', + $: 'Shift-Digit4', + '%': 'Shift-Digit5', + '^': 'Shift-Digit6', + '&': 'Shift-Digit7', + '*': 'Shift-Digit8', + '(': 'Shift-Digit9', + ')': 'Shift-Digit0', + '-': 'Minus', + _: 'Shift-Minus', + '/': 'Slash', + '\\': 'Backslash', + '|': 'Shift-Backslash', + '?': 'Shift-Slash', + ' ': 'Spacebar', + }; + function $e(t) { + let e, + i = !0; + 'Unidentified' === t.key && + t.target && + (e = Ne[t.target.value] || t.target.value), + e || + (Re[t.key] ? ((e = Re[t.key]), (i = !1)) : (e = Ke[t.key]), + e || (e = Ne[t.key.toLowerCase()])), + !e && t.code && (e = Ke[t.code] || t.code); + const s = []; + return ( + t.ctrlKey && s.push('Ctrl'), + t.metaKey && s.push('Meta'), + i && t.altKey && s.push('Alt'), + i && t.shiftKey && s.push('Shift'), + 0 === s.length ? e : (s.push(e), s.join('-')) + ); + } + function We(t, e) { + let i, + s = null, + a = null, + o = !1, + n = !1; + function r(t) { + clearTimeout(i), + (i = setTimeout(function() { + clearTimeout(i), t(); + })); + } + function l() { + if ( + (function(t) { + return t.selectionStart !== t.selectionEnd; + })(t) + ) + return; + const i = t.value; + (t.value = ''), i.length > 0 && e.typedText(i); + } + const c = t || e.container; + c.addEventListener( + 'keydown', + function(i) { + if ( + ('function' == typeof e.allowDeadKey && + e.allowDeadKey()) || + ('Dead' !== i.key && + 'Unidentified' !== i.key && + 229 !== i.keyCode) + ) + n = !1; + else { + (n = !0), (o = !1); + const i = e.blur, + s = e.focus; + (e.blur = null), + (e.focus = null), + t.blur(), + t.focus(), + (e.blur = i), + (e.focus = s); + } + return ( + !( + !o && + 'CapsLock' !== i.code && + !/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code) + ) || ((s = i), (a = null), e.keystroke($e(i), i)) + ); + }, + !0 + ), + c.addEventListener( + 'keypress', + function(t) { + o || (s && a && e.keystroke($e(s), s), (a = t), r(l)); + }, + !0 + ), + c.addEventListener( + 'keyup', + function() { + o || !s || a || l(); + }, + !0 + ), + c.addEventListener( + 'paste', + function() { + t.focus(); + const i = t.value; + (t.value = ''), i.length > 0 && e.paste(i); + }, + !0 + ), + c.addEventListener( + 'copy', + function(t) { + e.copy && e.copy(t); + }, + !0 + ), + c.addEventListener( + 'cut', + function(t) { + e.cut && e.cut(t); + }, + !0 + ), + c.addEventListener( + 'blur', + function() { + (s = null), (a = null), e.blur && e.blur(); + }, + !0 + ), + c.addEventListener( + 'focus', + function() { + e.focus && e.focus(); + }, + !0 + ), + c.addEventListener( + 'compositionstart', + () => { + o = !0; + }, + !0 + ), + c.addEventListener( + 'compositionend', + () => { + (o = !1), r(l); + }, + !0 + ), + c.addEventListener('input', () => { + if (n) { + const i = e.blur, + s = e.focus; + (e.blur = null), + (e.focus = null), + t.blur(), + t.focus(), + (e.blur = i), + (e.focus = s), + (n = !1), + (o = !1), + r(l); + } else o || r(l); + }); + } + var He = { + delegateKeyboardEvents: We, + select: We.select, + keyboardEventToString: $e, + eventToChar: function(t) { + if (!t) return ''; + let e; + return ( + 'Unidentified' === t.key && + t.target && + (e = t.target.value), + (e = e || t.key || t.code), + /^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test( + e + ) && (e = ''), + e + ); + }, + charToEvent: function(t) { + return { + key: t, + metaKey: !1, + ctrlKey: !1, + altKey: !1, + shiftKey: !1, + }; + }, + }; + const Ve = { + '\\mathrm': '\\mathrm{x=+3.14, x\\in A}', + '\\mathbf': '\\mathbf{x=+3.14, x\\in A}', + '\\bf': '\\bf{x=+3.14, x\\in A}', + '\\bm': '\\bm{x=+3.14, x\\in A}', + '\\bold': '\\bold{x=+3.14, x\\in A}', + '\\mathit': '\\mathbb{x=+3.14}', + '\\mathbb': '\\mathbb{ABCD}', + '\\Bbb': '\\mathbb{ABCD}', + '\\frak': '\\frak{ABCD}', + '\\mathfrak': '\\mathfrak{ABCD}', + '\\mathscr': '\\mathscr{ABCD}', + '\\mathsf': '\\mathsf{ABab01}', + '\\mathtt': '\\mathtt{x=+3.14, x\\in A}', + '\\mathcal': '\\mathcal{ABCD}', + '\\boldsymbol': '\\boldsymbol{ABab01+=}', + '\\text': '\\text{ABC abc}', + '\\textrm': '\\textrm{ABC abc}', + '\\textnormal': '\\textnormal{ABC abc}', + '\\textit': '\\textit{ABC abc}', + '\\textbf': '\\textbf{ABC abc}', + '\\texttt': '\\texttt{ABC abc}', + '\\textsf': '\\textsf{ABC abc}', + '\\textcolor': + '{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}', + '\\color': + '{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}', + '\\underline': '\\underline{\\unicode{"2B1A}}', + '\\overline': '\\overline{\\unicode{"2B1A}}', + '\\vec': '\\vec{\\unicode{"25CC}}', + '\\check': '\\check{\\unicode{"25CC}}', + '\\acute': '\\acute{\\unicode{"25CC}}', + '\\breve': '\\breve{\\unicode{"25CC}}', + '\\tilde': '\\tilde{\\unicode{"25CC}}', + '\\hat': '\\hat{\\unicode{"25CC}}', + '\\ddot': '\\ddot{\\unicode{"25CC}}', + '\\dot': '\\dot{\\unicode{"25CC}}', + '\\bar': '\\bar{\\unicode{"25CC}}', + '\\!': '\\unicode{"203A}\\!\\unicode{"2039}', + '\\,': '\\unicode{"203A}\\,\\unicode{"2039}', + '\\:': '\\unicode{"203A}\\:\\unicode{"2039}', + '\\;': '\\unicode{"203A}\\;\\unicode{"2039}', + '\\quad': '\\unicode{"203A}\\quad\\unicode{"2039}', + '\\qquad': '\\unicode{"203A}\\qquad\\unicode{"2039}', + '\\enskip': '\\unicode{"203A}\\enskip\\unicode{"2039}', + '\\space': '\\unicode{"203A}\\space\\unicode{"2039}', + '\\frac': '\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}', + '\\dfrac': '\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}', + '\\cfrac': '\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}', + '\\tfrac': '\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}', + '\\dbinom': '\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}', + '\\tbinom': '\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}', + '\\binom': '\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}', + '\\pdiff': '\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}', + '\\in': 'n\\in\\N', + '\\notin': 'n\\notin\\N', + '\\not': 'B \\not A', + '\\ni': 'N\\in n', + '\\owns': 'N\\owns n', + '\\subset': 'A\\subset B', + '\\supset': 'B\\supset A', + '\\subseteq': 'A\\subseteq B', + '\\supseteq': 'B\\supseteq A', + '\\nsubseteq': 'A\\nsubseteq B', + '\\nsupseteq': 'B\\nsupseteq A', + '\\subsetneq': 'A\\subsetneq B', + '\\supsetneq': 'B\\supsetneq A', + '\\varsubsetneq': 'A\\varsubsetneq B', + '\\varsupsetneq': 'B\\varsupsetneq A', + '\\nsubseteqq': 'A\\varsupsetneq B', + '\\subsetneqq': 'A\\subsetneqq B', + '\\varsubsetneqq': 'A\\varsubsetneqq B', + '\\nsubset': 'A\\nsubset B', + '\\nsupset': 'B\\nsupset A', + '\\complement': 'A^\\complement', + '\\bigcup': '\\bigcup_{\\unicode{"2B1A}}', + '\\bigcap': '\\bigcap_{\\unicode{"2B1A}}', + '\\sqrt': '\\sqrt{\\unicode{"2B1A}}', + '\\prod': '\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}', + '\\sum': '\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}', + '\\int': '\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}', + '\\stackrel': '\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}', + '\\stackbin': '\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}', + '\\underset': '\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}', + '\\overset': '\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}', + '\\prime': '\\unicode{"2B1A}^{\\prime}', + '\\boxed': '\\boxed{\\unicode{"2B1A}}', + '\\colorbox': '\\colorbox{#fbc0bd}{\\unicode{"2B1A}}', + '\\bbox': + '\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}', + '\\enclose': + '\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}', + '\\fcolorbox': + '\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}', + '\\ ': '\\char"2423', + '\\top': '{\\color{red}P}\\top', + '\\bot': '{\\color{#0F0}P}\\bot', + '\\mid': 'P(p\\mid q)', + '\\rlap': '\\rlap{x}o', + '\\llap': 'o\\llap{/}', + }, + Ue = { + '\\text': 'roman text', + '\\textrm': 'roman text', + '\\textnormal': 'roman text', + '\\textit': 'italic text', + '\\textbf': 'bold text', + '\\texttt': 'monospaced text', + '\\textsf': 'sans-serif text', + '\\mathrm': ['roman', '(upright)'], + '\\mathbf': 'bold', + '\\bf': 'bold', + '\\bold': 'bold', + '\\mathit': 'italic', + '\\mathbb': 'blackboard', + '\\Bbb': 'blackboard', + '\\mathscr': 'script', + '\\mathtt': ['typewriter', '(monospaced)'], + '\\mathsf': 'sans-serif', + '\\mathcal': 'caligraphic', + '\\frak': ['fraktur', '(gothic)'], + '\\mathfrak': ['fraktur', '(gothic)'], + '\\textcolor': 'text color', + '\\color': 'color', + '\\forall': 'for all', + '\\exists': 'there exists', + '\\nexists': 'there does not exist', + '\\frac': 'fraction', + '\\dfrac': 'display fraction', + '\\cfrac': 'continuous fraction', + '\\tfrac': 'text fraction', + '\\binom': 'binomial coefficient', + '\\dbinom': 'display binomial coefficient', + '\\tbinom': 'text binomial coefficient', + '\\pdiff': 'partial differential', + '\\vec': 'vector', + '\\check': 'caron', + '\\acute': 'acute', + '\\breve': 'breve', + '\\tilde': 'tilde', + '\\dot': 'dot', + '\\hat': ['hat', 'circumflex'], + '\\ddot': 'double dot', + '\\bar': 'bar', + '\\prime': 'prime', + '\\doubleprime': 'double prime', + '\\varnothing': 'empty set', + '\\emptyset': 'empty set', + '\\subseteq': 'subset of or
    equal to', + '\\supseteq': 'superset of or
    equal to', + '\\supset': 'superset of', + '\\subset': 'subset of', + '\\partial': 'partial derivative', + '\\bigcup': 'union', + '\\bigcap': 'intersection', + '\\approx': 'approximately equal to', + '\\notin': 'not an element of', + '\\in': ['element of', 'included in'], + '\\infty': 'infinity', + '\\land': 'logical and', + '\\sqrt': 'square root', + '\\prod': 'product', + '\\sum': 'summation', + '\\amalg': [ + 'amalgamation', + 'coproduct', + 'free product', + 'disjoint union', + ], + '\\cup': 'union with', + '\\cap': 'intersection with', + '\\int': 'integral', + '\\iint': 'surface integral', + '\\oint': 'curve integral', + '\\iiint': 'volume integral', + '\\iff': 'if and only if', + '\\ln': 'natural logarithm', + '\\boldsymbol': 'bold', + '\\setminus': 'set subtraction', + '\\stackrel': 'relation with symbol above', + '\\stackbin': 'operator with symbol above', + '\\underset': 'symbol with annotation below', + '\\overset': 'symbol with annotation above', + '\\hslash': ['h-bar', 'Planck constant'], + '\\gtrsim': 'greater than or
    similar to', + '\\propto': 'proportional to', + '\\equiv': 'equivalent to', + '\\!': ['negative thin space', '(-3 mu)'], + '\\ ': ['space', '(6 mu)'], + '\\,': ['thin space', '(3 mu)'], + '\\:': ['medium space', '(4 mu)'], + '\\;': ['thick space', '(5 mu)'], + '\\quad': ['1 em space', '(18 mu)'], + '\\qquad': ['2 em space', '(36 mu)'], + '\\enskip': ['½ em space', '(9 mu)'], + '\\mp': 'minus or plus', + '\\pm': 'plus or minus', + '\\Im': 'Imaginary part of', + '\\Re': 'Real part of', + '\\gothicCapitalR': 'Real part of', + '\\gothicCapitalI': 'Imaginary part part of', + '\\differentialD': 'differential d', + '\\aleph': [ + 'aleph', + 'infinite cardinal', + 'Wikipedia ', + ], + '\\beth': [ + 'beth', + 'beth number', + 'Wikipedia ', + ], + '\\gimel': [ + 'gimel', + 'gimel function', + 'Wikipedia ', + ], + '\\O': 'empty set', + '\\N': 'set of
    natural numbers', + '\\Z': 'set of
    integers', + '\\Q': 'set of
    rational numbers', + '\\C': 'set of
    complex numbers', + '\\R': 'set of
    real numbers', + '\\P': 'set of
    prime numbers', + '\\lesseqqgtr': 'less than, equal to or
    greater than', + '\\gnapprox': 'greater than and
    not approximately', + '\\lnapprox': 'lesser than and
    not approximately', + '\\j': 'dotless j', + '\\i': 'dotless i', + '\\cdot': 'centered dot', + '\\lmoustache': 'left moustache', + '\\rmoustache': 'right moustache', + '\\nabla': ['nabla', 'del', 'differential vector operator'], + '\\square': [ + 'square', + 'd’Alembert operator', + 'Wikipedia ', + ], + '\\blacksquare': [ + 'black square', + 'end of proof', + 'tombstone', + 'Halmos symbol', + ], + '\\Box': 'end of proof', + '\\colon': ['such that', 'ratio'], + '\\coloneq': ['is defined by', 'is assigned'], + '\\Colon': ['is defined by', 'as'], + '\\_': ['underbar', 'underscore'], + '\\ll': 'much less than', + '\\gg': 'much greater than', + '\\doteq': 'approximately equal to', + '\\Doteq': 'approximately equal to', + '\\doteqdot': 'approximately equal to', + '\\cong': ['isomorphism of', '(for algebras, modules...)'], + '\\det': ['determinant of', '(of a matrix)'], + '\\dotplus': 'Cartesian product algebra', + '\\otimes': [ + 'tensor product', + '(of algebras)', + 'Kronecker product', + '(of matrices)', + ], + '\\oplus': ['direct sum', '(of modules)'], + '\\lb': 'base-2 logarithm', + '\\lg': 'base-10 logarithm', + '\\wp': [ + 'Weierstrass P', + 'Wikipedia ', + ], + '\\wr': [ + 'wreath product', + 'Wikipedia ', + ], + '\\top': ['tautology', 'Proposition P is universally true'], + '\\bot': ['contradiction', 'Proposition P is contradictory'], + '\\mid': ['probability', 'of event A given B'], + '\\mho': [ + 'Siemens', + 'electrical conductance in SI unit', + 'Wikipedia ', + ], + '\\Longrightarrow': 'implies', + '\\Longleftrightarrow': 'if, and only if,', + '\\prec': 'precedes', + '\\preceq': 'precedes or is equal to', + '\\succ': 'succeedes', + '\\succeq': 'succeedes or is equal to', + '\\perp': ['is perpendicular to', 'is independent of'], + '\\models': [ + 'entails', + 'double-turnstyle, models', + 'is a semantic consequence of', + 'Wikipedia ', + ], + '\\vdash': [ + 'satisfies', + 'turnstyle, assertion sign', + 'syntactic inference', + 'Wikipedia ', + ], + '\\implies': ['implies', 'logical consequence'], + '\\impliedby': ['implied by', 'logical consequence'], + '\\surd': ['surd', 'root of', 'checkmark'], + '\\ltimes': [ + 'semi direct product', + 'Wikipedia ', + ], + '\\rtimes': [ + 'semi direct product', + 'Wikipedia ', + ], + '\\leftthreetimes': [ + 'semi direct product', + 'Wikipedia ', + ], + '\\rightthreetimes': [ + 'semi direct product', + 'Wikipedia ', + ], + '\\divideontimes': ['divide on times'], + '\\curlywedge': 'nor', + '\\curlyvee': 'nand', + '\\simeq': 'is group isomorphic with', + '\\vartriangleleft': [ + 'is a normal subgroup of', + 'is an ideal ring of', + ], + '\\circ': ['circle', 'ring', 'function composition'], + '\\rlap': ['overlap right', '\\rlap{x}o'], + '\\llap': ['overlap left', 'o\\llap{/}'], + '\\colorbox': ['color box', '\\colorbox{#fbc0bd}{...}'], + '\\ast': ['asterisk', 'reflexive closure (as a superscript)'], + '\\bullet': 'bullet', + '\\lim': 'limit', + }; + function je(t) { + let e = Ue[t] || ''; + return Array.isArray(e) && (e = e.join('
    ')), e; + } + function Ge(t, e) { + t.popover.innerHTML = e; + const i = t._getCaretPosition(); + i && Ze(t, i), t.popover.classList.add('is-visible'); + } + function Ze(t, e) { + const i = + window.innerHeight || + document.documentElement.clientHeight || + document.body.clientHeight, + s = + window.innerWidth || + document.documentElement.clientWidth || + document.body.clientWidth, + a = window.innerWidth - document.documentElement.clientWidth, + o = window.innerHeight - document.documentElement.clientHeight, + n = t.virtualKeyboardVisible + ? t.virtualKeyboard.offsetHeight + : 0; + e.x + t.popover.offsetWidth / 2 > s - a + ? (t.popover.style.left = s - t.popover.offsetWidth - a + 'px') + : e.x - t.popover.offsetWidth / 2 < 0 + ? (t.popover.style.left = 0) + : (t.popover.style.left = + e.x - t.popover.offsetWidth / 2 + 'px'), + e.y + t.popover.offsetHeight + 5 > i - o - n + ? (t.popover.classList.add('reverse-direction'), + (t.popover.style.top = + e.y - e.height - t.popover.offsetHeight - 5 + 'px')) + : (t.popover.classList.remove('reverse-direction'), + (t.popover.style.top = e.y + 5 + 'px')); + } + function Xe(t) { + t.popover.classList.remove('is-visible'); + } + var Je = { + getNote: je, + SAMPLES: Ve, + NOTES: Ue, + showPopoverWithLatex: function(t, e, i) { + if (!e || 0 === e.length) return void Xe(t); + const s = e, + a = (function(t, e) { + const i = he.parseTokens( + n(t), + 'math', + null, + e.config.macros + ), + s = te.decompose( + { + mathstyle: 'displaystyle', + macros: e.config.macros, + }, + i + ), + a = $.makeSpan(s, 'ML__base'), + o = $.makeSpan('', 'ML__strut'); + o.setStyle('height', a.height, 'em'); + const r = $.makeSpan('', 'ML__strut--bottom'); + return ( + r.setStyle('height', a.height + a.depth, 'em'), + r.setStyle('vertical-align', -a.depth, 'em'), + $.makeSpan([o, r, a], 'ML__mathlive').toMarkup() + ); + })(Ve[s] || e, t), + o = je(s), + r = ve.forCommand(s); + let l = i + ? '
    ' + : ''; + (l += ''), + (l += '
    ' + a + '
    '), + o && + (l += '
    ' + o + '
    '), + r && + (l += + '
    ' + + r + + '
    '), + (l += '
    '), + (l += i + ? '
    ' + : ''), + Ge(t, l); + let c = t.popover.getElementsByClassName( + 'ML__popover__content' + ); + c && + c.length > 0 && + t._attachButtonHandlers(c[0], [ + 'complete', + { acceptSuggestion: !0 }, + ]), + (c = t.popover.getElementsByClassName( + 'ML__popover__prev-shortcut' + )), + c && + c.length > 0 && + t._attachButtonHandlers(c[0], 'previousSuggestion'), + (c = t.popover.getElementsByClassName( + 'ML__popover__next-shortcut' + )), + c && + c.length > 0 && + t._attachButtonHandlers(c[0], 'nextSuggestion'); + }, + showPopover: Ge, + hidePopover: Xe, + updatePopoverPosition: function t(e, i) { + if ( + e.element && + e.element.mathfield === e && + e.popover.classList.contains('is-visible') + ) + if (i && i.deferred) + window.requestAnimationFrame(() => t(e)); + else if ( + e.mathlist.anchor() && + 'command' === e.mathlist.anchor().type + ) { + const t = e._getCaretPosition(); + t && Ze(e, t); + } else Xe(e); + }, + }; + function Ye(t, e, i) { + let s = ''; + if (Array.isArray(e) && e.length > 0) { + if ('first' === e[0].type && 0 === (e = e.slice(1)).length) + return ''; + s = (function t(e, i, s, a) { + if (0 === s.length) return ''; + if (0 === i.length) + return s.map(t => t.toLatex(a)).join(''); + let o = '', + n = '', + r = ''; + const l = i[0]; + let c = s[0][l]; + 'fontFamily' === l && + (c = s[0].fontFamily || s[0].baseFontFamily); + const h = (function(t, e, i) { + let s = 0; + if ('fontFamily' === e) + for ( + ; + t[s] && + ('mop' === t[s].type || + (t[s].fontFamily || t[s].baseFontFamily) === + i); + + ) + s++; + else + for ( + ; + t[s] && ('mop' === t[s].type || t[s][e] === i); + + ) + s++; + return s; + })(s, l, c); + if ('text' === s[0].mode) { + if ('fontShape' === l && s[0].fontShape) + 'it' === s[0].fontShape + ? ((n = '\\textit{'), (r = '}')) + : 'sl' === s[0].fontShape + ? ((n = '\\textsl{'), (r = '}')) + : 'sc' === s[0].fontShape + ? ((n = '\\textsc{'), (r = '}')) + : 'n' === s[0].fontShape + ? ((n = '\\textup{'), (r = '}')) + : ((n = + '\\text{\\fontshape{' + + s[0].fontShape + + '}'), + (r = '}')); + else if ('fontSeries' === l && s[0].fontSeries) + 'b' === s[0].fontSeries + ? ((n = '\\textbf{'), (r = '}')) + : 'l' === s[0].fontSeries + ? ((n = '\\textlf{'), (r = '}')) + : 'm' === s[0].fontSeries + ? ((n = '\\textmd{'), (r = '}')) + : ((n = + '\\text{\\fontseries{' + + s[0].fontSeries + + '}'), + (r = '}')); + else if ('mode' === l) { + let t = !0; + for (let e = 0; e < h; e++) + if ( + !( + s[e].fontSeries || + s[e].fontShape || + s[e].fontFamily || + s[e].baseFontFamily + ) + ) { + t = !1; + break; + } + t || ((n = '\\text{'), (r = '}')); + } else if ('fontSize' === l && s[0].fontSize) + (n = + '{\\' + + ({ + size1: 'tiny', + size2: 'scriptsize', + size3: 'footnotesize', + size4: 'small', + size5: 'normalsize', + size6: 'large', + size7: 'Large', + size8: 'LARGE', + size9: 'huge', + size10: 'Huge', + }[s[0].fontSize] || '') + + ' '), + (r = '}'); + else if ( + 'fontFamily' === l && + (s[0].fontFamily || s[0].baseFontFamily) + ) { + const t = + { + cmr: 'textrm', + cmtt: 'texttt', + cmss: 'textsf', + }[s[0].fontFamily || s[0].baseFontFamily] || ''; + t + ? ((n = '\\' + t + '{'), (r = '}')) + : ((n += + '{\\fontfamily{' + + (s[0].fontFamily || s[0].baseFontFamily) + + '}'), + (r = '}')); + } + } else if ('math' === s[0].mode) + if ('fontSeries' === l) + 'b' === s[0].fontSeries + ? ((n = '\\mathbf{'), (r = '}')) + : s[0].fontSeries && + 'n' !== s[0].fontSeries && + ((n = + '{\\fontSeries{' + s[0].fontSeries + '}'), + (r = '}')); + else if ('fontShape' === l) + 'it' === s[0].fontShape + ? ((n = '\\mathit{'), (r = '}')) + : 'n' === s[0].fontShape + ? ((n = '{\\upshape '), (r = '}')) + : s[0].fontShape && + 'n' !== s[0].fontShape && + ((n = '{\\fontShape{' + s[0].fontShape + '}'), + (r = '}')); + else if ('fontSize' === l && s[0].fontSize) + (n = + '{\\' + + ({ + size1: 'tiny', + size2: 'scriptsize', + size3: 'footnotesize', + size4: 'small', + size5: 'normalsize', + size6: 'large', + size7: 'Large', + size8: 'LARGE', + size9: 'huge', + size10: 'Huge', + }[s[0].fontSize] || '') + + ' '), + (r = '}'); + else if ('fontFamily' === l && s[0].fontFamily) { + if (!/^(math|main)$/.test(s[0].fontFamily)) { + const o = + { + cal: 'mathcal', + frak: 'mathfrak', + bb: 'mathbb', + scr: 'mathscr', + cmr: 'mathrm', + cmtt: 'mathtt', + cmss: 'mathsf', + }[s[0].fontFamily] || ''; + if (o) { + if (/^\\operatorname{/.test(s[0].latex)) + return ( + s[0].latex + t(e, i, s.slice(h), a) + ); + s[0].isFunction || + ((n = '\\' + o + '{'), (r = '}')), + (i = []); + } else + (n += + '{\\fontfamily{' + + s[0].fontFamily + + '}'), + (r = '}'); + } + } else if ('fontFamily' === l && s[0].baseFontFamily) + if (s[0].latex && s[0].latex.startsWith('\\')) + (n = ''), (r = ''); + else { + const t = + { + cal: 'mathcal', + frak: 'mathfrak', + bb: 'mathbb', + scr: 'mathscr', + cmr: 'mathrm', + cmtt: 'mathtt', + cmss: 'mathsf', + }[s[0].baseFontFamily] || ''; + t && ((n = '\\' + t + '{'), (r = '}')); + } + return ( + 'color' !== l || + !s[0].color || + 'none' === s[0].color || + (e && e.color === s[0].color) || + ((n = '\\textcolor{' + ae(s[0].color) + '}{'), + (r = '}')), + 'backgroundColor' !== l || + !s[0].backgroundColor || + 'none' === s[0].backgroundColor || + (e && e.backgroundColor === s[0].backgroundColor) || + ((n = + '\\colorbox{' + + ae(s[0].backgroundColor) + + '}{'), + (r = '}')), + (o += n), + (o += t(e, i.slice(1), s.slice(0, h), a)), + (o += r), + (o += t(e, i, s.slice(h), a)), + o + ); + })( + t, + [ + 'mode', + 'color', + 'backgroundColor', + 'fontSize', + 'fontFamily', + 'fontShape', + 'fontSeries', + ], + e, + i + ); + } else + 'number' == typeof e || 'boolean' == typeof e + ? (s = e.toString()) + : 'string' == typeof e + ? (s = e.replace(/\s/g, '~')) + : e && 'function' == typeof e.toLatex && (s = e.toLatex(i)); + return s; + } + function Qe(t) { + const e = Qe.locale.substring(0, 2); + let i = ''; + return ( + Qe.strings[Qe.locale] && (i = Qe.strings[Qe.locale][t]), + !i && Qe.strings[e] && (i = Qe.strings[e][t]), + i || (i = Qe.strings.en[t]), + i || (i = t), + i + ); + } + (te.MathAtom.prototype.toLatex = function(t) { + t = void 0 !== t && t; + let e, + i = '', + s = 0, + a = 0; + const o = this.latex ? this.latex.match(/^(\\[^{\s0-9]+)/) : null, + n = o ? o[1] : null; + switch (this.type) { + case 'group': + (i += + this.latexOpen || + (this.cssId || this.cssClass ? '' : '{')), + this.cssId && (i += '\\cssId{' + this.cssId + '}{'), + 'ML__emph' === this.cssClass + ? (i += '\\emph{' + Ye(this, this.body, t) + '}') + : (this.cssClass && + (i += '\\class{' + this.cssClass + '}{'), + (i += t + ? Ye(this, this.body, !0) + : this.latex || Ye(this, this.body, !1)), + this.cssClass && (i += '}')), + this.cssId && (i += '}'), + (i += + this.latexClose || + (this.cssId || this.cssClass ? '' : '}')); + break; + case 'array': + if ( + ((i += '\\begin{' + this.env.name + '}'), + 'array' === this.env.name) + ) { + if (((i += '{'), this.colFormat)) + for (a = 0; a < this.colFormat.length; a++) + this.colFormat[a].align + ? (i += this.colFormat[a].align) + : this.colFormat[a].rule && (i += '|'); + i += '}'; + } + for (s = 0; s < this.array.length; s++) { + for (e = 0; e < this.array[s].length; e++) + e > 0 && (i += ' & '), + (i += Ye(this, this.array[s][e], t)); + s < this.array.length - 1 && (i += ' \\\\ '); + } + i += '\\end{' + this.env.name + '}'; + break; + case 'root': + i = Ye(this, this.body, t); + break; + case 'genfrac': + /^(choose|atop|over)$/.test(this.body) + ? ((i += '{'), + (i += Ye(this, this.numer, t)), + (i += '\\' + this.body + ' '), + (i += Ye(this, this.denom, t)), + (i += '}')) + : ((i += n), + (i += `{${Ye(this, this.numer, t)}}{${Ye( + this, + this.denom, + t + )}}`)); + break; + case 'surd': + (i += '\\sqrt'), + this.index && + ((i += '['), + (i += Ye(this, this.index, t)), + (i += ']')), + (i += `{${Ye(this, this.body, t)}}`); + break; + case 'leftright': + this.inner + ? ((i += '\\left' + (this.leftDelim || '.')), + this.leftDelim && + this.leftDelim.length > 1 && + (i += ' '), + (i += Ye(this, this.body, t)), + (i += '\\right' + (this.rightDelim || '.')), + this.rightDelim && + this.rightDelim.length > 1 && + (i += ' ')) + : t && '(' === this.leftDelim && ')' === this.rightDelim + ? (i += '(' + Ye(this, this.body, t) + ')') + : ((i += '\\mleft' + (this.leftDelim || '.')), + this.leftDelim && + this.leftDelim.length > 1 && + (i += ' '), + (i += Ye(this, this.body, t)), + (i += '\\mright' + (this.rightDelim || '.')), + this.rightDelim && + this.rightDelim.length > 1 && + (i += ' ')); + break; + case 'delim': + case 'sizeddelim': + i += n + '{' + this.delim + '}'; + break; + case 'rule': + (i += n), + this.shift && (i += `[${Ye(this, this.shift, t)}em]`), + (i += `{${Ye(this, this.width, t)}em}{${Ye( + this, + this.height, + t + )}em}`); + break; + case 'line': + case 'overlap': + case 'accent': + i += `${n}{${Ye(this, this.body, t)}}`; + break; + case 'overunder': + i += `${n}{${Ye( + this, + this.overscript || this.underscript, + t + )}}{${Ye(parent, this.body, t)}}`; + break; + case 'mord': + case 'minner': + case 'mbin': + case 'mrel': + case 'mpunct': + case 'mopen': + case 'mclose': + case 'textord': + case '': + /^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test( + n + ) + ? (i += n + '{' + Ye(this, this.body, t) + '}') + : '\\char"' === n + ? (i += this.latex + ' ') + : '\\unicode' === n + ? ((i += '\\unicode{"'), + (i += ( + '000000' + this.body.charCodeAt(0).toString(16) + ) + .toUpperCase() + .substr(-6)), + (i += '}')) + : (this.latex || 'string' == typeof this.body) && + (this.latex && '\\' === this.latex[0] + ? ((i += this.latex), + /[a-zA-Z0-9]$/.test(this.latex) && (i += ' ')) + : (i += + n || + ('​' !== this.body + ? this.latex || this.body + : ''))); + break; + case 'mop': + '​' !== this.body && + ('\\mathop' === n + ? (i += n + '{' + Ye(this, this.body, t) + '}') + : '\\operatorname' === n + ? (i += n + '{' + Ye(this, this.body, t) + '}') + : this.latex && '\\' === this.latex[0] + ? ((i += this.latex), + /[a-zA-Z0-9]$/.test(this.latex) && (i += ' ')) + : (i += + n || + ('​' !== this.body + ? this.latex || this.body + : ''))), + this.explicitLimits && + ('limits' === this.limits && (i += '\\limits '), + 'nolimits' === this.limits && (i += '\\nolimits ')); + break; + case 'box': + if ('\\bbox' === n) { + if ( + ((i += n), + isFinite(this.padding) || + void 0 !== this.border || + void 0 !== this.backgroundcolor) + ) { + const t = []; + isFinite(this.padding) && + t.push( + Math.floor(100 * this.padding) / 100 + 'em' + ), + this.border && t.push('border:' + this.border), + this.backgroundcolor && + t.push(ae(this.backgroundcolor)), + (i += `[${t.join(',')}]`); + } + i += `{${Ye(this, this.body, t)}}`; + } else + '\\boxed' === n + ? (i += `\\boxed{${Ye(this, this.body, t)}}`) + : ((i += n), + this.framecolor && + (i += `{${ae(this.framecolor)}}`), + this.backgroundcolor && + (i += `{${ae(this.backgroundcolor)}}`), + (i += `{${Ye(this, this.body, t)}}`)); + break; + case 'spacing': + (i += n), + '\\hspace' === n || '\\hspace*' === n + ? ((i += '{'), + this.width + ? (i += this.width + 'em') + : (i += '0em'), + (i += '}')) + : ((i += ' '), + this.width && (i += this.width + 'em ')); + break; + case 'enclose': + if (((i += n), '\\enclose' === n)) { + i += '{'; + let t = ''; + for (const e in this.notation) + Object.prototype.hasOwnProperty.call( + this.notation, + e + ) && + this.notation[e] && + ((i += t + e), (t = ' ')); + i += '}'; + let e = ''; + (t = ''), + this.backgroundcolor && + 'transparent' !== this.backgroundcolor && + ((e += + t + + 'mathbackground="' + + ae(this.backgroundcolor) + + '"'), + (t = ',')), + this.shadow && + 'auto' !== this.shadow && + ((e += t + 'shadow="' + this.shadow + '"'), + (t = ',')), + 1 !== this.strokeWidth || + 'solid' !== this.strokeStyle + ? ((e += t + this.borderStyle), (t = ',')) + : this.strokeColor && + 'currentColor' !== this.strokeColor && + ((e += + t + + 'mathcolor="' + + ae(this.strokeColor) + + '"'), + (t = ',')), + e && (i += `[${e}]`); + } + i += `{${Ye(this, this.body, t)}}`; + break; + case 'mathstyle': + i += '\\' + this.mathstyle + ' '; + break; + case 'space': + i += this.latex; + break; + case 'placeholder': + i += '\\placeholder{' + (this.value || '') + '}'; + break; + case 'first': + case 'command': + case 'msubsup': + break; + case 'error': + i += this.latex; + } + if (this.superscript) { + let e = Ye(this, this.superscript, t); + 1 === e.length + ? ('′' === e + ? (e = '\\prime ') + : '″' === e && (e = '\\doubleprime '), + (i += '^' + e)) + : (i += '^{' + e + '}'); + } + if (this.subscript) { + const e = Ye(this, this.subscript, t); + 1 === e.length ? (i += '_' + e) : (i += '_{' + e + '}'); + } + return i; + }), + (Qe.plural = function(t, e, i) { + (i = i || {}).type = i.type || 'cardinal'; + const s = Qe.locale.substring(0, 2), + a = 'ordinal' === i.type ? Qe.ordinal : Qe.cardinal; + let o, + n = + 'ordinal' === i.type + ? Qe._ordinalPluralCategories.indexOf(a.select(t)) + : Qe._cardinalPluralCategories.indexOf(a.select(t)); + return ( + Qe.strings[Qe.locale] && (o = Qe.strings[Qe.locale][e]), + !o && Qe.strings[s] && (o = Qe.strings[s][e]), + o || + ((o = Qe.strings.en[e]), + o || (o = e), + (n = + 'ordinal' === i.type + ? Qe._ordinalPluralCategories.indexOf( + Qe._ordinalEnglish.select(t) + ) + : Qe._cardinalPluralCategories.indexOf( + Qe._cardinalEnglish.select(t) + ))), + o.split(';')[n] || o.split(';')[0] + ); + }), + (Qe.merge = function(t, e) { + if (t && e) { + const i = Qe._locale; + (Qe.locale = t), + (Qe.strings[t] = { ...Qe.strings[t], ...e }), + (Qe.locale = i); + } else + t && + !e && + ((e = t), + Object.keys(e).forEach(t => Qe.merge(t, e[t]))); + }), + Object.defineProperty(Qe, 'locale', { + set(t) { + (Qe._locale = t), + (Qe._ordinal = null), + (Qe._cardinal = null); + }, + get: () => ( + Qe._locale || + (Qe._locale = + 'undefined' == typeof navigator + ? 'en' + : navigator.language.slice(0, 5)), + Qe._locale + ), + }), + Object.defineProperty(Qe, 'ordinal', { + get: () => ( + Qe._ordinal || + ((Qe._ordinalEnglish = new Intl.PluralRules('en', { + type: 'ordinal', + })), + (Qe._ordinalEnglishPluralCategories = Qe._ordinalEnglish.resolvedOptions().pluralCategories), + (Qe._ordinal = new Intl.PluralRules(Qe.locale, { + type: 'ordinal', + })), + (Qe._ordinalPluralCategories = Qe._ordinal.resolvedOptions().pluralCategories)), + Qe._ordinal + ), + }), + Object.defineProperty(Qe, 'cardinal', { + get: () => ( + Qe._cardinal || + ((Qe._cardinalEnglish = new Intl.PluralRules('en', { + type: 'cardinal', + })), + (Qe._cardinalEnglishPluralCategories = Qe._cardinalEnglish.resolvedOptions().pluralCategories), + (Qe._cardinal = new Intl.PluralRules(Qe.locale, { + type: 'cardinal', + })), + (Qe._cardinaPluralCategories = Qe._ordinal.resolvedOptions().pluralCategories)), + Qe._cardinal + ), + }), + (Qe.strings = { + en: { + 'keyboard.tooltip.functions': 'Functions', + 'keyboard.tooltip.greek': 'Greek Letters', + 'keyboard.tooltip.command': 'LaTeX Command Mode', + 'keyboard.tooltip.numeric': 'Numeric', + 'keyboard.tooltip.roman': 'Symbols and Roman Letters', + 'tooltip.copy to clipboard': 'Copy to Clipboard', + 'tooltip.redo': 'Redo', + 'tooltip.toggle virtual keyboard': + 'Toggle Virtual Keyboard', + 'tooltip.undo': 'Undo', + }, + ar: { + 'keyboard.tooltip.functions': 'مهام', + 'keyboard.tooltip.greek': 'حروف يونانية', + 'keyboard.tooltip.command': 'حالة تلقي الأوامر اللاتك', + 'keyboard.tooltip.numeric': 'الرقمية', + 'keyboard.tooltip.roman': 'رموز الاحرف الرومانية', + 'tooltip.copy to clipboard': 'نسخ إلى الحافظة', + 'tooltip.redo': 'الإعادة', + 'tooltip.toggle virtual keyboard': + 'تبديل لوحة المفاتيح الإفتراضية', + 'tooltip.undo': 'إلغاء', + }, + de: { + 'keyboard.tooltip.functions': 'Funktionen', + 'keyboard.tooltip.greek': 'Griechische Buchstaben', + 'keyboard.tooltip.command': 'LaTeX-Befehlsmodus', + 'keyboard.tooltip.numeric': 'Numerisch', + 'keyboard.tooltip.roman': 'Symbole und römische Buchstaben', + 'tooltip.copy to clipboard': + 'In die Zwischenablage kopieren', + 'tooltip.redo': 'Wiederholen', + 'tooltip.toggle virtual keyboard': + 'Virtuelle Tastatur umschalten', + 'tooltip.undo': 'Widerrufen', + }, + el: { + 'keyboard.tooltip.functions': 'συναρτήσεις', + 'keyboard.tooltip.greek': 'ελληνικά γράμματα', + 'keyboard.tooltip.command': 'Λειτουργία εντολών LaTeX', + 'keyboard.tooltip.numeric': 'Αριθμητικός', + 'keyboard.tooltip.roman': 'Σύμβολα και ρωμαϊκά γράμματα', + 'tooltip.copy to clipboard': 'Αντιγραφή στο πρόχειρο', + 'tooltip.redo': 'Ξανακάνω', + 'tooltip.toggle virtual keyboard': + 'Εναλλαγή εικονικού πληκτρολογίου', + 'tooltip.undo': 'Ξεκάνω', + }, + es: { + 'keyboard.tooltip.functions': 'Funciones', + 'keyboard.tooltip.greek': 'Letras griegas', + 'keyboard.tooltip.command': 'Modo Comando LaTeX', + 'keyboard.tooltip.numeric': 'Numérico', + 'keyboard.tooltip.roman': 'Símbolos y letras romanas', + 'tooltip.copy to clipboard': 'Copiar al portapapeles', + 'tooltip.redo': 'Rehacer', + 'tooltip.toggle virtual keyboard': + 'Alternar teclado virtual', + 'tooltip.undo': 'Deshacer', + }, + fa: { + 'keyboard.tooltip.functions': 'توابع', + 'keyboard.tooltip.greek': 'حروف یونانی', + 'keyboard.tooltip.command': 'حالت دستور لاتک', + 'keyboard.tooltip.numeric': 'عددی', + 'keyboard.tooltip.roman': 'علائم و حروف لاتین', + 'tooltip.copy to clipboard': 'کپی به کلیپبورد', + 'tooltip.redo': 'بازگشت به بعد', + 'tooltip.toggle virtual keyboard': + 'نمایش/نهفتن کیبورد مجازی', + 'tooltip.undo': 'بازگشت به قبل', + }, + fr: { + 'keyboard.tooltip.functions': 'Fonctions', + 'keyboard.tooltip.greek': 'Lettres grecques', + 'keyboard.tooltip.command': 'Mode de commandes LaTeX', + 'keyboard.tooltip.numeric': 'Numérique', + 'keyboard.tooltip.roman': 'Lettres et symboles romains', + 'tooltip.copy to clipboard': + 'Copier dans le presse-papiers', + 'tooltip.redo': 'Rétablir', + 'tooltip.toggle virtual keyboard': + 'Afficher/Masquer le clavier virtuel', + 'tooltip.undo': 'Annuler', + }, + it: { + 'keyboard.tooltip.functions': 'Funzioni', + 'keyboard.tooltip.greek': 'Lettere greche', + 'keyboard.tooltip.command': 'Modalità di comando LaTeX', + 'keyboard.tooltip.numeric': 'Numerico', + 'keyboard.tooltip.roman': 'Simboli e lettere romane', + 'tooltip.copy to clipboard': 'Copia negli appunti', + 'tooltip.redo': 'Rifare', + 'tooltip.toggle virtual keyboard': + 'Attiva / disattiva la tastiera virtuale', + 'tooltip.undo': 'Disfare', + }, + ja: { + 'keyboard.tooltip.functions': '関数', + 'keyboard.tooltip.greek': 'ギリシャ文字', + 'keyboard.tooltip.command': 'LaTeXコマンドモード', + 'keyboard.tooltip.numeric': '数値', + 'keyboard.tooltip.roman': '記号とローマ字', + 'tooltip.copy to clipboard': 'クリップボードにコピー', + 'tooltip.redo': 'やり直し', + 'tooltip.toggle virtual keyboard': + '仮想キーボードの切り替え', + 'tooltip.undo': '元に戻す', + }, + pl: { + 'keyboard.tooltip.functions': 'Funkcje', + 'keyboard.tooltip.greek': 'Litery greckie', + 'keyboard.tooltip.command': 'Tryb poleceń LaTeX', + 'keyboard.tooltip.numeric': 'Numeryczne', + 'keyboard.tooltip.roman': 'Symbole i litery rzymskie', + 'tooltip.copy to clipboard': 'Kopiuj do Schowka', + 'tooltip.redo': 'Przywróć', + 'tooltip.toggle virtual keyboard': + 'Przełącz wirtualną klawiaturę', + 'tooltip.undo': 'Cofnij', + }, + ru: { + 'keyboard.tooltip.functions': 'Функции', + 'keyboard.tooltip.greek': 'Греческие буквы', + 'keyboard.tooltip.command': 'Режим командной строки LaTeX', + 'keyboard.tooltip.numeric': 'числовой', + 'keyboard.tooltip.roman': 'Символы и римские буквы', + 'tooltip.copy to clipboard': 'Скопировать в буфер обмена', + 'tooltip.redo': 'переделывать', + 'tooltip.toggle virtual keyboard': + 'Переключить виртуальную клавиатуру', + 'tooltip.undo': 'расстегивать', + }, + }); + const ti = { + numeric: { + tooltip: 'keyboard.tooltip.numeric', + layer: 'math', + label: '123', + layers: ['math'], + }, + roman: { + tooltip: 'keyboard.tooltip.roman', + layer: 'lower-roman', + label: 'ABC', + layers: ['lower-roman', 'upper-roman', 'symbols'], + }, + greek: { + tooltip: 'keyboard.tooltip.greek', + layer: 'lower-greek', + label: 'αβγ', + classes: 'tex-math', + layers: ['lower-greek', 'upper-greek'], + }, + functions: { + tooltip: 'keyboard.tooltip.functions', + layer: 'functions', + label: 'f ()', + classes: 'tex', + layers: ['functions'], + }, + command: { + tooltip: 'keyboard.tooltip.command', + command: 'enterCommandMode', + label: "", + layers: [ + 'lower-command', + 'upper-command', + 'symbols-command', + ], + }, + style: { + tooltip: 'keyboard.tooltip.style', + layer: 'style', + label: 'bi𝔹', + }, + }, + ei = { + '\\varphi ': { label: 'Φ', insert: '\\Phi ' }, + '\\varsigma ': { label: 'Σ', insert: '\\Sigma ' }, + '\\epsilon ': { label: 'Ɛ', insert: '{\\char"0190}' }, + '\\rho ': { label: 'Ρ', insert: '{\\char"3A1}' }, + '\\tau ': { label: 'Τ', insert: '{\\char"3A4}' }, + '\\upsilon ': { label: 'Υ', insert: '\\Upsilon ' }, + '\\theta ': { label: 'Θ', insert: '\\Theta ' }, + '\\iota ': { label: 'Ι', insert: '{\\char"399}' }, + '\\omicron ': { label: 'Ο', insert: '{\\char"39F}' }, + '\\pi ': { label: 'Π', insert: '\\Pi ' }, + '\\alpha ': { label: 'Α', insert: '{\\char"391}' }, + '\\sigma ': { label: 'Σ', insert: '\\Sigma ' }, + '\\delta ': { label: 'Δ', insert: '\\Delta ' }, + '\\phi ': { label: 'Φ', insert: '\\Phi ' }, + '\\gamma ': { label: 'Γ', insert: '\\Gamma ' }, + '\\eta ': { label: 'Η', insert: '{\\char"397}' }, + '\\xi ': { label: 'Ξ', insert: '\\Xi ' }, + '\\kappa ': { label: 'Κ', insert: '{\\char"39A}' }, + '\\lambda ': { label: 'Λ', insert: '\\Lambda ' }, + '\\zeta ': { label: 'Ζ', insert: '{\\char"396}' }, + '\\chi ': { label: 'Χ', insert: '{\\char"3A7}' }, + '\\psi ': { label: 'Ψ', insert: '\\Psi ' }, + '\\omega ': { label: 'Ω', insert: '\\Omega ' }, + '\\beta ': { label: 'Β', insert: '{\\char"392}' }, + '\\nu ': { label: 'Ν', insert: '{\\char"39D}' }, + '\\mu ': { label: 'Μ', insert: '{\\char"39C}' }, + }, + ii = { + 0: [ + '\\emptyset', + '\\varnothing', + '\\infty', + { latex: '#?_0', insert: '#@_0' }, + '\\circ', + '\\bigcirc', + '\\bullet', + ], + 2: ['\\frac{1}{2}', { latex: '#?^2', insert: '#@^2' }], + 3: ['\\frac{1}{3}', { latex: '#?^3', insert: '#@^3' }], + '.': [ + ',', + ';', + '\\colon', + { latex: ':', aside: 'ratio' }, + { latex: '\\cdotp', aside: 'center dot', classes: 'box' }, + { + latex: '\\cdots', + aside: 'center ellipsis', + classes: 'box', + }, + { latex: '\\ldotp', aside: 'low dot', classes: 'box' }, + { latex: '\\ldots', aside: 'low ellipsis', classes: 'box' }, + { latex: '\\vdots', aside: '', classes: 'box' }, + { latex: '\\ddots', aside: '', classes: 'box' }, + '\\odot', + '\\oslash', + '\\circledcirc', + ], + '*': [ + '\\cdot', + '\\ast', + '\\star', + '\\bigstar', + '\\ltimes', + '\\rtimes', + '\\rightthreetimes', + '\\leftthreetimes', + '\\intercal', + '\\prod', + { + latex: '\\prod_{n\\mathop=0}^{\\infty}', + classes: 'small', + }, + ], + '+': [ + '\\pm', + '\\mp', + '\\sum', + { + latex: '\\sum_{n\\mathop=0}^{\\infty}', + classes: 'small', + }, + '\\dotplus', + '\\oplus', + ], + '-': ['\\pm', '\\mp', '\\ominus', '\\vert #0 \\vert'], + '/': ['\\divideontimes', '/', '\\div'], + '(': [ + '\\left( #0\\right)', + '\\left[ #0\\right]', + '\\left\\{ #0\\right\\}', + '\\left\\langle #0\\right\\rangle', + '\\lfloor', + '\\llcorner', + '(', + '\\lbrack', + '\\lvert', + '\\lVert', + '\\lgroup', + '\\langle', + '\\lceil', + '\\ulcorner', + '\\lmoustache', + '\\lbrace', + ], + ')': [ + '\\rfloor', + '\\lrcorner', + ')', + '\\rbrack', + '\\rvert', + '\\rVert', + '\\rgroup', + '\\rangle', + '\\rceil', + '\\urcorner', + '\\rmoustache', + '\\rbrace', + ], + '=': [ + '\\cong', + '\\asymp', + '\\equiv', + '\\differencedelta', + '\\varpropto', + '\\thickapprox', + '\\approxeq', + '\\thicksim', + '\\backsim', + '\\eqsim', + '\\simeq', + '\\Bumpeq', + '\\bumpeq', + '\\doteq', + '\\Doteq', + '\\fallingdotseq', + '\\risingdotseq', + '\\coloneq', + '\\eqcirc', + '\\circeq', + '\\triangleq', + '\\between', + ], + '!=': ['\\neq', '\\ncong', '', '\\nsim'], + '<': [ + '\\leq', + '\\leqq', + '\\lneqq', + '\\ll', + '\\nless', + '\\nleq', + '\\precsim', + '\\lesssim', + '\\lessgtr', + '\\prec', + '\\preccurlyeq', + '\\lessdot', + '\\nprec', + ], + '>': [ + '\\geq', + '\\geqq', + '\\gneqq', + '\\gg', + '\\ngtr', + '\\ngeq', + '\\succsim', + '\\gtrsim', + '\\gtrless', + '\\succ', + '\\succcurlyeq', + '\\gtrdot', + '\\nsucc', + ], + set: [ + '\\in', + '\\owns', + '\\subset', + '\\nsubset', + '\\supset', + '\\nsupset', + ], + '!set': ['\\notin', '\\backepsilon'], + subset: [], + supset: [], + infinity: [ + '\\aleph_0', + '\\aleph_1', + '\\omega', + '\\mathfrak{m}', + ], + 'numeric-pi': [ + '\\prod', + '\\theta', + '\\rho', + '\\sin', + '\\cos', + '\\tan', + ], + ee: ['\\times 10^{#?}', '\\ln', '\\ln_{10}', '\\log'], + '^': ['_{#?}'], + int: [ + { latex: '\\int_{#?}^{#?}', classes: 'small' }, + { latex: '\\int', classes: 'small' }, + { latex: '\\smallint', classes: 'small' }, + { latex: '\\iint', classes: 'small' }, + { latex: '\\iiint', classes: 'small' }, + { latex: '\\oint', classes: 'small' }, + { latex: '\\dfrac{\\rd}{\\rd x}', classes: 'small' }, + { + latex: '\\frac{\\partial}{\\partial x}', + classes: 'small', + }, + '\\capitalDifferentialD', + '\\rd', + '\\partial', + ], + nabla: ['\\nabla\\times', '\\nabla\\cdot', '\\nabla^{2}'], + '!': ['!!', '\\Gamma', '\\Pi'], + accents: [ + '\\bar{#@}', + '\\vec{#@}', + '\\hat{#@}', + '\\check{#@}', + '\\dot{#@}', + '\\ddot{#@}', + '\\mathring{#@}', + '\\breve{#@}', + '\\acute{#@}', + '\\tilde{#@}', + '\\grave{#@}', + ], + A: [ + { latex: '\\aleph', aside: 'aleph' }, + { latex: '\\forall', aside: 'for all' }, + ], + a: [ + { latex: '\\aleph', aside: 'aleph' }, + { latex: '\\forall', aside: 'for all' }, + ], + b: [{ latex: '\\beth', aside: 'beth' }], + B: [{ latex: '\\beth', aside: 'beth' }], + c: [{ latex: '\\C', aside: 'set of complex numbers' }], + d: [{ latex: '\\daleth', aside: 'daleth' }], + D: [{ latex: '\\daleth', aside: 'daleth' }], + e: [ + { latex: '\\exponentialE', aside: 'exponential e' }, + { latex: '\\exists', aside: 'there is' }, + { latex: '\\nexists', aside: 'there isn’t' }, + ], + g: [{ latex: '\\gimel', aside: 'gimel' }], + G: [{ latex: '\\gimel', aside: 'gimel' }], + h: [ + { latex: '\\hbar', aside: 'h bar' }, + { latex: '\\hslash', aside: 'h slash' }, + ], + i: [{ latex: '\\imaginaryI', aside: 'imaginary i' }], + j: [{ latex: '\\imaginaryJ', aside: 'imaginary j' }], + l: [{ latex: '\\ell', aside: 'ell' }], + n: [{ latex: '\\N', aside: 'set of natural numbers' }], + p: [{ latex: '\\P', aside: 'set of primes' }], + q: [{ latex: '\\Q', aside: 'set of rational numbers' }], + r: [{ latex: '\\R', aside: 'set of real numbers' }], + z: [{ latex: '\\Z', aside: 'set of integers' }], + 'x-var': [ + 'y', + 'z', + 't', + 'r', + { latex: 'f(#?)', classes: 'small' }, + { latex: 'g(#?)', classes: 'small' }, + 'x^2', + 'x^n', + 'x_n', + 'x_{n+1}', + 'x_i', + 'x_{i+1}', + ], + 'n-var': ['i', 'j', 'p', 'k', 'a', 'u'], + ii: ['\\Re', '\\Im', '\\imaginaryJ', '\\Vert #0 \\Vert'], + logic: [ + { latex: '\\exists', aside: 'there is' }, + { latex: '\\nexists', aside: 'there isn’t' }, + { latex: '\\ni', aside: 'such that' }, + { latex: '\\Colon', aside: 'such that' }, + { latex: '\\implies', aside: 'implies' }, + { latex: '\\impliedby', aside: 'implied by' }, + { latex: '\\iff', aside: 'if and only if' }, + { latex: '\\land', aside: 'and' }, + { latex: '\\lor', aside: 'or' }, + { latex: '\\oplus', aside: 'xor' }, + { latex: '\\lnot', aside: 'not' }, + { latex: '\\downarrow', aside: 'nor' }, + { latex: '\\uparrow', aside: 'nand' }, + { latex: '\\curlywedge', aside: 'nor' }, + { latex: '\\bar\\curlywedge', aside: 'nand' }, + { latex: '\\therefore', aside: 'therefore' }, + { latex: '\\because', aside: 'because' }, + { latex: '^\\biconditional', aside: 'biconditional' }, + '\\leftrightarrow', + '\\Leftrightarrow', + '\\to', + '\\models', + '\\vdash', + '\\gets', + '\\dashv', + '\\roundimplies', + ], + 'set-operators': [ + '\\cap', + '\\cup', + '\\setminus', + '\\smallsetminus', + '\\complement', + ], + 'set-relations': [ + '\\in', + '\\notin', + '\\ni', + '\\owns', + '\\subset', + '\\supset', + '\\subseteq', + '\\supseteq', + '\\subsetneq', + '\\supsetneq', + '\\varsubsetneq', + '\\subsetneqq', + '\\nsubset', + '\\nsupset', + '\\nsubseteq', + '\\nsupseteq', + ], + space: [ + { + latex: '\\char"203A\\!\\char"2039', + insert: '\\!', + aside: 'negative thin space
    ⁻³⧸₁₈ em', + }, + { + latex: '\\unicode{"203A}\\,\\unicode{"2039}', + insert: '\\,', + aside: 'thin space
    ³⧸₁₈ em', + }, + { + latex: '\\unicode{"203A}\\:\\unicode{"2039}', + insert: '\\:', + aside: 'medium space
    ⁴⧸₁₈ em', + }, + { + latex: '\\unicode{"203A}\\;\\unicode{"2039}', + insert: '\\;', + aside: 'thick space
    ⁵⧸₁₈ em', + }, + { + latex: '\\unicode{"203A}\\ \\unicode{"2039}', + insert: '\\ ', + aside: '⅓ em', + }, + { + latex: '\\unicode{"203A}\\enspace\\unicode{"2039}', + insert: '\\enspace', + aside: '½ em', + }, + { + latex: '\\unicode{"203A}\\quad\\unicode{"2039}', + insert: '\\quad', + aside: '1 em', + }, + { + latex: '\\unicode{"203A}\\qquad\\unicode{"2039}', + insert: '\\qquad', + aside: '2 em', + }, + ], + delete: [ + { + label: + '', + command: '"deleteAll"', + }, + ], + '->|': [], + }; + let si = {}; + const ai = { + math: + "\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ", + 'lower-roman': + "\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ", + 'upper-roman': + "\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ", + symbols: + "\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ", + 'lower-greek': + "\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ", + 'upper-greek': + "\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ", + 'lower-command': + "\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ", + 'upper-command': + "\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ", + 'symbols-command': + "\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ", + functions: + "\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ", + style: + "\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    ", + }; + function oi(t, e, i) { + t = t.replace(/(^|[^\\])#@/g, '$1#?'); + const s = he.parseTokens(n(t), 'math', e, i.config.macros), + a = te.decompose( + { mathstyle: 'displaystyle', macros: i.config.macros }, + s + ), + o = $.makeSpan(a, 'ML__base'), + r = $.makeSpan('', 'ML__strut'); + r.setStyle('height', o.height, 'em'); + const l = $.makeSpan('', 'ML__strut--bottom'); + return ( + l.setStyle('height', o.height + o.depth, 'em'), + l.setStyle('vertical-align', -o.depth, 'em'), + $.makeSpan([r, l, o], 'ML__mathlive').toMarkup() + ); + } + function ni(t, e, i) { + let s = "
    "; + const a = e.replace(/\s+/g, ' ').split(' '); + if (a.length > 1) { + const e = Object.assign( + {}, + ti, + t.config.customVirtualKeyboards || {} + ); + for (const t of a) { + if (!e[t]) break; + (s += "
    '); + } + } + return ( + (s += '
    '), + (s += `\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `), + "' + ); + } + function ri(t, e, i) { + for (let s = 0; s < e.length; ++s) { + const a = e[s]; + a.getAttribute('data-latex') + ? (a.innerHTML = oi( + a.getAttribute('data-latex').replace(/"/g, '"'), + { '?': '{\\color{#555}{\\tiny \\char"2B1A}}' }, + t + )) + : '' === a.innerHTML && a.getAttribute('data-insert') + ? (a.innerHTML = oi( + a.getAttribute('data-insert').replace(/"/g, '"'), + { '?': '{\\color{#555}{\\tiny \\char"2B1A}}' }, + t + )) + : a.getAttribute('data-content') && + (a.innerHTML = a + .getAttribute('data-content') + .replace(/"/g, '"')), + a.getAttribute('data-aside') && + (a.innerHTML += + ''), + a.getAttribute('data-classes') && + a.classList.add(a.getAttribute('data-classes')); + let o, + n = a.getAttribute('data-insert'); + if ( + (n && (n = n.replace(/"/g, '"')), + n && + ei[n] && + (a.setAttribute('data-shifted', ei[n].label), + a.setAttribute( + 'data-shifted-command', + JSON.stringify([ + 'insertAndUnshiftKeyboardLayer', + ei[n].insert, + ]) + )), + (o = a.getAttribute('data-command') + ? JSON.parse(a.getAttribute('data-command')) + : a.getAttribute('data-insert') + ? [ + 'insert', + a.getAttribute('data-insert'), + { + focus: !0, + feedback: !0, + mode: 'math', + format: 'auto', + resetStyle: !0, + }, + ] + : a.getAttribute('data-latex') + ? [ + 'insert', + a.getAttribute('data-latex'), + { + focus: !0, + feedback: !0, + mode: 'math', + format: 'auto', + resetStyle: !0, + }, + ] + : [ + 'typedText', + a.getAttribute('data-key') || a.textContent, + { + focus: !0, + feedback: !0, + simulateKeystroke: !0, + }, + ]), + i && (o = [i, o]), + a.getAttribute('data-alt-keys')) + ) { + const t = si[a.getAttribute('data-alt-keys')]; + t && + (o = { + default: o, + pressAndHoldStart: [ + 'showAlternateKeys', + a.getAttribute('data-alt-keys'), + t, + ], + pressAndHoldEnd: 'hideAlternateKeys', + }); + } + t._attachButtonHandlers(a, o); + } + } + function li(t, e) { + const i = { + qwerty: { + 'lower-1': 'qwertyuiop', + 'lower-2': ' asdfghjkl ', + 'lower-3': '^zxcvbnm~', + 'upper-1': 'QWERTYUIOP', + 'upper-2': ' ASDFGHJKL ', + 'upper-3': '^ZXCVBNM~', + 'numpad-1': '789/', + 'numpad-2': '456*', + 'numpad-3': '123-', + 'numpad-4': '0.=+', + }, + azerty: { + 'lower-1': 'azertyuiop', + 'lower-2': 'qsdfghjklm', + 'lower-3': '^ wxcvbn ~', + 'upper-1': 'AZERTYUIOP', + 'upper-2': 'QSDFGHJKLM', + 'upper-3': '^ WXCVBN ~', + }, + qwertz: { + 'lower-1': 'qwertzuiop', + 'lower-2': ' asdfghjkl ', + 'lower-3': '^yxcvbnm~', + 'upper-1': 'QWERTZUIOP', + 'upper-2': ' ASDFGHJKL', + 'upper-3': '^YXCVBNM~', + }, + dvorak: { + 'lower-1': '^ pyfgcrl ', + 'lower-2': 'aoeuidhtns', + 'lower-3': 'qjkxbmwvz~', + 'upper-1': '^ PYFGCRL ', + 'upper-2': 'AOEUIDHTNS', + 'upper-3': 'QJKXBMWVZ~', + }, + colemak: { + 'lower-1': ' qwfpgjluy ', + 'lower-2': 'arstdhneio', + 'lower-3': '^zxcvbkm~', + 'upper-1': ' QWFPGNLUY ', + 'upper-2': 'ARSTDHNEIO', + 'upper-3': '^ZXCVBKM~', + }, + }, + s = i[t.config.virtualKeyboardLayout] + ? i[t.config.virtualKeyboardLayout] + : i.qwerty; + let a, + o = e; + o = o.replace( + //g, + "\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • " + ); + let n = o.match(/()/); + for (; n; ) { + a = ''; + const t = n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g), + e = {}; + for (const i of t) { + const t = i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/); + e[t[1]] = t[3]; + } + let r = s[e.name]; + if ((r || (r = i.qwerty[e.name]), r)) + for (const t of r) { + let i = e.class || ''; + i && (i = ' ' + i), + '~' === t + ? ((a += + "
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • ')) + : ' ' === t + ? (a += "
  • ") + : '^' === t + ? (a += + "
  • ") + : '/' === t + ? (a += + "
  • ÷
  • ") + : '*' === t + ? (a += + "
  • ×
  • ") + : '-' === t + ? (a += + "
  • ") + : /tt/.test(i) + ? (a += + "
  • ' + + t + + '
  • ') + : (a += + "
  • " + + t + + '
  • '); + } + (o = o.replace(new RegExp(n[1] + n[2] + n[3]), a)), + (n = o.match(/()/)); + } + return o; + } + var ci = { + make: function(t, e) { + let i = + '\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '; + ii['foreground-color'] = []; + for (const t of ne) + ii['foreground-color'].push({ + classes: 'small-button', + content: + '', + command: '["applyStyle",{"color":"' + t + '"}]', + }); + ii['background-color'] = []; + for (const t of oe) + ii['background-color'].push({ + classes: 'small-button', + content: + '', + command: + '["applyStyle",{"backgroundColor":"' + t + '"}]', + }); + (si = { ...ii }), + Object.keys(si).forEach(t => { + si[t] = si[t].slice(); + }); + const s = 'abcdefghijklmnopqrstuvwxyz'; + for (let t = 0; t < 26; t++) { + const e = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[t]; + si[e] || (si[e] = []), + si[e].unshift({ + latex: '\\mathbb{' + e + '}', + aside: 'blackboard', + insert: '\\mathbb{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathbf{' + e + '}', + aside: 'bold', + insert: '\\mathbf{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathsf{' + e + '}', + aside: 'sans', + insert: '\\mathsf{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathtt{' + e + '}', + aside: 'monospace', + insert: '\\mathtt{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathcal{' + e + '}', + aside: 'script', + insert: '\\mathcal{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathfrak{' + e + '}', + aside: 'fraktur', + insert: '\\mathfrak{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathbb{' + s[t] + '}', + aside: 'blackboard', + insert: '\\mathbb{' + s[t] + '}', + }), + si[e].unshift({ + latex: '\\mathbf{' + s[t] + '}', + aside: 'bold', + insert: '\\mathbf{' + s[t] + '}', + }), + si[e].unshift({ + latex: '\\mathsf{' + s[t] + '}', + aside: 'sans', + insert: '\\mathsf{' + s[t] + '}', + }), + si[e].unshift({ + latex: '\\mathcal{' + s[t] + '}', + aside: 'script', + insert: '\\mathcal{' + s[t] + '}', + }), + si[e].unshift({ + latex: '\\mathfrak{' + s[t] + '}', + aside: 'fraktur', + insert: '\\mathfrak{' + s[t] + '}', + }); + } + for (let t = 0; t <= 26; t++) { + const e = s[t]; + si[e] || (si[e] = []), + si[e].unshift({ + latex: '\\mathsf{' + e + '}', + aside: 'sans', + insert: '\\mathbb{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathbf{' + e + '}', + aside: 'bold', + insert: '\\mathbf{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathtt{' + e + '}', + aside: 'monospace', + insert: '\\mathtt{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathfrak{' + e + '}', + aside: 'fraktur', + insert: '\\mathfrak{' + e + '}', + }); + } + for (let t = 0; t < 10; t++) { + const e = '0123456789'[t]; + si[e] || (si[e] = []), + si[e].unshift({ + latex: '\\mathbf{' + e + '}', + aside: 'bold', + insert: '\\mathbf{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathsf{' + e + '}', + aside: 'sans', + insert: '\\mathsf{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathtt{' + e + '}', + aside: 'monospace', + insert: '\\mathtt{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathcal{' + e + '}', + aside: 'script', + insert: '\\mathcal{' + e + '}', + }), + si[e].unshift({ + latex: '\\mathfrak{' + e + '}', + aside: 'fraktur', + insert: '\\mathfrak{' + e + '}', + }); + } + let a = t.config.virtualKeyboards; + a || (a = 'all'), + (a = a.replace( + /\ball\b/i, + 'numeric roman greek functions command' + )); + const o = Object.assign( + {}, + ai, + t.config.customVirtualKeyboardLayers || {} + ), + n = Object.assign( + {}, + ti, + t.config.customVirtualKeyboards || {} + ), + r = a.replace(/\s+/g, ' ').split(' '); + for (const e of r) { + if (!n[e]) break; + let s = n[e].layers || []; + n[e].layer && s.push(n[e].layer), + (s = Array.from(new Set(s))); + for (const n of s) { + if (!o[n]) break; + if ('object' == typeof o[n]) { + let t = ''; + if ( + (o[n].styles && + (t += ``), + o[n].backdrop && + (t += `
    `), + o[n].container && + (t += `
    `), + o[n].rows) + ) { + t += "
    "; + for (const e of o[n].rows) { + t += '
      '; + for (const i of e) + (t += '${ + i.label ? i.label : '' + }`); + t += '
    '; + } + (t += '
    '), + o[n].container && (t += ""), + o[n].backdrop && (t += ""); + } + o[n] = t; + } + (i += + "
    "), + (i += ni(t, a, e)); + const s = 'function' == typeof o[n] ? o[n]() : o[n]; + (i += li(t, s)), (i += '
    '); + } + } + const l = document.createElement('div'); + (l.className = 'ML__keyboard'), + e + ? l.classList.add(e) + : t.config.virtualKeyboardTheme + ? l.classList.add(t.config.virtualKeyboardTheme) + : /android|cros/i.test(navigator.userAgent) && + l.classList.add('material'), + (l.innerHTML = i), + ri( + t, + l.querySelectorAll( + '.keycap, .action, .fnbutton, .bigfnbutton' + ) + ); + const c = l.getElementsByClassName('layer-switch'); + for (let e = 0; e < c.length; ++e) + c[e].classList.contains('shift') + ? t._attachButtonHandlers(c[e], { + pressed: ['shiftKeyboardLayer', 'shift'], + default: [ + 'switchKeyboardLayer', + c[e].getAttribute('data-layer'), + ], + pressAndHoldEnd: 'unshiftKeyboardLayer', + }) + : t._attachButtonHandlers(c[e], { + default: [ + 'switchKeyboardLayer', + c[e].getAttribute('data-layer'), + ], + }); + const h = l.getElementsByClassName('keyboard-layer'); + return ( + Array.from(h).forEach(t => { + t.addEventListener('mousedown', t => { + t.preventDefault(), t.stopPropagation(); + }), + t.addEventListener('touchstart', t => { + t.preventDefault(), t.stopPropagation(); + }); + }), + h[0].classList.add('is-visible'), + window.addEventListener('mouseup', function() { + t.hideAlternateKeys_(), t.unshiftKeyboardLayer_(); + }), + window.addEventListener('blur', function() { + t.hideAlternateKeys_(), t.unshiftKeyboardLayer_(); + }), + window.addEventListener('touchend', function() { + t.hideAlternateKeys_(), t.unshiftKeyboardLayer_(); + }), + window.addEventListener('touchcancel', function() { + t.hideAlternateKeys_(), t.unshiftKeyboardLayer_(); + }), + l + ); + }, + makeKeycap: ri, + }; + const hi = { + '−': '-', + '-': '-', + '\\alpha': 'alpha', + '\\beta': 'beta', + '\\gamma': 'gamma', + '\\delta': 'delta', + '\\epsilon': 'epsilon', + '\\varepsilon': 'varepsilon', + '\\zeta': 'zeta', + '\\eta': 'eta', + '\\theta': 'theta', + '\\vartheta': 'vartheta', + '\\iota': 'iota', + '\\kappa': 'kappa', + '\\lambda': 'lambda', + '\\mu': 'mu', + '\\nu': 'nu', + '\\xi': 'xi', + '\\pi': 'pi', + '\\rho': 'rho', + '\\sigma': 'sigma', + '\\tau': 'tau', + '\\upsilon': 'upsilon', + '\\phi': 'phi', + '\\varphi': 'varphi', + '\\chi': 'chi', + '\\psi': 'psi', + '\\omega': 'omega', + '\\Gamma': 'Gamma', + '\\Delta': 'Delta', + '\\Theta': 'Theta', + '\\Lambda': 'Lambda', + '\\Xi': 'Xi', + '\\Pi': 'Pi', + '\\Sigma': 'Sigma', + '\\Phi': 'Phi', + '\\Psi': 'Psi', + '\\Omega': 'Omega', + }, + di = { + '\\pm': '+-', + '\\times': 'xx', + '\\colon': ':', + '\\vert': '|', + '\\Vert': '||', + '\\mid': '|', + '\\lbrace': '{', + '\\rbrace': '}', + '\\langle': '(:', + '\\rangle': ':)', + }, + pi = { + '\\pm': '±', + '\\times': '×', + '\\colon': ':', + '\\vert': '|', + '\\Vert': '∥', + '\\mid': '∣', + '\\lbrace': '{', + '\\rbrace': '}', + '\\langle': '⟨', + '\\rangle': '⟩', + '\\lfloor': '⌊', + '\\rfloor': '⌋', + '\\lceil': '⌈', + '\\rceil': '⌉', + '\\vec': '⃗', + '\\acute': '´', + '\\grave': '`', + '\\dot': '˙', + '\\ddot': '¨', + '\\tilde': '~', + '\\bar': '¯', + '\\breve': '˘', + '\\check': 'ˇ', + '\\hat': '^', + }; + function mi(t) { + return t + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(//g, '>'); + } + function ui(t, e) { + return t && e.generateID ? ' extid="' + t + '"' : ''; + } + function fi(t, e, i) { + let s = !1; + e = e || t.atoms.length; + let a = '', + o = '', + n = -1, + r = -1; + const l = t.atoms[t.index]; + if ( + (t.index < e && + ('mord' === l.type || 'textord' === l.type) && + '0123456789,.'.indexOf(l.body) < 0 && + ((o = l.toMathML(i)), + l.superscript && (n = t.index), + l.subscript && (r = t.index), + (t.index += 1)), + o.length > 0) + ) { + if ( + ((s = !0), + gi(t) && ((n = t.index), (t.index += 1)), + yi(t) && ((r = t.index), (t.index += 1)), + n >= 0 && r >= 0) + ) + (a = '' + o), + (a += Si(t.atoms[r].subscript, 0, 0, i).mathML), + (a += Si(t.atoms[n].superscript, 0, 0, i).mathML), + (a += ''); + else if (n >= 0) { + if (((a = '' + o), gi(t))) { + const e = Si(t.atoms[n].superscript, 0, 0, i).mathML, + s = Si(t.atoms[n + 1].superscript, 0, 0, i).mathML; + a += + ('' !== e && '' !== e) || + ('' !== s && '' !== s) + ? '' === e || + '' === e + ? '' + : e + : ''; + } else a += Si(t.atoms[n].superscript, 0, 0, i).mathML; + a += ''; + } else + r >= 0 + ? ((a = '' + o), + (a += Si(t.atoms[r].subscript, 0, 0, i).mathML), + (a += '')) + : (a = o); + ('mi' !== t.lastType && + 'mn' !== t.lastType && + 'mtext' !== t.lastType && + 'fence' !== t.lastType) || + /^(.*)<\/mo>$/.test(a) || + (a = '' + a), + o.endsWith('>f') || o.endsWith('>g') + ? ((a += ''), + (t.lastType = 'applyfunction')) + : (t.lastType = /^(.*)<\/mo>$/.test(a) + ? 'mo' + : 'mi'), + (t.mathML += a); + } + return s; + } + function gi(t) { + return ( + t.index < t.atoms.length && + t.atoms[t.index].superscript && + 'msubsup' === t.atoms[t.index].type + ); + } + function yi(t) { + return ( + t.index < t.atoms.length && + t.atoms[t.index].subscript && + 'msubsup' === t.atoms[t.index].type + ); + } + function bi(t, e, i) { + let s = !1, + a = '', + o = e.atoms[e.index - 1]; + return ( + !!o && + (o.superscript || + o.subscript || + ((gi(e) || yi(e)) && + ((o = e.atoms[e.index]), (e.index += 1))), + !!o && + (o.superscript && o.subscript + ? ((a = '' + t), + (a += Si(o.subscript, 0, 0, i).mathML), + (a += Si(o.superscript, 0, 0, i).mathML), + (a += '')) + : o.superscript + ? ((a = '' + t), + (a += Si(o.superscript, 0, 0, i).mathML), + (a += '')) + : o.subscript && + ((a = '' + t), + (a += Si(o.subscript, 0, 0, i).mathML), + (a += '')), + a.length > 0 && + ((s = !0), (e.mathML += a), (e.lastType = '')), + s)) + ); + } + function xi(t, e, i) { + let s = !1; + e = e || t.atoms.length; + const a = t.index; + let o = ''; + for (; t.index < e && 'text' === t.atoms[t.index].mode; ) + (o += t.atoms[t.index].body ? t.atoms[t.index].body : ' '), + (t.index += 1); + return ( + o.length > 0 && + ((s = !0), + (o = + '' + o + ''), + (t.mathML += o), + (t.lastType = 'mtext')), + s + ); + } + function ki(t, e, i) { + let s = !1; + e = e || t.atoms.length; + const a = t.index; + let o = '', + n = (function(t) { + let e = -1, + i = t.index, + s = !1, + a = !1; + for (; i < t.atoms.length && !s && !a; ) + (s = + 'mord' !== t.atoms[i].type || + '0123456789,.'.indexOf(t.atoms[i].body) < 0), + (a = !s && t.atoms[i].superscript), + i++; + return a && (e = i - 1), e; + })(t); + for ( + n >= 0 && n < e && (e = n); + t.index < e && + 'mord' === t.atoms[t.index].type && + '0123456789,.'.indexOf(t.atoms[t.index].body) >= 0; + + ) + (o += t.atoms[t.index].body), (t.index += 1); + return ( + o.length > 0 && + ((s = !0), + (o = '' + o + ''), + n < 0 && gi(t) && ((n = t.index), (t.index += 1)), + n >= 0 && + ((o = '' + o), + (o += Si(t.atoms[n].superscript, 0, 0, i).mathML), + (o += '')), + (t.mathML += o), + (t.lastType = 'mn')), + s + ); + } + function vi(t, e, i) { + let s = !1; + e = e || t.atoms.length; + let a = '', + o = ''; + if (t.index < e && 'mopen' === t.atoms[t.index].type) { + let n = !1, + r = 0; + const l = t.index; + let c = -1, + h = l + 1; + for (; h < e && !n; ) + 'mopen' === t.atoms[h].type + ? (r += 1) + : 'mclose' === t.atoms[h].type && (r -= 1), + -1 === r && ((n = !0), (c = h)), + (h += 1); + n && + ((a = ''), + (a += Ai(t.atoms[l], i)), + (a += Si(t.atoms, l + 1, c, i).mathML), + (a += Ai(t.atoms[c], i)), + (a += ''), + ('mi' !== t.lastType && + 'mn' !== t.lastType && + 'mfrac' !== t.lastType && + 'fence' !== t.lastType) || + (a = '' + a), + (t.index = c + 1), + bi(a, t, i) && ((s = !0), (t.lastType = ''), (a = '')), + (o = 'fence')); + } + return ( + a.length > 0 && ((s = !0), (t.mathML += a), (t.lastType = o)), s + ); + } + function wi(t, e, i) { + let s = !1; + e = e || t.atoms.length; + let a = '', + o = ''; + const n = t.atoms[t.index]; + if (t.index < e && ('mbin' === n.type || 'mrel' === n.type)) + (a += t.atoms[t.index].toMathML(i)), (t.index += 1), (o = 'mo'); + else if (t.index < e && 'mop' === n.type) { + if ('limits' === n.limits && (n.superscript || n.subscript)) { + const t = Ai(n, i); + n.superscript && n.subscript + ? ((a += + ('nolimits' !== n.limits + ? '' + : '') + t), + (a += Si(n.subscript, 0, 0, i).mathML), + (a += Si(n.superscript, 0, 0, i).mathML), + (a += + 'nolimits' !== n.limits + ? '' + : '')) + : n.superscript + ? ((a += + ('nolimits' !== n.limits ? '' : '') + + t), + (a += Si(n.superscript, 0, 0, i).mathML), + (a += + 'nolimits' !== n.limits ? '' : '')) + : ((a += + ('nolimits' !== n.limits + ? '' + : '') + t), + (a += Si(n.subscript, 0, 0, i).mathML), + (a += + 'nolimits' !== n.limits + ? '' + : '')), + (o = 'mo'); + } else { + const e = t.atoms[t.index], + n = 0 === e.latex.indexOf('\\operatorname'), + r = n + ? '' + + Mi(e.body) + + '' + : Ai(e, i); + (a += r), + (t.index += 1), + bi(a, t, i) && ((s = !0), (t.lastType = ''), (a = '')), + (t.index -= 1), + n || /^(.*)<\/mo>$/.test(r) + ? (o = n ? 'mi' : 'mo') + : ((a += ''), + (o = 'applyfunction')); + } + ('mi' !== t.lastType && 'mn' !== t.lastType) || + /^(.*)<\/mo>$/.test(a) || + (a = '' + a), + (t.index += 1); + } + return ( + a.length > 0 && ((s = !0), (t.mathML += a), (t.lastType = o)), s + ); + } + function Si(t, e, i, s) { + const a = { atoms: t, index: e || 0, mathML: '', lastType: '' }; + if ( + ((i = i || (t ? t.length : 0)), + 'number' == typeof t || 'boolean' == typeof t) + ) + a.mathML = t.toString(); + else if ('string' == typeof t) a.mathML = t; + else if (t && 'function' == typeof t.toMathML) + a.mathML = t.toMathML(s); + else if (Array.isArray(t)) { + let t = 0; + for (; a.index < i; ) + if ( + xi(a, i, s) || + ki(a, i, s) || + fi(a, i, s) || + wi(a, i, s) || + vi(a, i, s) + ) + t += 1; + else if (a.index < i) { + let e = a.atoms[a.index].toMathML(s); + 'mn' === a.lastType && + e.length > 0 && + 'genfrac' === a.atoms[a.index].type && + (e = '' + e), + 'genfrac' === a.atoms[a.index].type + ? (a.lastType = 'mfrac') + : (a.lastType = ''), + e.length > 0 && ((a.mathML += e), (t += 1)), + (a.index += 1); + } + t > 1 && (a.mathML = '' + a.mathML + ''); + } + return a; + } + function Ai(t, e) { + let i = ''; + const s = Mi(t.body); + return s && (i = '' + s + ''), i; + } + function Mi(t) { + if (!t) return ''; + if ('string' == typeof t) return mi(t); + if (!Array.isArray(t) && 'string' == typeof t.body) + return mi(t.body); + let e = ''; + for (const i of t) 'string' == typeof i.body && (e += i.body); + return mi(e); + } + (te.MathAtom.prototype.toMathML = function(t) { + const e = { + '\\exponentialE': 'ⅇ', + '\\imaginaryI': 'ⅈ', + '\\differentialD': 'ⅆ', + '\\capitalDifferentialD': 'ⅅ', + '\\alpha': 'α', + '\\pi': 'π', + '\\infty': '∞', + '\\forall': '∀', + '\\nexists': '∄', + '\\exists': '∃', + '\\hbar': 'ℏ', + '\\cdotp': '⋅', + '\\ldots': '…', + '\\cdots': '⋯', + '\\ddots': '⋱', + '\\vdots': '⋮', + '\\ldotp': '.', + }, + i = { + '\\!': -3 / 18, + '\\ ': 6 / 18, + '\\,': 3 / 18, + '\\:': 4 / 18, + '\\;': 5 / 18, + '\\enspace': 0.5, + '\\quad': 1, + '\\qquad': 2, + '\\enskip': 0.5, + }; + let s, + a, + o, + n, + r, + l, + c = '', + h = '', + d = + { + cal: 'script', + frak: 'fraktur', + bb: 'double-struck', + scr: 'script', + cmtt: 'monospace', + cmss: 'sans-serif', + }[this.fontFamily || this.font] || ''; + d && (d = ' mathvariant="' + d + '"'); + const p = this.latex ? this.latex.trim() : null; + if ('text' === this.mode) + c = '' + this.body + ''; + else + switch (this.type) { + case 'first': + break; + case 'group': + case 'root': + c = Si(this.body, 0, 0, t).mathML; + break; + case 'array': + if ( + (((this.lFence && '.' !== this.lFence) || + (this.rFence && '.' !== this.rFence)) && + ((c += ''), + this.lFence && + '.' !== this.lFence && + (c += + '' + + (pi[this.lFence] || this.lFence) + + '')), + (c += '' + + Si(this.array[a][s], 0, 0, t).mathML + + ''; + c += ''; + } + (c += ''), + ((this.lFence && '.' !== this.lFence) || + (this.rFence && '.' !== this.rFence)) && + (this.rFence && + '.' !== this.rFence && + (c += + '' + + (pi[this.lFence] || this.rFence) + + ''), + (c += '')); + break; + case 'genfrac': + (this.leftDelim || this.rightDelim) && (c += ''), + this.leftDelim && + '.' !== this.leftDelim && + (c += + '' + + (pi[this.leftDelim] || this.leftDelim) + + ''), + this.hasBarLine + ? ((c += ''), + (c += + Si(this.numer, 0, 0, t).mathML || + ' '), + (c += + Si(this.denom, 0, 0, t).mathML || + ' '), + (c += '')) + : ((c += ''), + (c += + '' + + Si(this.numer, 0, 0, t).mathML + + ''), + (c += + '' + + Si(this.denom, 0, 0, t).mathML + + ''), + (c += '')), + this.rightDelim && + '.' !== this.rightDelim && + (c += + '' + + (pi[this.rightDelim] || this.rightDelim) + + ''), + (this.leftDelim || this.rightDelim) && + (c += ''); + break; + case 'surd': + this.index + ? ((c += ''), + (c += Si(this.body, 0, 0, t).mathML), + (c += Si(this.index, 0, 0, t).mathML), + (c += '')) + : ((c += ''), + (c += Si(this.body, 0, 0, t).mathML), + (c += '')); + break; + case 'leftright': + (c = ''), + this.leftDelim && + '.' !== this.leftDelim && + (c += + '' + + (pi[this.leftDelim] || this.leftDelim) + + ''), + this.body && (c += Si(this.body, 0, 0, t).mathML), + this.rightDelim && + '.' !== this.rightDelim && + (c += + '' + + (pi[this.rightDelim] || this.rightDelim) + + ''), + (c += ''); + break; + case 'sizeddelim': + case 'delim': + c += + '' + + (pi[this.delim] || this.delim) + + ''; + break; + case 'accent': + (c += ''), + (c += Si(this.body, 0, 0, t).mathML), + (c += '' + (pi[p] || this.accent) + ''), + (c += ''); + break; + case 'line': + case 'overlap': + break; + case 'overunder': + (r = this.overscript), + (n = this.underscript), + r && n + ? (l = this.body) + : r + ? ((l = this.body), + this.body[0] && this.body[0].underscript + ? ((n = this.body[0].underscript), + (l = this.body[0].body)) + : this.body[0] && + 'first' === this.body[0].type && + this.body[1] && + this.body[1].underscript && + ((n = this.body[1].underscript), + (l = this.body[1].body))) + : n && + ((l = this.body), + this.body[0] && this.body[0].overscript + ? ((r = this.body[0].overscript), + (l = this.body[0].body)) + : this.body[0] && + 'first' === this.body[0].type && + this.body[1] && + this.body[1].overscript && + ((r = this.body[1].overscript), + (l = this.body[1].body))), + r && n + ? ((c += + '' + + Si(l, 0, 0, t).mathML), + (c += Si(n, 0, 0, t).mathML), + (c += Si(r, 0, 0, t).mathML), + (c += '')) + : r + ? ((c += + '' + + Si(l, 0, 0, t).mathML), + (c += Si(r, 0, 0, t).mathML), + (c += '')) + : n && + ((c += + '' + + Si(l, 0, 0, t).mathML), + (c += Si(n, 0, 0, t).mathML), + (c += '')); + break; + case 'placeholder': + case 'mord': { + c = + e[p] || + p || + ('string' == typeof this.body ? this.body : ''); + const i = p + ? p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/) + : null; + i + ? (c = '&#x' + i[1] + ';') + : c.length > 0 && + '\\' === c.charAt(0) && + (c = + 'string' == typeof this.body && + this.body.charCodeAt(0) > 255 + ? '&#x' + + ( + '000000' + + this.body.charCodeAt(0).toString(16) + ).substr(-4) + + ';' + : 'string' == typeof this.body + ? this.body.charAt(0) + : this.body); + const s = /\d/.test(c) ? 'mn' : 'mi'; + c = + '<' + + s + + d + + ui(this.id, t) + + '>' + + mi(c) + + ''; + break; + } + case 'mbin': + case 'mrel': + case 'textord': + case 'minner': + c = + p && e[p] + ? '' + e[p] + '' + : p && pi[p] + ? '' + pi[p] + '' + : Ai(this, t); + break; + case 'mpunct': + c = + '' + + (pi[p] || p) + + ''; + break; + case 'mop': + '​' !== this.body && + ((c = ''), + (c += + '\\operatorname' === p + ? this.body + : p || this.body), + (c += '')); + break; + case 'mathstyle': + break; + case 'box': + (c = '' + + Si(this.body, 0, 0, t).mathML + + ''); + break; + case 'spacing': + c += ''; + break; + case 'enclose': + c = '' + + Si(this.body, 0, 0, t).mathML + + ''; + break; + case 'space': + c += ' '; + } + return c; + }), + (te.toMathML = function(t, e) { + return Si(t, 0, 0, e).mathML; + }); + const Ci = { + '\\imaginaryI': 'ⅈ', + '\\imaginaryJ': 'ⅉ', + '\\pi': 'π', + '\\exponentialE': 'ℯ', + '﹢': '+', + '+': '+', + '−': '-', + '-': '-', + '﹣': '-', + '-': '-', + '\\times': '*', + '\\cdot': '*', + '⨉': '*', + '️✖': '*', + '️×': '*', + '.': '*', + '÷': '/', + '⁄': '/', + '/': '/', + '!': 'factorial', + '\\mp': 'minusplus', + '\\ne': '!=', + '\\coloneq': ':=', + '\\questeq': '?=', + '\\approx': 'approx', + '\\cong': 'congruent', + '\\sim': 'similar', + '\\equiv': 'equiv', + '\\pm': 'plusminus', + '\\land': 'and', + '\\wedge': 'and', + '\\lor': 'or', + '\\vee': 'or', + '\\oplus': 'xor', + '\\veebar': 'xor', + '\\lnot': 'not', + '\\neg': 'not', + '\\exists': 'exists', + '\\nexists': '!exists', + '\\forall': 'forAll', + '\\backepsilon': 'suchThat', + '\\therefore': 'therefore', + '\\because': 'because', + '\\nabla': 'nabla', + '\\circ': 'circle', + '\\ominus': 'ominus', + '\\odot': 'odot', + '\\otimes': 'otimes', + '\\zeta': 'Zeta', + '\\Gamma': 'Gamma', + '\\min': 'min', + '\\max': 'max', + '\\mod': 'mod', + '\\lim': 'lim', + '\\sum': 'sum', + '\\prod': 'prod', + '\\int': 'integral', + '\\iint': 'integral2', + '\\iiint': 'integral3', + '\\Re': 'Re', + '\\gothicCapitalR': 'Re', + '\\Im': 'Im', + '\\gothicCapitalI': 'Im', + '\\binom': 'nCr', + '\\partial': 'partial', + '\\differentialD': 'differentialD', + '\\capitalDifferentialD': 'capitalDifferentialD', + '\\Finv': 'Finv', + '\\Game': 'Game', + '\\wp': 'wp', + '\\ast': 'ast', + '\\star': 'star', + '\\asymp': 'asymp', + '\\to': 'to', + '\\gets': 'gets', + '\\in': 'elementof', + '\\notin': '!elementof', + '\\ni': 'ownedby', + '\\owns': 'ownedby', + '\\subset': 'subset', + '\\supset': 'superset', + '\\complement': 'complement', + '\\rightarrow': 'shortLogicalImplies', + '\\leftarrow': 'shortLogicalImpliedBy', + '\\leftrightarrow': 'shortLogicalEquivalent', + '\\longrightarrow': 'logicalImplies', + '\\longleftarrow': 'logicalImpliedBy', + '\\longleftrightarrow': 'logicalEquivalent', + '\\Rightarrow': 'shortImplies', + '\\Leftarrow': 'shortImpliedBy', + '\\Leftrightarrow': 'shortEquivalent', + '\\implies': 'implies', + '\\Longrightarrow': 'implies', + '\\impliedby': 'impliedBy', + '\\Longleftarrow': 'impliedBy', + '\\iff': 'equivalent', + '\\Longleftrightarrow': 'equivalent', + }, + _i = { + '+': 'add', + '*': 'multiply', + '-': 'subtract', + '/': 'divide', + '=': 'equal', + ':=': 'assign', + '!=': 'ne', + '?=': 'questeq', + approx: 'approx', + congruent: 'congruent', + similar: 'similar', + equiv: 'equiv', + '<': 'lt', + '>': 'gt', + '<=': 'le', + '>=': 'ge', + '≤': 'le', + '≥': 'ge', + '>>': 'gg', + '<<': 'll', + '**': 'pow', + '++': 'increment', + '--': 'decrement', + }, + Ti = { + equal: '%0 = %1', + ne: '%0 \\ne %1', + questeq: '%0 \\questeq %1', + approx: '%0 \\approx %1', + congruent: '%0 \\cong %1', + similar: '%0 \\sim %1', + equiv: '%0 \\equiv %1', + assign: '%0 := %1', + lt: '%0 < %1', + gt: '%0 > %1', + le: '%0 \\le %1', + ge: '%0 \\ge %1', + sin: '\\sin%_%^ %0', + cos: '\\cos%_%^ %0', + tan: '\\tan%_%^ %0', + cot: '\\cot%_%^ %0', + sec: '\\sec%_%^ %0', + csc: '\\csc%_%^ %0', + sinh: '\\sinh %0', + cosh: '\\cosh %0', + tanh: '\\tanh %0', + csch: '\\csch %0', + sech: '\\sech %0', + coth: '\\coth %0', + arcsin: '\\arcsin %0', + arccos: '\\arccos %0', + arctan: '\\arctan %0', + arccot: '\\arcctg %0', + arcsec: '\\arcsec %0', + arccsc: '\\arccsc %0', + arsinh: '\\arsinh %0', + arcosh: '\\arcosh %0', + artanh: '\\artanh %0', + arcsch: '\\arcsch %0', + arsech: '\\arsech %0', + arcoth: '\\arcoth %0', + ln: '\\ln%_%^ %', + log: '\\log%_%^ %', + lg: '\\lg %', + lb: '\\lb %', + sum: '\\sum%_%^ %0', + prod: '\\prod%_%^ %0', + Zeta: '\\zeta%_%^ %', + Gamma: '\\Gamma %', + min: '\\min%_%^ %', + max: '\\max%_%^ %', + mod: '\\mod%_%^ %', + lim: '\\lim%_%^ %', + binom: '\\binom %', + nabla: '\\nabla %', + curl: '\\nabla\\times %0', + div: '\\nabla\\cdot %0', + floor: '\\lfloor %0 \\rfloor%_%^', + ceil: '\\lceil %0 \\rceil%_%^', + abs: '\\left| %0 \\right|%_%^', + norm: '\\lVert %0 \\rVert%_%^', + ucorner: '\\ulcorner %0 \\urcorner%_%^', + lcorner: '\\llcorner %0 \\lrcorner%_%^', + angle: '\\langle %0 \\rangle%_%^', + group: '\\lgroup %0 \\rgroup%_%^', + moustache: '\\lmoustache %0 \\rmoustache%_%^', + brace: '\\lbrace %0 \\rbrace%_%^', + 'sqrt[]': '\\sqrt[%^]{%0}', + sqrt: '\\sqrt{%0}', + lcm: '\\operatorname{lcm}%', + gcd: '\\operatorname{gcd}%', + erf: '\\operatorname{erf}%', + erfc: '\\operatorname{erfc}%', + randomReal: '\\operatorname{randomReal}%', + randomInteger: '\\operatorname{randomInteger}%', + and: '%0 \\land %1', + or: '%0 \\lor %1', + xor: '%0 \\oplus %1', + not: '%0 \\lnot %1', + circle: '%0 \\circ %1', + ast: '%0 \\ast %1', + star: '%0 \\star %1', + asymp: '%0 \\asymp %1', + '/': '\\frac{%0}{%1}', + Re: '\\Re{%0}', + Im: '\\Im{%0}', + factorial: '%0!', + factorial2: '%0!!', + }, + Li = { + degree: 880, + nabla: 740, + curl: 740, + partial: 740, + differentialD: 740, + capitalDifferentialD: 740, + '**': 720, + odot: 710, + not: 680, + div: 660, + solidus: 660, + '/': 660, + setminus: 650, + '%': 640, + otimes: 410, + union: 350, + intersection: 350, + '*': 390, + ast: 390, + '.': 390, + oplus: 300, + ominus: 300, + '+': 275, + '-': 275, + '+-': 275, + '-+': 275, + circle: 265, + circledast: 265, + circledcirc: 265, + star: 265, + '..': 263, + to: 262, + in: 262, + '|': 261, + congruent: 265, + equiv: 260, + '=': 260, + '!=': 255, + '?=': 255, + similar: 250, + approx: 247, + '<': 245, + '>': 243, + '>=': 242, + '≥': 242, + '<=': 241, + complement: 240, + subset: 240, + superset: 240, + elementof: 240, + '!elementof': 240, + exists: 230, + '!exists': 230, + forall: 230, + and: 200, + xor: 195, + or: 190, + suchThat: 110, + ':': 100, + assign: 80, + ':=': 80, + therefore: 70, + because: 70, + shortLogicalImplies: 52, + shortImplies: 51, + logicalImplies: 50, + implies: 49, + shortLogicalImpliedBy: 48, + shortImpliedBy: 47, + logicalImpliedBy: 46, + impliedBy: 45, + shortLogicalEquivalent: 44, + shortEquivalent: 43, + logicalEquivalent: 42, + equivalent: 41, + ',': 40, + ';': 30, + }; + function Fi(t, e) { + return Array.isArray(t.arg) ? t.arg[e] : void 0; + } + function Di(t) { + return (t && Li[t]) || -1; + } + function zi(t) { + return /=|=>/.test(t) ? 'right' : 'left'; + } + function Ei(t) { + if ('f' === t || 'g' === t) return !0; + const e = Ti[t]; + return !!e && !!/%[^01_^]?/.test(e); + } + function qi(t) { + t = (t || '').trim(); + let e = Ci[t]; + if (!e) + if (/^\\[^{}]+$/.test(t)) { + const i = At.getInfo(t, 'math', {}); + e = (i && i.value) || t.slice(1); + } else e = t; + return e; + } + function Pi(t) { + if (!t) return null; + const e = qi(Ni(t)), + i = [Di(e), zi(e)]; + return i[0] <= 0 ? null : i; + } + function Ii(t) { + return null !== Pi(t); + } + const Bi = { + '\\lfloor\\rfloor': 'floor', + '\\lceil\\rceil': 'ceil', + '\\vert\\vert': 'abs', + '\\lvert\\rvert': 'abs', + '||': 'abs', + '\\Vert\\Vert': 'norm', + '\\lVert\\rVert': 'norm', + '\\ulcorner\\urcorner': 'ucorner', + '\\llcorner\\lrcorner': 'lcorner', + '\\langle\\rangle': 'angle', + '\\lgroup\\rgroup': 'group', + '\\lmoustache\\rmoustache': 'moustache', + '\\lbrace\\rbrace': 'brace', + }, + Oi = { + '!': 'factorial', + '\\dag': 'dagger', + '\\dagger': 'dagger', + '\\ddagger': 'dagger2', + '\\maltese': 'maltese', + '\\backprime': 'backprime', + '\\backdoubleprime': 'backprime2', + '\\prime': 'prime', + '\\doubleprime': 'prime2', + '\\$': '$', + '\\%': '%', + '\\_': '_', + '\\degree': 'degree', + }, + Ri = { + '+': 'add', + '-': 'add', + '*': 'multiply', + '=': 'equal', + ',': 'list', + ';': 'list2', + and: 'and', + or: 'or', + xor: 'xor', + union: 'union', + shortLogicalEquivalent: 'logicalEquivalent', + logicalEquivalent: 'logicalEquivalent', + shortEquivalent: 'equivalent', + equivalent: 'equivalent', + }, + Ki = { ',': 'list', ';': 'list2' }; + function Ni(t) { + if ('string' == typeof t) return t; + if (Array.isArray(t)) { + let e = ''; + for (const i of t) e += Ni(i); + return e; + } + if ( + t.latex && + !/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex) + ) + return t.latex.trim(); + if ('leftright' === t.type) return ''; + if ('string' == typeof t.body) return t.body; + if (Array.isArray(t.body)) { + let e = ''; + for (const i of t.body) e += Ni(i); + return e; + } + return ''; + } + function $i(t) { + return 'string' == typeof t.sym + ? (function(t) { + let e = Ti[t]; + if (e) + return e + .replace('%1', '') + .replace('%0', '') + .replace('%', ''); + if (t.length > 1) { + const i = At.getInfo('\\' + t, 'math'); + !i || + (i.fontFamily && + 'cmr' !== i.fontFamily && + 'ams' !== i.fontFamily) || + (e = '\\' + t); + } + return e || (e = At.unicodeStringToLatex('math', t)), e; + })(t.sym) || t.sym + : ''; + } + function Wi(t) { + return parseFloat(t.num); + } + function Hi(t) { + return 'object' == typeof t && void 0 !== t.num; + } + function Vi(t) { + let e = 0; + return ( + Hi(t) && + (e = + 'object' == typeof t.num + ? void 0 !== t.num.re + ? hs(t.num.re) + : 0 + : parseFloat(t.num)), + e + ); + } + function Ui(t) { + let e = 0; + return ( + Hi(t) && + 'object' == typeof t.num && + (e = void 0 !== t.num.im ? hs(t.num.im) : 0), + e + ); + } + function ji(t) { + return t && void 0 !== t.sup; + } + function Gi(t) { + return t && void 0 !== t.sub; + } + function Zi(t, e, i) { + let s = !1; + const a = t.atoms[t.index]; + return a && a.type === e && (s = void 0 === i || Ni(a) === i), s; + } + function Xi(t, ...e) { + const i = { fn: t }; + if (e) { + const t = []; + for (const i of e) i && t.push(i); + t.length > 0 && (i.arg = t); + } + return i; + } + function Ji(t) { + return 'number' == typeof t + ? { num: t.toString() } + : 'string' == typeof t + ? { num: t } + : 'object' == typeof t + ? { num: t } + : void 0; + } + function Yi(t) { + if (Hi(t)) { + const e = Vi(t), + i = Ui(t); + return ( + 0 !== i + ? (0 !== e && (t.num.re = (-e).toString()), + (t.num.im = (-i).toString())) + : (t.num = (-e).toString()), + t + ); + } + return Xi('negate', t); + } + function Qi(t) { + const e = t.atoms[t.index + 1]; + return e && 'msubsup' === e.type; + } + function ts(t, e) { + let i = t.atoms[t.index]; + return ( + !i || (void 0 === i.superscript && void 0 === i.subscript) + ? (i = null) + : (t.index += 1), + i || + ((i = t.atoms[t.index + 1]), + i && 'msubsup' === i.type && (i.superscript || i.subscript) + ? (t.index += 2) + : (i = null)), + i + ? (void 0 !== i.subscript && + (t.ast.sub = rs(i.subscript, e)), + void 0 !== i.superscript && + ('msubsup' === i.type + ? /['\u2032]|\\prime/.test(Ni(i.superscript)) + ? ((t.index += 1), + (i = t.atoms[t.index + 1]), + i && + 'msubsup' === i.type && + /['\u2032]|\\prime/.test(Ni(i.superscript)) + ? (t.ast.sup = { sym: '″' }) + : ((t.ast.sup = { sym: '′' }), + (t.index -= 1))) + : /['\u2033]|\\doubleprime/.test( + Ni(i.superscript) + ) + ? (t.ast.sup = { sym: '″' }) + : t.ast && (t.ast.sup = rs(i.superscript, e)) + : (t.ast.sup = rs(i.superscript, e)))) + : (t.index += 1), + t + ); + } + function es(t, e) { + const i = t.ast; + if (ss(t, '!!')) + return ( + (t.index += 1), + (t.ast = Xi('factorial2', i)), + es((t = ts(t, e)), e) + ); + if (ss(t, '++')) + return ( + (t.index += 1), + (t.ast = Xi('increment', i)), + es((t = ts(t, e)), e) + ); + if (ss(t, '--')) + return ( + (t.index += 1), + (t.ast = Xi('decrement', i)), + es((t = ts(t, e)), e) + ); + const s = t.atoms[t.index]; + return ( + s && + s.latex && + Oi[s.latex.trim()] && + ((t.ast = Xi(Oi[s.latex.trim()], i)), + (t = es((t = ts(t, e)), e))), + t + ); + } + function is(t, e, i, s) { + if ( + ((t.index = t.index || 0), + 0 === t.atoms.length || t.index >= t.atoms.length) + ) + return (t.ast = void 0), t; + const a = t.minPrec; + t.minPrec = 0; + let o = t.atoms[t.index]; + if (e) { + if ('mopen' === o.type && Ni(o) === e) + (t.index += 1), + (o = (t = os(t, s)).atoms[t.index]), + o && + 'mclose' === o.type && + Ni(o) === i && + (Qi(t) && (t.ast = { group: t.ast }), + (t = es((t = ts(t, s)), s))); + else if ('textord' === o.type && Ni(o) === e) + (t.index += 1), + (o = (t = os(t, s)).atoms[t.index]), + o && + 'textord' === o.type && + Ni(o) === i && + ((t.index += 1), (t = es((t = ts(t, s)), s))); + else if ( + '\\lVert' === e && + 'textord' === o.type && + '|' === o.latex + ) { + if ( + ((o = t.atoms[t.index + 1]), + o && 'textord' === o.type && '|' === o.latex) + ) { + (t.index += 2), (o = (t = os(t, s)).atoms[t.index]); + const e = t.atoms[t.index + 1]; + o && + 'textord' === o.type && + '|' === o.latex && + e && + 'textord' === e.type && + '|' === e.latex && + ((t.index += 2), (t = es((t = ts(t, s)), s))); + } + } else if ('sizeddelim' === o.type && o.delim === e) + (t.index += 1), + (o = (t = os(t, s)).atoms[t.index]), + o && + 'sizeddelim' === o.type && + o.delim === i && + ((t.index += 1), (t = es((t = ts(t, s)), s))); + else { + if ( + 'leftright' !== o.type || + o.leftDelim !== e || + ('?' !== o.rightDelim && o.rightDelim !== i) + ) + return; + (t.ast = rs(o.body, s)), + Qi(t) && (t.ast = { group: t.ast }), + (t = es((t = ts(t, s)), s)); + } + return (t.minPrec = a), t; + } + { + let s = !0; + if ( + ('mopen' === o.type + ? ((e = o.latex.trim()), (i = At.RIGHT_DELIM[e])) + : 'sizeddelim' === o.type + ? ((e = o.delim), (i = At.RIGHT_DELIM[e])) + : 'leftright' === o.type + ? ((s = !1), + (e = o.leftDelim), + '?' === (i = o.rightDelim) && (i = At.RIGHT_DELIM[e])) + : 'textord' === o.type && + ((e = o.latex.trim()), (i = At.RIGHT_DELIM[e])), + e && i) + ) { + if ('|' === e && '|' === i) { + const s = t.atoms[t.index + 1]; + s && + 'textord' === s.type && + '|' === s.latex && + ((e = '\\lVert'), (i = '\\rVert')); + } + if ((t = is(t, e, i))) + return ( + s && (t.index += 1), + (t.ast = { fn: Bi[e + i] || e + i, arg: [t.ast] }), + (t.minPrec = a), + t + ); + } + } + } + function ss(t, e) { + return ( + (t.index = t.index || 0), + !(t.atoms.length <= 1 || t.index >= t.atoms.length - 1) && + e === Ni(t.atoms[t.index]) + Ni(t.atoms[t.index + 1]) + ); + } + function as(t) { + if ( + ((t.index = t.index || 0), + !(t.atoms.length <= 1 || t.index >= t.atoms.length - 1)) + ) { + if (!Zi(t, 'textord', '\\nabla')) { + const e = + t.atoms[t.index].latex + t.atoms[t.index + 1].latex, + i = /^(>=|<=|>>|<<|:=|!=)$/.test(e) ? e : ''; + return i && (t.index += 1), i; + } + return ( + (t.index += 1), + Zi(t, 'mbin', '\\times') + ? ((t.index += 1), (t.ast = 'curl'), t) + : Zi(t, 'mbin', '\\cdot') + ? ((t.index += 1), (t.ast = 'div'), t) + : void (t.index -= 1) + ); + } + } + function os(t, e) { + if ( + ((t.index = t.index || 0), + (t.ast = void 0), + 0 === t.atoms.length || t.index >= t.atoms.length) + ) + return t; + t.minPrec = t.minPrec || 0; + let i = (function t(e, i) { + if ( + ((e.index = e.index || 0), + (e.ast = void 0), + 0 === e.atoms.length || e.index >= e.atoms.length) + ) + return e; + let s = e.atoms[e.index]; + if ('text' === s.mode) { + let t = ''; + for ( + ; + e.atoms[e.index] && + 'text' === e.atoms[e.index].mode; + + ) + (t += e.atoms[e.index].body), (e.index += 1); + return (e.ast = { text: t }), e; + } + const a = qi(Ni(s)); + if (as(e)) e.ast = Xi(e.ast, t(e, i).ast); + else { + if ('root' === s.type) + return (e.index = 0), (e.atoms = s.body), t(e, i); + if ('mbin' === s.type && '-' === a) + (e.index += 1), ((e = t(e, i)).ast = Yi(e.ast)); + else if ('mbin' === s.type && '+' === a) + (e.index += 1), + ((e = t(e, i)).ast = Xi('add', e.ast)); + else if ( + 'mord' === s.type && + /^[0-9.]$/.test(s.latex) + ) { + let a = '', + o = !1, + n = /^[0-9.eEdD]$/; + for ( + ; + e.index < e.atoms.length && + !o && + (Zi(e, 'spacing') || + ((Zi(e, 'mord') || + Zi(e, 'mpunct', ',') || + Zi(e, 'mbin')) && + n.test(e.atoms[e.index].latex))); + + ) + if ('spacing' === e.atoms[e.index].type) + e.index += 1; + else if ( + void 0 !== e.atoms[e.index].superscript || + void 0 !== e.atoms[e.index].subscript + ) + o = !0; + else { + let t = e.atoms[e.index].latex; + 'd' === t || 'D' === t + ? ((t = 'e'), (n = /^[0-9+-.]$/)) + : 'e' === t || 'E' === t + ? Qi(e) + ? ((t = ''), + (e.index -= 1), + (o = !0)) + : ((t = 'E'), (n = /^[0-9+-.]$/)) + : n === /^[0-9+-.]$/ && (n = /^[0-9]$/), + (a += ',' === t ? '' : t), + (e.index += 1); + } + if ( + ((e.ast = a ? Ji(a) : void 0), + (s = e.atoms[e.index]), + s && 'genfrac' === s.type && !isNaN(e.ast.num)) + ) { + const s = e.ast; + (e = t(e, i)).ast = Xi('add', s, e.ast); + } + if ( + s && + 'group' === s.type && + s.latex && + s.latex.startsWith('\\nicefrac') + ) { + const s = e.ast; + (e = t(e, i)).ast = Xi('add', s, e.ast); + } + s && 'msubsup' === s.type && (e = ts(e, i)), + (e = es(e, i)); + } else if ('genfrac' === s.type || 'surd' === s.type) + (e.ast = s.toAST(i)), (e = es((e = ts(e, i)), i)); + else if ('mord' === s.type || 'mbin' === s.type) { + if (Ei(a) && !Ii(s)) { + e.ast = { fn: a }; + const s = (e = ts(e, i)).ast, + o = t(e, i).ast; + o && /^(list0|list|list2)$/.test(o.fn) + ? (s.arg = o.arg) + : o && (s.arg = [o]), + (e.ast = s); + } else + (e.ast = s.toAST(i)), + 'ⅈ' === e.ast.sym && + (e.ast = Ji({ im: '1' })), + (e = ts(e)); + e = es(e, i); + } else if ('textord' === s.type) { + if ( + !Ii(s) && + !At.RIGHT_DELIM[ + s.latex ? s.latex.trim() : s.body + ] + ) + if (Ei(a)) { + e.ast = { fn: a }; + const s = (e = ts(e, i)).ast; + (e.index += 1), + (s.arg = [t(e, i).ast]), + (e.ast = s), + (e = es(e, i)); + } else + (e.ast = s.toAST(i)), + void 0 === s.superscript && + (e.index += 1), + (e = es((e = ts(e, i)), i)); + } else if ('mop' === s.type) { + if ( + (/^\\(mathop|operatorname|operatorname\*)/.test( + s.latex + ) || + Ei(a)) && + !Ii(s) + ) + if ( + ((e.ast = { + fn: /^\\(mathop|operatorname|operatorname\*)/.test( + s.latex + ) + ? Ni(s.body) + : a, + }), + ji((e = ts(e, i)).ast)) + ) { + const s = { + sin: 'arcsin', + cos: 'arccos', + tan: 'arctan', + cot: 'arccot', + sec: 'arcsec', + csc: 'arccsc', + sinh: 'arsinh', + cosh: 'arcosh', + tanh: 'artanh', + csch: 'arcsch', + sech: 'arsech', + coth: 'arcoth', + }; + if (-1 === Wi(e.ast.sup) && s[a]) + e.ast = Xi(s[a], t(e, i).ast); + else { + const s = e.ast; + (s.arg = [t(e, i).ast]), (e.ast = s); + } + } else { + const s = e.ast, + a = t(e, i).ast; + a && /^(list0|list|list2)$/.test(a.fn) + ? (s.arg = a.arg) + : a && (s.arg = [a]), + (e.ast = s); + } + } else if ('array' === s.type) + (e.index += 1), (e.ast = s.toAST(i)); + else if ('group' === s.type) + (e.index += 1), (e.ast = s.toAST(i)); + else { + if ('mclose' === s.type) return e; + if ('error' === s.type) + return ( + (e.index += 1), + (e.ast = { error: s.latex }), + e + ); + } + } + if (void 0 === e.ast) { + const t = is(e, '(', ')', i) || is(e, null, null, i); + t + ? (e = t) + : Ii(s) || + ('placeholder' === s.type + ? (e.ast = Ji(0)) + : ((e.ast = { text: '?' }), + (e.ast.error = + "Unexpected token '" + s.type + "'"), + s.latex + ? (e.ast.latex = s.latex) + : s.body && + s.toLatex && + (e.ast.latex = s.toLatex())), + (e.index += 1)); + } + if ( + ((s = e.atoms[e.index]), + s && + ('mord' === s.type || + 'surd' === s.type || + 'mop' === s.type || + 'mopen' === s.type || + 'sizeddelim' === s.type || + 'leftright' === s.type)) + ) { + if ('sizeddelim' === s.type) + for (const t in At.RIGHT_DELIM) + if (s.delim === At.RIGHT_DELIM[t]) + return (e.index += 1), e; + if ( + ('mord' === s.type || + 'textord' === s.type || + 'mop' === s.type) && + Ii(s) + ) + return e; + const a = e.ast; + (e.ast = {}), + (e = t(e, i)) && e.ast && a + ? (Ei(a.fn) && void 0 === a.arg) || + (Array.isArray(a.arg) && 0 === a.arg.length) + ? 'list2' === e.ast.fn || + 'list' === e.ast.fn + ? (e.ast = Xi(a.fn, e.ast.arg)) + : (e.ast = Xi('multiply', a, e.ast)) + : 'multiply' === e.ast.fn + ? e.ast.arg.unshift(a) + : 0 === Ui(a) && + 0 !== Vi(a) && + 1 === Ui(e.ast) && + 0 === Vi(e.ast) + ? (e.ast = Ji({ im: Vi(a).toString() })) + : (e.ast = Xi('multiply', a, e.ast)) + : (e.ast = a); + } + return e; + })(t, e).ast, + s = !1; + const a = t.minPrec; + for (; !s; ) { + const o = t.atoms[t.index], + n = as(t); + let r, l; + if ( + ((s = !o || 'text' === o.mode || (!n && !Ii(o))), + s || (([r, l] = n ? [Di(n), zi(n)] : Pi(o)), (s = r < a)), + !s) + ) { + const a = n || qi(Ni(o)); + if ( + ((t.minPrec = 'left' === l ? r + 1 : r), + (t.index += 1), + '|' === a) + ) + if ( + void 0 !== o.subscript || + (t.atoms[t.index] && + void 0 !== t.atoms[t.index].subscript && + 'msubsup' === t.atoms[t.index].type) + ) { + t.ast = {}; + const s = ts(t, e).ast.sub; + if ( + ((i = Xi('bind', i)), + s && 'equal' === s.fn && i.arg) + ) + i.arg.push(Fi(s, 0)), i.arg.push(Fi(s, 1)); + else if ( + s && + i.arg && + ('list' === s.fn || 'list2' === s.fn) + ) { + let t = { sym: 'x' }; + for (let e = 0; e < s.arg.length; e++) + 'equal' === s.arg[e].fn + ? ((t = Fi(s.arg[e], 0)), + i.arg.push(t), + i.arg.push(Fi(s.arg[e], 1))) + : (i.arg.push(t), i.arg.push(s.arg[e])); + } else + s && (i.arg.push({ sym: 'x' }), i.arg.push(s)); + } else s = !0; + else { + const s = os(t, e).ast; + let o = Ki[a]; + o && i && i.fn !== o && (i = Xi(o, i)), + '-' === a + ? i && i.arg && 'add' === i.fn + ? void 0 !== s && i.arg.push(Yi(s)) + : (i = + i && 'subtract' === i.fn + ? Xi( + 'add', + Fi(i, 0), + Yi(Fi(i, 1)), + Yi(s) + ) + : !Hi(i) || + ji(i) || + !Hi(s) || + ji(s) || + (void 0 !== s.num.re && + '0' !== s.num.re) || + void 0 === s.num.im + ? Xi('subtract', i, s) + : { + num: { + re: i.num, + im: (-parseFloat( + s.num.im + )).toString(), + }, + }) + : ((o = Ri[a]), + 'add' === o && i && 'subtract' === i.fn + ? (i = Xi( + 'add', + Fi(i, 0), + Yi(Fi(i, 1)), + s + )) + : o && i && i.fn === o && !ji(i) + ? void 0 !== s && + (s.fn === o && !ji(s) && s.arg + ? (i.arg = [...i.arg, ...s.arg]) + : i.arg && i.arg.push(s)) + : o && s && s.arg && s.fn === o + ? (s.arg.unshift(i), (i = s)) + : (i = + 'multiply' === o && + Hi(i) && + !ji(i) && + s && + 10 === Wi(s) && + Hi(s.sup) + ? Ji( + Wi(i) * + Math.pow( + 10, + Wi(s.sup) + ) + ) + : 'add' === o && + Hi(i) && + !ji(i) && + s && + 0 !== Ui(s) && + !ji(s) + ? { + num: { + re: i.num, + im: s.num.im, + }, + } + : Xi(o || _i[a] || a, i, s))); + } + } + } + return (t.ast = i), t; + } + function ns(t) { + if (!t) return []; + let e; + if (Array.isArray(t)) { + e = []; + for (const i of t) { + const t = ns(i); + e = e.concat(t); + } + } else { + if ('spacing' === t.type) return []; + 'first' === t.type || 'box' === t.type + ? (e = ns(t.body)) + : (t.body && Array.isArray(t.body) && (t.body = ns(t.body)), + t.superscript && + Array.isArray(t.superscript) && + (t.superscript = ns(t.superscript)), + t.subscript && + Array.isArray(t.subscript) && + (t.subscript = ns(t.subscript)), + t.index && + Array.isArray(t.index) && + (t.index = ns(t.index)), + t.denom && + Array.isArray(t.denom) && + (t.denom = ns(t.denom)), + t.numer && + Array.isArray(t.numer) && + (t.numer = ns(t.numer)), + t.array && + Array.isArray(t.array) && + (t.array = t.array.map(t => t.map(t => ns(t)))), + (e = [t])); + } + return e; + } + function rs(t, e) { + return (function(t, e) { + (t.index = t.index || 0), (t.ast = void 0); + const i = []; + for (; t.atoms[t.index]; ) + if ('text' === t.atoms[t.index].mode) { + let e = ''; + for ( + ; + t.atoms[t.index] && + 'text' === t.atoms[t.index].mode; + + ) + (e += t.atoms[t.index].body), (t.index += 1); + i.push(e); + } else { + const s = os(t, e).ast; + if (!s) return; + i.push(s); + } + return i.length > 1 ? Xi('text', ...i) : i[0] || void 0; + })({ atoms: ns(t) }, e); + } + function ls(t) { + const e = Array.prototype.slice.call(arguments); + e.shift(), (t = t || '.. '); + let i = ''; + if (e.length > 0) { + '.' !== t[0] && (i += t[0]); + let s = ''; + for (const a of e) (i += s + a), (s = t[2]); + '.' !== t[1] && (i += t[1]); + } + return i; + } + function cs(t, e) { + const i = t.length; + t = t.substr(0, e.precision - 2); + for (let i = 0; i < t.length - 16; i++) { + const s = t.substr(0, i); + for (let a = 0; a < 17; a++) { + const o = t.substr(i, a + 1), + n = Math.floor((t.length - s.length) / o.length); + if (n > 1 && (s + o.repeat(n + 1)).startsWith(t)) + return '0' === o + ? s.replace(/(\d{3})/g, '$1' + e.groupSeparator) + : s.replace(/(\d{3})/g, '$1' + e.groupSeparator) + + e.beginRepeatingDigits + + o.replace( + /(\d{3})/g, + '$1' + e.groupSeparator + ) + + e.endRepeatingDigits; + } + } + return ( + i !== t.length && (t += '\\ldots'), + t.replace(/(\d{3})/g, '$1' + e.groupSeparator) + ); + } + function hs(t) { + return parseFloat(parseFloat(t).toPrecision(15)); + } + function ds(t, e) { + let i = ''; + if ('number' == typeof e.precision) { + if ('number' != typeof t) { + let i = '', + s = ''; + if ( + ('-' === t[0] + ? ((i = '-'), (t = t.substr(1))) + : '+' === t[0] && (t = t.substr(1)), + t.indexOf('.') >= 0) + ) { + const a = t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/), + o = a[1], + n = a[2].substring( + 0, + Math.min(e.precision - o.length, a[2].length) + ); + if (((s = a[4] || ''), '0' === o)) { + let s = 0; + for (; '0' === n[s] && s < n.length; ) s += 1; + let a = ''; + if (s <= 4) + (a = '0' + e.decimalMarker), + (a += n.substr(0, s)), + (a += cs(t.substr(a.length), e)); + else if (s + 1 >= e.precision) (a = '0'), (i = ''); + else { + a = t[s]; + const i = cs(t.substr(s + 1), e); + i && (a += e.decimalMarker + i); + } + '0' !== a && + (t.length - 1 > e.precision && + !a.endsWith('}') && + !a.endsWith('\\ldots') && + (a += '\\ldots'), + s > 4 && + ((a += e.exponentProduct), + e.exponentMarker + ? (a += + e.exponentMarker + + (1 - s).toString()) + : (a += + '10^{' + + (1 - s).toString() + + '}'))), + (t = a); + } else { + t = o.replace( + /\B(?=(\d{3})+(?!\d))/g, + e.groupSeparator + ); + const i = cs(n, e); + i && (t += e.decimalMarker + i); + } + } else if (t.length > e.precision) { + const i = t.length; + let s = t[0]; + const a = cs(t.substr(2), e); + a && + ((s += e.decimalMarker + a), + '}' !== s[s.length - 1] && (s += '\\ldots')), + '1' !== s ? (s += e.exponentProduct) : (s = ''), + e.exponentMarker + ? (s += e.exponentMarker + (i - 2).toString()) + : (s += '10^{' + (i - 2).toString() + '}'), + (t = s); + } else + t = t.replace( + /\B(?=(\d{3})+(?!\d))/g, + e.groupSeparator + ); + return ( + s && + (s = e.exponentMarker + ? e.exponentMarker + s + : e.exponentProduct + ' 10^{' + s + '}'), + i + t + s + ); + } + t = hs(t); + } + if ('engineering' === e.scientificNotation) + if (0 === t) i = '0'; + else { + const s = Math.abs(t); + let a = Math.round(Math.log10(s)); + (a -= a % 3), s < 1e3 && (a = 0); + let o = s / Math.pow(10, a); + const n = o.toString().match(/^(.*)\.(.*)$/); + n && n[1] && n[2] && (o = n[1] + e.decimalMarker + n[2]), + e.groupSeparator && (o = cs(o.toExponential(), e)), + (a = + 0 === a + ? '' + : e.exponentMarker + ? e.exponentMarker + a + : e.exponentProduct + ' 10^{' + a + '}'), + (i = (t < 0 ? '-' : '') + o + a); + } + else { + const s = 'string' == typeof t ? t : t.toString(); + let a, + o, + n, + r = s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i); + (a = s), + (n = ''), + r && + r[1] && + r[2] && + ((a = r[1]), + (o = e.exponentMarker + ? e.exponentMarker + r[2] + : e.exponentProduct + ' 10^{' + r[2] + '}')), + (r = a.match(/^(.*)\.(.*)$/)), + r && r[1] && r[2] && ((a = r[1]), (n = r[2])), + e.groupSeparator && + ((a = a.replace( + /\B(?=(\d{3})+(?!\d))/g, + e.groupSeparator + )), + (n = cs(n, e))), + n && (n = e.decimalMarker + n), + (i = a + n + (o || '')); + } + return i; + } + (te.MathAtom.prototype.toAST = function(t) { + let e, + i, + s, + a, + o = {}, + r = '', + l = { + bb: 'double-struck', + cal: 'script', + scr: 'script', + frak: 'fraktur', + cmrss: 'sans-serif', + cmrtt: 'monospace', + }[this.baseFontFamily || this.fontFamily], + c = ''; + 'b' === this.fontSeries && (c += 'bold'), + 'it' === this.fontShape && (c += 'italic'); + const h = this.latex ? this.latex.trim() : null; + switch (this.type) { + case 'root': + case 'group': + this.latex && this.latex.startsWith('\\nicefrac') + ? ((e = this.latex + .slice(9) + .match(/({.*}|[^}])({.*}|[^}])/)), + e + ? ((i = + 1 === e[1].length + ? e[1] + : e[1].substr(1, e[1].length - 2)), + (i = he.parseTokens( + n(i), + 'math', + null, + t.macros + )), + (s = + 1 === e[2].length + ? e[2] + : e[2].substr(1, e[2].length - 2)), + (s = he.parseTokens( + n(s), + 'math', + null, + t.macros + )), + (o = Xi('divide', rs(i, t), rs(s, t)))) + : (o.fn = 'divide')) + : (o.group = rs(this.body, t)); + break; + case 'genfrac': + o = Xi( + 'divide', + rs(this.numer, t), + this.denom && + this.denom[0] && + 'placeholder' === this.denom[0].type + ? Ji(1) + : rs(this.denom, t) + ); + break; + case 'surd': + o = this.index + ? Xi( + 'pow', + rs(this.body, t), + Xi('divide', Ji(1), rs(this.index, t)) + ) + : Xi('sqrt', rs(this.body, t)); + break; + case 'rule': + break; + case 'line': + case 'overlap': + case 'accent': + case 'overunder': + break; + case 'mord': + case 'textord': + case 'mbin': + (e = h + ? h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/) + : void 0), + e + ? (r = String.fromCodePoint(parseInt(e[1], 16))) + : ((r = qi(Ni(this))), + r.length > 0 && + '\\' === r.charAt(0) && + 'string' == typeof this.body && + (r = this.body)), + (a = At.mathVariantToUnicode(r, l, c) + .replace(/[\\]/g, '\\\\') + .replace(/["]/g, '\\"') + .replace(/[\b]/g, '\\b') + .replace(/[\f]/g, '\\f') + .replace(/[\n]/g, '\\n') + .replace(/[\r]/g, '\\r') + .replace(/[\t]/g, '\\t')), + a !== r + ? ((o = { sym: a }), (l = 'normal')) + : (o = { sym: r }); + break; + case 'minner': + case 'mop': + break; + case 'box': + o = rs(this.body, t); + break; + case 'enclose': + break; + case 'array': + if ('cardinality' === this.env.name) + o = Xi('card', rs(this.array, t)); + else if ( + /array|matrix|pmatrix|bmatrix/.test(this.env.name) + ) { + o = { fn: 'array', args: [] }; + for (const e of this.array) + o.args.push(e.map(e => rs(e, t))); + } else if ('cases' === this.env.name) { + o = { fn: 'cases', args: [] }; + for (const e of this.array) + if (e[0]) { + const i = []; + i.push(rs(e[0], t)); + let s = rs(e[1], t); + s && + 'text' === s.fn && + s.arg && + /^(if|when|for)$/i.test(s.arg[0].trim()) && + (s = s.arg.filter( + t => 'string' != typeof t + )), + i.push(s || {}), + o.args.push(i); + } + } + break; + case 'spacing': + case 'space': + case 'mathstyle': + break; + default: + o = void 0; + } + return ( + o && l && 'normal' !== l && (o.variant = l), + o && + 'string' == typeof this.cssClass && + (o.class = this.cssClass), + o && 'string' == typeof this.cssId && (o.id = this.cssId), + o + ); + }), + (te.toAST = function(t, e) { + return rs(t, e); + }); + var ps = function t(e, i) { + const s = Object.assign( + { + precision: 14, + decimalMarker: '.', + groupSeparator: '\\, ', + product: '\\cdot ', + exponentProduct: '\\cdot ', + exponentMarker: '', + arcSeparator: '\\,', + scientificNotation: 'auto', + beginRepeatingDigits: '\\overline{', + endRepeatingDigits: '}', + }, + i + ); + let a = ''; + if (void 0 === e) return ''; + if (('string' == typeof e && (e = JSON.parse(e)), e.latex)) + a = e.latex; + else if (Hi(e)) { + const i = Wi(e); + if (i === -1 / 0) a = '-\\infty '; + else if (i === 1 / 0) a = '\\infty '; + else if ( + 'object' != typeof e.num || + ('string' != typeof e.num.re && 'string' != typeof e.num.im) + ) + a = isNaN(i) ? '\\text{NaN}' : ds(e.num, s); + else { + const t = Vi(e), + i = Ui(e); + isNaN(t) || isNaN(i) + ? (a = '\\text{NaN}') + : Math.abs(i) <= Number.EPSILON && + Math.abs(t) <= Number.EPSILON + ? (a = '0') + : (Math.abs(t) > Number.EPSILON && (a = ds(t, s)), + Math.abs(i) > Number.EPSILON && + (Math.abs(t) > Number.EPSILON && + (a += i > 0 ? '+' : ''), + (a += + (1 !== Math.abs(i) ? ds(i, s) : '') + + '\\imaginaryI '))); + } + ji(e) && (a += '^{' + t(e.sup, s) + '}'), + Gi(e) && (a += '_{' + t(e.sub, s) + '}'); + } else if (e.group) + (a = t(e.group, s)), + Hi(e.group) || $i(e.group) + ? 0 !== Ui(e.group) && (a = ls(e.fence || '(),', a)) + : (a = ls(e.fence || '(),', a)), + ji(e) && (a += '^{' + t(e.sup, s) + '}'), + Gi(e) && (a += '_{' + t(e.sub, s) + '}'); + else if (e.fn) + if ('bind' === e.fn) { + if ( + ((a = t(Fi(e, 0), s) + '|_{'), + e.arg && 2 === e.arg.length) + ) + a += t(Fi(e, 1)); + else { + let i = ''; + for (let s = 1; s < e.arg.length; s += 2) + (a += i + t(Fi(e, s)) + ' = ' + t(Fi(e, s + 1))), + (i = ', '); + } + a += '}'; + } else if ('divide' === e.fn) + a = + '\\frac{' + + t(Fi(e, 0), s) + + '}{' + + t(Fi(e, 1), s) + + '}'; + else if ('negate' === e.fn) a = '-' + t(Fi(e, 0), s); + else if ('subtract' === e.fn) + a = t(Fi(e, 0), s) + ' - ' + t(Fi(e, 1), s); + else if ( + ('add' !== e.fn && 'multiply' !== e.fn) || + !Array.isArray(e.arg) + ) + if ('list' === e.fn || 'list2' === e.fn) { + const i = []; + for (const a of e.arg) i.push(t(a, s)); + a = i.join('list2' === e.fn ? '; ' : ', '); + } else if ( + 'pow' === e.fn && + Array.isArray(e.arg) && + e.arg.length >= 2 + ) + (a = t(Fi(e, 0), s)), + Hi(Fi(e, 0)) || + $i(Fi(e, 0)) || + (a = ls(e.fence || '(),', a)), + (a += '^{' + t(Fi(e, 1), s) + '}'); + else if ('equal' === e.fn && e.arg && e.arg.length > 2) + a = e.arg.map(e => t(e, s)).join(' = '); + else { + const i = (function(t) { + let e = Ti[t]; + return ( + e || + (e = + t.length > 1 + ? '\\operatorname{' + t + '}%^%_ %' + : t + '%^%_ %'), + e + ); + })(e.fn); + a = i; + let o = ''; + if ( + /%(?![01_^])/.test(i) && + Array.isArray(e.arg) && + e.arg.length > 1 + ) + a += ls( + e.fence || '(),', + ...e.arg.map(e => t(e, s)) + ); + else if (Array.isArray(e.arg) && e.arg.length > 0) { + const n = t(Fi(e, 0), s), + r = t(Fi(e, 1), s), + l = [...e.arg]; + /%0/.test(i) && + ((a = a.replace('%0', n)), l.shift()), + /%1/.test(i) && + ((a = a.replace('%1', r)), l.shift()), + l.length > 0 && + (o = ls( + e.fence || '(),', + ...l.map(e => t(e, s)) + )); + } else o = ls(e.fence || '(),', ''); + (a = ji(e) + ? a.replace('%^', '^{' + t(e.sup, s) + '}') + : a.replace('%^', '')), + (a = Gi(e) + ? a.replace('%_', '_{' + t(e.sub, s) + '}') + : a.replace('%_', '')), + (a = a.replace(/%(?![01_^])/, o)), + (a = a.replace('%0', '').replace('%1', '')); + } + else { + const i = []; + for (const a of e.arg) + 'add' === a.fn || 'subtract' === a.fn + ? i.push(ls('() ', t(a, s))) + : 0 !== Vi((o = a)) && 0 !== Ui(o) + ? i.push(ls('() ', t(a, s))) + : ji(e) && 0 !== Ui(a) && 1 !== Ui(a) + ? i.push(ls('() ', t(a, s))) + : i.push(t(a, s)); + if ('multiply' === e.fn) + a = + !e.arg || + 2 !== e.arg.length || + (!Hi(e.arg[0]) && 'divide' !== e.arg[0].fn) || + (Hi(e.arg[1]) && + (0 !== Vi(e.arg[1]) || 1 !== Ui(e.arg[1]))) + ? i.join(' \\times ') + : i[0] + i[1]; + else if (e.arg && 1 === e.arg.length) + a = + 'negate' === e.arg[0].fn || + (Hi(e.arg[0]) && Wi(e.arg[0]) < 0) + ? i[0] + : '+' + i[0]; + else { + a = i[0]; + for (let t = 1; t < e.arg.length; t++) + 'negate' === e.arg[t].fn || + (Hi(e.arg[t]) && Wi(e.arg[t]) < 0) + ? (a += i[t]) + : (a += ' + ' + i[t]); + } + } + else if ('string' == typeof e.sym) { + a = $i(e); + let i = a.match(/^&#x([0-9a-f]+);$/i); + i && i[1] + ? (a = String.fromCodePoint(parseInt(i[1], 16))) + : ((i = a.match(/^&#([0-9]+);$/i)), + i && i[1] && (a = String.fromCodePoint(parseInt(i[1])))), + 'string' == typeof e.variant && + (a = + '\\' + + { + normal: 'mathrm', + 'double-struck': 'mathbb', + bold: 'mathbf', + fraktur: 'mathfrak', + script: 'mathscr', + 'sans-serif': 'mathsf', + monospace: 'mathtt', + }[e.variant] + + '{' + + a + + '}'), + ji(e) && (a += '^{' + t(e.sup, s) + '}'), + Gi(e) && (a += '_{' + t(e.sub, s) + '}'); + } else 'string' == typeof e.text && (a = '\\text{' + e.text + '}'); + var o; + return ( + 'string' == typeof e.error && + (a = '\\bbox[#F56165]{' + a + '}'), + a + ); + }; + const ms = { + '\\alpha': 'alpha ', + '\\mu': 'mew ', + '\\sigma': 'sigma ', + '\\pi': 'pie ', + '\\imaginaryI': 'eye ', + '\\sum': 'Summation ', + '\\prod': 'Product ', + a: 'a', + A: 'capital A', + '+': 'plus ', + '-': 'minus ', + ';': ' semi-colon ', + ',': ' comma ', + '|': 'Vertical bar', + '(': 'Open paren. ', + ')': ' Close paren. ', + '=': 'equals ', + '<': 'is less than ', + '\\lt': 'is less than ', + '<=': 'is less than or equal to ', + '\\le': 'is less than or equal to ', + '\\gt': 'is greater than ', + '>': 'is greater than ', + '\\ge': 'is greater than or equal to ', + '\\geq': 'is greater than or equal to ', + '\\leq': 'is less than or equal to ', + '!': 'factorial ', + '\\sin': 'sine ', + '\\cos': 'cosine ', + '​': '', + '−': 'minus ', + ':': ' such that ', + '\\colon': ' such that ', + '\\hbar': 'etch bar ', + '\\iff': + 'if, and only if, ', + '\\Longleftrightarrow': + 'if, and only if, ', + '\\land': 'and ', + '\\lor': 'or ', + '\\neg': 'not ', + '\\div': 'divided by ', + '\\forall': 'for all ', + '\\exists': 'there exists ', + '\\nexists': 'there does not exists ', + '\\in': 'element of ', + '\\N': + 'the set n', + '\\C': + 'the set c', + '\\Z': + 'the set z', + '\\Q': + 'the set q', + '\\infty': 'infinity ', + '\\nabla': 'nabla ', + '\\partial': 'partial derivative of ', + '\\cdots': 'dot dot dot ', + '\\Rightarrow': 'implies ', + '\\lbrace': 'open brace', + '\\{': 'open brace', + '\\rbrace': 'close brace', + '\\}': 'close brace', + '\\langle': + 'left angle bracket', + '\\rangle': + 'right angle bracket', + '\\lfloor': 'open floor', + '\\rfloor': 'close floor', + '\\lceil': 'open ceiling', + '\\rceil': + 'close ceiling', + '\\vert': 'vertical bar', + '\\mvert': 'divides', + '\\lvert': + 'left vertical bar', + '\\rvert': + 'right vertical bar', + '\\lbrack': + ' open square bracket ', + '\\rbrack': + ' close square bracket ', + mm: 'millimeters', + cm: 'centimeters', + km: 'kilometers', + kg: 'kilograms', + }; + function us(t) { + let e = 0; + if (t && Array.isArray(t)) + for (const i of t) 'first' !== i.type && (e += 1); + return 1 === e; + } + function fs(t) { + let e = ''; + if (t && Array.isArray(t)) + for (const i of t) + 'first' !== i.type && + 'string' == typeof i.body && + (e += i.body); + return e; + } + function gs(t, e, i, s) { + e = e.split(' '); + for (const a of e) { + const e = a.match(/(.*):(.*)/); + if (e) { + const a = s || {}; + 'active' === e[2] ? (a.passive = !1) : (a[e[2]] = !0), + t.addEventListener(e[1], i, a); + } else t.addEventListener(a, i, s); + } + } + function ys(t, e, i, s) { + e = e.split(' '); + for (const a of e) { + const e = a.match(/(.*):(.*)/); + if (e) { + const a = s || {}; + 'active' === e[2] ? (a.passive = !1) : (a[e[2]] = !0), + t.removeEventListener(e[1], i, a); + } else t.removeEventListener(a, i, s); + } + } + function bs(t, e) { + let i = document.getElementById(t); + return ( + i + ? i.setAttribute( + 'data-refcount', + parseInt(i.getAttribute('data-refcount')) + 1 + ) + : ((i = document.createElement('div')), + i.setAttribute('aria-hidden', 'true'), + i.setAttribute('data-refcount', '1'), + (i.className = e), + (i.id = t), + document.body.appendChild(i)), + i + ); + } + function xs(t) { + if (!t) return null; + const e = parseInt(t.getAttribute('data-refcount')); + return ( + e && 1 !== e + ? t.setAttribute('data-refcount', e - 1) + : t.remove(), + t + ); + } + function ks(t) { + return t.element && t.element.mathfield === t; + } + (te.toSpeakableFragment = function(t, e) { + function i(t) { + return '' + t + ''; + } + if (!t) return ''; + let s = ''; + if ( + (t.id && + 'math' === e.speechMode && + (s += ''), + Array.isArray(t)) + ) { + let a = !1, + o = !1; + for (let n = 0; n < t.length; n++) + 'text' !== t[n].mode && (o = !1), + n < t.length - 2 && + 'mopen' === t[n].type && + 'mclose' === t[n + 2].type && + 'mord' === t[n + 1].type + ? ((s += ' of '), + (s += i(te.toSpeakableFragment(t[n + 1], e))), + (n += 2)) + : 'text' === t[n].mode + ? o + ? (s += t[n].body ? t[n].body : ' ') + : ((o = !0), + (s += te.toSpeakableFragment(t[n], e))) + : 'mord' === t[n].type && + /[0123456789,.]/.test(t[n].body) + ? a + ? (s += t[n].body) + : ((a = !0), + (s += te.toSpeakableFragment(t[n], e))) + : ((a = !1), + (s += te.toSpeakableFragment(t[n], e))); + } else if ('text' === t.mode) s += t.body; + else { + let a = '', + o = '', + n = '', + r = !1; + switch (t.type) { + case 'group': + case 'root': + s += te.toSpeakableFragment(t.body, e); + break; + case 'genfrac': + if ( + ((a = te.toSpeakableFragment(t.numer, e)), + (o = te.toSpeakableFragment(t.denom, e)), + us(t.numer) && us(t.denom)) + ) { + const e = { + '1/2': ' half ', + '1/3': ' one third ', + '2/3': ' two third', + '1/4': ' one quarter ', + '3/4': ' three quarter ', + '1/5': ' one fifth ', + '2/5': ' two fifths ', + '3/5': ' three fifths ', + '4/5': ' four fifths ', + '1/6': ' one sixth ', + '5/6': ' five sixths ', + '1/8': ' one eight ', + '3/8': ' three eights ', + '5/8': ' five eights ', + '7/8': ' seven eights ', + '1/9': ' one ninth ', + '2/9': ' two ninths ', + '4/9': ' four ninths ', + '5/9': ' five ninths ', + '7/9': ' seven ninths ', + '8/9': ' eight ninths ', + }[fs(t.numer) + '/' + fs(t.denom)]; + e ? (s = e) : (s += a + ' over ' + o); + } else + s += + ' the fraction ' + + a + + ', over ' + + o + + '. End fraction.'; + break; + case 'surd': + if ( + ((n = te.toSpeakableFragment(t.body, e)), t.index) + ) { + let i = te.toSpeakableFragment(t.index, e); + i = i.trim(); + const a = i.replace(//g, ''); + s += + '3' === a + ? ' the cube root of ' + + n + + '. End cube root' + : 'n' === a + ? ' the nth root of ' + + n + + '. End root' + : ' the root with index: ' + + i + + ', of ' + + n + + '. End root'; + } else + us(t.body) + ? (s += ' the square root of ' + n + ' , ') + : (s += + ' the square root of ' + + n + + '. End square root'); + break; + case 'accent': + break; + case 'leftright': + (s += ms[t.leftDelim] || t.leftDelim), + (s += te.toSpeakableFragment(t.body, e)), + (s += ms[t.rightDelim] || t.rightDelim); + break; + case 'line': + case 'rule': + case 'overunder': + case 'overlap': + break; + case 'placeholder': + s += 'placeholder ' + t.body; + break; + case 'delim': + case 'sizeddelim': + case 'mord': + case 'minner': + case 'mbin': + case 'mrel': + case 'mpunct': + case 'mopen': + case 'mclose': + case 'textord': { + const i = t.latex ? t.latex.trim() : ''; + if ( + '\\mathbin' === i || + '\\mathrel' === i || + '\\mathopen' === i || + '\\mathclose' === i || + '\\mathpunct' === i || + '\\mathord' === i || + '\\mathinner' === i + ) { + s = te.toSpeakableFragment(t.body, e); + break; + } + let a = t.body, + o = t.latex; + if ( + (('delim' !== t.type && 'sizeddelim' !== t.type) || + (a = o = t.delim), + 'text' === e.speechMode) + ) + s += a; + else { + if ( + ('mbin' === t.type && + (s += ''), + a) + ) { + const t = ms[a] || (o ? ms[o.trim()] : ''); + if (t) s += ' ' + t; + else { + const t = o + ? (function(t) { + let e = Je.NOTES[t]; + return ( + e || + '\\' !== t.charAt(0) || + (e = + ' ' + + t.replace('\\', '') + + ' '), + Array.isArray(e) && + (e = e[0]), + e + ); + })(o.trim()) + : ''; + s += + t || + (function(t) { + let i = ''; + return ( + e.textToSpeechMarkup + ? /[a-z]/.test(t) + ? (i += + ' ' + + t + + '') + : /[A-Z]/.test(t) + ? (i += + 'capital ' + + t.toLowerCase()) + : (i += t) + : /[a-z]/.test(t) + ? (i += + " '" + + t.toUpperCase() + + "'") + : /[A-Z]/.test(t) + ? (i += + " 'capital " + + t.toUpperCase() + + "'") + : (i += t), + i + ); + })(a); + } + } else s += te.toSpeakableFragment(t.body, e); + 'mbin' === t.type && (s += ''); + } + break; + } + case 'mop': + if ('​' !== t.body) { + const a = t.latex ? t.latex.trim() : ''; + if ('\\sum' === a) + if (t.superscript && t.subscript) { + let i = te.toSpeakableFragment( + t.superscript, + e + ); + i = i.trim(); + let a = te.toSpeakableFragment( + t.subscript, + e + ); + (a = a.trim()), + (s += + ' the summation from ' + + a + + ' to ' + + i + + ' of '), + (r = !0); + } else if (t.subscript) { + let i = te.toSpeakableFragment( + t.subscript, + e + ); + (i = i.trim()), + (s += + ' the summation from ' + + i + + ' of '), + (r = !0); + } else s += ' the summation of'; + else if ('\\prod' === a) + if (t.superscript && t.subscript) { + let i = te.toSpeakableFragment( + t.superscript, + e + ); + i = i.trim(); + let a = te.toSpeakableFragment( + t.subscript, + e + ); + (a = a.trim()), + (s += + ' the product from ' + + a + + ' to ' + + i + + ' of '), + (r = !0); + } else if (t.subscript) { + let i = te.toSpeakableFragment( + t.subscript, + e + ); + (i = i.trim()), + (s += + ' the product from ' + + i + + ' of '), + (r = !0); + } else s += ' the product of '; + else if ('\\int' === a) + if (t.superscript && t.subscript) { + let a = te.toSpeakableFragment( + t.superscript, + e + ); + a = a.trim(); + let o = te.toSpeakableFragment( + t.subscript, + e + ); + (o = o.trim()), + (s += + ' the integral from ' + + i(o) + + ' to ' + + i(a) + + ' of '), + (r = !0); + } else + s += + ' the integral of '; + else if ('string' == typeof t.body) { + s += + ms[t.body] || + ms[t.latex.trim()] || + ' ' + t.body; + } else + t.latex && + t.latex.length > 0 && + ('\\' === t.latex[0] + ? (s += ' ' + t.latex.substr(1)) + : (s += ' ' + t.latex)); + } + break; + case 'enclose': + (n = te.toSpeakableFragment(t.body, e)), + us(t.body) + ? (s += ' crossed out ' + n + ' , ') + : (s += + ' crossed out ' + n + '. End cross out'); + } + if (!r && t.superscript) { + let i = te.toSpeakableFragment(t.superscript, e); + i = i.trim(); + const a = i.replace(/<[^>]*>/g, ''); + if (us(t.superscript)) { + if ('math' === e.speechMode) { + const e = (function(t) { + if (t && Array.isArray(t)) + for (const e of t) + if ('first' !== e.type && e.id) + return e.id.toString(); + return ''; + })(t.superscript); + e && (s += ''); + } + '′' === a + ? (s += ' prime ') + : '2' === a + ? (s += ' squared ') + : '3' === a + ? (s += ' cubed ') + : isNaN(parseInt(a)) + ? (s += ' to the ' + i + '; ') + : (s += + ' to the ' + + a + + ' power; '); + } else + isNaN(parseInt(a)) + ? (s += ' raised to the ' + i + '; ') + : (s += + ' raised to the ' + + a + + ' power; '); + } + if (!r && t.subscript) { + let i = te.toSpeakableFragment(t.subscript, e); + (i = i.trim()), + us(t.subscript) + ? (s += ' sub ' + i) + : (s += ' subscript ' + i + '. End subscript. '); + } + } + return s; + }), + (te.toSpeakableText = function(t, e) { + const i = e + ? JSON.parse(JSON.stringify(e)) + : { textToSpeechMarkup: '', textToSpeechRules: 'mathlive' }; + if ( + ((i.speechMode = 'math'), + window.sre && 'sre' === i.textToSpeechRules) + ) { + i.generateID = !0; + const e = te.toMathML(t, i); + return e + ? (i.textToSpeechMarkup && + ((i.textToSpeechRulesOptions = + i.textToSpeechRulesOptions || {}), + (i.textToSpeechRulesOptions.markup = + i.textToSpeechMarkup), + 'ssml' === i.textToSpeechRulesOptions.markup && + (i.textToSpeechRulesOptions.markup = + 'ssml_step'), + (i.textToSpeechRulesOptions.rate = + i.speechEngineRate)), + i.textToSpeechRulesOptions && + window.sre.System.getInstance().setupEngine( + i.textToSpeechRulesOptions + ), + window.sre.System.getInstance().toSpeech(e)) + : ''; + } + let s = te.toSpeakableFragment(t, i); + if ('ssml' === i.textToSpeechMarkup) { + let t = ''; + i.speechEngineRate && + (t = ''), + (s = + '' + + t + + '

    ' + + s + + '

    ' + + (t ? '
    ' : '') + + ''); + } else + s = + 'mac' === i.textToSpeechMarkup && + 'mac' === + (function(t) { + let e = 'other'; + return ( + navigator && + navigator.platform && + navigator.userAgent && + (/^(mac)/i.test(navigator.platform) + ? (e = 'mac') + : /^(win)/i.test(navigator.platform) + ? (e = 'win') + : /(android)/i.test( + navigator.userAgent + ) + ? (e = 'android') + : /(iphone)/i.test( + navigator.userAgent + ) || + /(ipod)/i.test( + navigator.userAgent + ) || + /(ipad)/i.test( + navigator.userAgent + ) + ? (e = 'ios') + : /\bCrOS\b/i.test( + navigator.userAgent + ) && (e = 'chromeos')), + e === t ? t : '!' + t + ); + })('mac') + ? s + .replace(//g, '') + .replace(//g, '[[emph+]]') + .replace(/<\/emphasis>/g, '') + .replace( + //g, + '[[slc $1]]' + ) + .replace(/]*>/g, '') + .replace(/<\/say-as>/g, '') + : s.replace(/<[^>]*>/g, '').replace(/\s{2,}/g, ' '); + return s; + }); + class vs { + constructor(t, e) { + this.$setConfig(e || {}), + (this.element = t), + (t.mathfield = this), + (this.originalContent = t.innerHTML); + let i = this.element.textContent; + i && (i = i.trim()); + let s = ''; + this.config.substituteTextArea + ? 'string' == typeof this.config.substituteTextArea + ? (s += this.config.substituteTextArea) + : (s += '') + : /android|ipad|ipod|iphone/i.test(navigator.userAgent) + ? (s += + "\n \n \n ") + : (s += + ''), + (s += + ''), + this.config.virtualKeyboardMode || + (this.config.virtualKeyboardMode = + window.matchMedia && + window.matchMedia('(any-pointer: coarse)').matches + ? 'onfocus' + : 'off'), + 'manual' === this.config.virtualKeyboardMode + ? ((s += `')) + : (s += ''), + (s += ''), + (s += + '\n
    \n \n \n
    \n '), + (this.element.innerHTML = s); + let a = 0; + 'function' == typeof this.config.substituteTextArea + ? (this.textarea = this.config.substituteTextArea()) + : (this.textarea = this.element.children[ + a++ + ].firstElementChild), + (this.field = this.element.children[a].children[0]), + this.field.addEventListener( + 'wheel', + t => { + t.preventDefault(), t.stopPropagation(); + let e = void 0 === t.deltaX ? t.detail : -t.deltaX; + isFinite(e) || (e = t.wheelDelta / 10), + this.field.scroll({ + top: 0, + left: this.field.scrollLeft - 5 * e, + }); + }, + { passive: !1 } + ), + (this.virtualKeyboardToggleDOMNode = this.element.children[ + a++ + ].children[1]), + this._attachButtonHandlers( + this.virtualKeyboardToggleDOMNode, + { + default: 'toggleVirtualKeyboard', + alt: 'toggleVirtualKeyboardAlt', + shift: 'toggleVirtualKeyboardShift', + } + ), + (this.ariaLiveText = this.element.children[a].children[0]), + (this.accessibleNode = this.element.children[ + a++ + ].children[1]), + (this.popover = bs( + 'mathlive-popover-panel', + 'ML__popover' + )), + (this.keystrokeCaption = bs( + 'mathlive-keystroke-caption-panel', + 'ML__keystroke-caption' + )), + (this.keystrokeCaptionVisible = !1), + (this.virtualKeyboardVisible = !1), + (this.keystrokeBuffer = ''), + (this.keystrokeBufferStates = []), + (this.keystrokeBufferResetTimer = null), + (this.suggestionIndex = 0), + (this.mode = e.defaultMode || 'math'), + (this.smartModeSuppressed = !1), + (this.style = {}), + (this.blurred = !0), + gs(this.element, 'focus', this), + gs(this.element, 'blur', this), + gs(this.textarea, 'cut', this), + gs(this.textarea, 'copy', this), + gs(this.textarea, 'paste', this), + He.delegateKeyboardEvents(this.textarea, { + container: this.element, + allowDeadKey: () => 'text' === this.mode, + typedText: this._onTypedText.bind(this), + paste: this._onPaste.bind(this), + keystroke: this._onKeystroke.bind(this), + focus: this._onFocus.bind(this), + blur: this._onBlur.bind(this), + }), + window.PointerEvent + ? gs(this.field, 'pointerdown', this) + : gs(this.field, 'touchstart:active mousedown', this), + gs(window, 'resize', this); + const o = { ...e }; + (o.onSelectionDidChange = vs.prototype._onSelectionDidChange.bind( + this + )), + (o.onContentDidChange = vs.prototype._onContentDidChange.bind( + this + )), + (o.onAnnounce = this.config.onAnnounce), + (o.macros = this.config.macros), + (o.removeExtraneousParentheses = this.config.removeExtraneousParentheses), + (this.mathlist = new Oe.EditableMathlist(o, this)), + (this.undoManager = new (class { + constructor(t) { + (this.mathlist = t), + (this.maximumDepth = 1e3), + (this.record = !1), + (this.canCoalesce = !1), + this.reset(); + } + reset() { + (this.stack = []), (this.index = -1); + } + startRecording() { + this.record = !0; + } + canUndo() { + return this.index > 0; + } + canRedo() { + return this.index !== this.stack.length - 1; + } + undo(t) { + this.canUndo() && + (t && + 'function' == + typeof t.onUndoStateWillChange && + t.onUndoStateWillChange( + this.mathlist.target, + 'undo' + ), + this.restore(this.stack[this.index - 1], t), + (this.index -= 1), + t && + 'function' == + typeof t.onUndoStateDidChange && + t.onUndoStateDidChange( + this.mathlist.target, + 'undo' + ), + (this.canCoalesce = !1)); + } + redo(t) { + this.canRedo() && + (t && + 'function' === t.onUndoStateWillChange && + t.onUndoStateWillChange( + this.mathlist.target, + 'redo' + ), + (this.index += 1), + this.restore(this.stack[this.index], t), + t && + 'function' == + typeof t.onUndoStateDidChange && + t.onUndoStateDidChange( + this.mathlist.target, + 'redo' + ), + (this.canCoalesce = !1)); + } + pop() { + this.canUndo() && + ((this.index -= 1), this.stack.pop()); + } + snapshot(t) { + this.record && + (t && + 'function' === t.onUndoStateWillChange && + t.onUndoStateWillChange( + this.mathlist.target, + 'snapshot' + ), + this.stack.splice( + this.index + 1, + this.stack.length - this.index - 1 + ), + this.stack.push({ + latex: this.mathlist.root.toLatex(), + selection: this.mathlist.toString(), + }), + this.index++, + this.stack.length > this.maximumDepth && + this.stack.shift(), + t && + 'function' == + typeof t.onUndoStateDidChange && + t.onUndoStateDidChange( + this.mathlist.target, + 'snapshot' + ), + (this.canCoalesce = !1)); + } + snapshotAndCoalesce(t) { + this.canCoalesce && this.pop(), + this.snapshot(t), + (this.canCoalesce = !0); + } + save() { + return { + latex: this.mathlist.root.toLatex(), + selection: this.mathlist.toString(), + }; + } + restore(t, e) { + const i = this.mathlist.suppressChangeNotifications; + void 0 !== e.suppressChangeNotifications && + (this.mathlist.suppressChangeNotifications = + e.suppressChangeNotifications), + this.mathlist.insert(t ? t.latex : '', { + mode: 'math', + insertionMode: 'replaceAll', + selectionMode: 'after', + format: 'latex', + ...e, + }), + this.mathlist.setPath( + t + ? t.selection + : [{ relation: 'body', offset: 0 }] + ), + (this.mathlist.suppressChangeNotifications = i); + } + })(this.mathlist)), + i.length > 0 && this.$latex(i), + this.undoManager.startRecording(), + this.undoManager.snapshot(this.config); + } + handleEvent(t) { + switch (t.type) { + case 'focus': + this._onFocus(t); + break; + case 'blur': + this._onBlur(t); + break; + case 'touchstart': + case 'mousedown': + case 'pointerdown': + this._onPointerDown(t); + break; + case 'resize': + this._resizeTimer && + window.cancelAnimationFrame(this._resizeTimer), + (this._resizeTimer = window.requestAnimationFrame( + () => ks(this) && this._onResize() + )); + break; + case 'cut': + this._onCut(t); + break; + case 'copy': + this._onCopy(t); + break; + case 'paste': + this._onPaste(t); + } + } + $revertToOriginalContent() { + (this.element.innerHTML = this.originalContent), + (this.element.mathfield = null), + delete this.accessibleNode, + delete this.ariaLiveText, + delete this.field, + ys(this.textarea, 'cut', this), + ys(this.textarea, 'copy', this), + ys(this.textarea, 'paste', this), + this.textarea.remove(), + delete this.textarea, + this.virtualKeyboardToggleDOMNode.remove(), + delete this.virtualKeyboardToggleDOMNode, + xs(this.popover), + xs(this.keystrokeCaption), + xs(this.virtualKeyboard), + xs( + document.getElementById('mathlive-alternate-keys-panel') + ), + ys(this.element, 'pointerdown', this), + ys(this.element, 'touchstart:active mousedown', this), + ys(this.element, 'focus', this), + ys(this.element, 'blur', this), + ys(window, 'resize', this), + delete this.element; + } + _resetKeystrokeBuffer() { + (this.keystrokeBuffer = ''), + (this.keystrokeBufferStates = []), + clearTimeout(this.keystrokeBufferResetTimer); + } + _getCaretPosition() { + const t = (function t(e) { + if ( + e.classList.contains('ML__caret') || + e.classList.contains('ML__text-caret') || + e.classList.contains('ML__command-caret') + ) + return e; + let i; + return ( + Array.from(e.children).forEach(function(e) { + i = i || t(e); + }), + i + ); + })(this.field); + if (t) { + const e = t.getBoundingClientRect(); + return { x: e.right, y: e.bottom, height: e.height }; + } + return null; + } + _getSelectionBounds() { + const t = this.field.querySelectorAll('.ML__selected'); + if (t && t.length > 0) { + const e = { + top: 1 / 0, + bottom: -1 / 0, + left: 1 / 0, + right: -1 / 0, + }; + t.forEach(t => { + const i = t.getBoundingClientRect(); + i.left < e.left && (e.left = i.left), + i.right > e.right && (e.right = i.right), + i.bottom > e.bottom && (e.bottom = i.bottom), + i.top < e.top && (e.top = i.top); + }); + const i = this.field.getBoundingClientRect(), + s = e.right - e.left, + a = e.bottom - e.top; + return ( + (e.left = Math.ceil( + e.left - i.left + this.field.scrollLeft + )), + (e.right = e.left + s), + (e.top = Math.ceil(e.top - i.top)), + (e.bottom = e.top + a), + e + ); + } + return null; + } + _pathFromPoint(t, e, i) { + let s; + (i = i || {}).bias = i.bias || 0; + const a = (function t(e, i, s) { + let a = { + element: null, + distance: Number.POSITIVE_INFINITY, + }, + o = !0; + if (e.getAttribute('data-atom-id')) { + a.element = e; + const t = e.getBoundingClientRect(), + n = i - (t.left + t.right) / 2, + r = s - (t.top + t.bottom) / 2; + (a.distance = n * n + r * r), + (o = i >= t.left && i <= t.right); + } + return ( + o && + e.children && + Array.from(e.children).forEach(function(e) { + const o = t(e, i, s); + o.element && + o.distance <= a.distance && + (a = o); + }), + a + ); + })(this.field, t, e).element, + o = a ? a.getAttribute('data-atom-id') : null; + if (o) { + const e = this.mathlist.filter(function(t, e) { + return e.captureSelection + ? e.filter(t => t.id === o).length > 0 + : e.id === o; + }); + if (e && e.length > 0) + if ( + ((s = me.pathFromString(e[0]).path), 0 === i.bias) + ) { + const e = a.getBoundingClientRect(); + t < e.left + e.width / 2 && + !a.classList.contains('ML__placeholder') && + (s[s.length - 1].offset = Math.max( + 0, + s[s.length - 1].offset - 1 + )); + } else + i.bias < 0 && + (s[s.length - 1].offset = Math.min( + this.mathlist.siblings().length - 1, + Math.max(0, s[s.length - 1].offset + i.bias) + )); + } + return s; + } + _onPointerDown(t) { + const e = this; + let i, + s = !1, + a = !1, + o = !1; + if (1 !== t.buttons) return; + function n(t) { + window.PointerEvent + ? (ys(e.field, 'pointermove', h), + ys( + e.field, + 'pointerend pointerleave pointercancel', + n + ), + e.field.releasePointerCapture(t.pointerId)) + : (ys(e.field, 'touchmove', h), + ys(e.field, 'touchend touchleave', n), + ys(window, 'mousemove', h), + ys(window, 'mouseup blur', n)), + (s = !1), + clearInterval(c), + e.element + .querySelectorAll('.ML__scroller') + .forEach(t => t.parentNode.removeChild(t)), + t.preventDefault(), + t.stopPropagation(); + } + let r = !1, + l = !1; + const c = setInterval(() => { + r + ? e.field.scroll({ + top: 0, + left: e.field.scrollLeft - 16, + }) + : l && + e.field.scroll({ + top: 0, + left: e.field.scrollLeft + 16, + }); + }, 32); + function h(t) { + const s = t.touches ? t.touches[0].clientX : t.clientX, + o = t.touches ? t.touches[0].clientY : t.clientY, + n = 'touch' === t.pointerType ? 20 : 5; + if ( + Date.now() < m + 500 && + Math.abs(d - s) < n && + Math.abs(p - o) < n + ) + return t.preventDefault(), void t.stopPropagation(); + const c = e.field.getBoundingClientRect(); + (l = s > c.right), (r = s < c.left); + let h = i; + window.PointerEvent + ? t.isPrimary || + (h = e._pathFromPoint(t.clientX, t.clientY, { + bias: 0, + })) + : t.touches && + 2 === t.touches.length && + (h = e._pathFromPoint( + t.touches[1].clientX, + t.touches[1].clientY, + { bias: 0 } + )); + const u = e._pathFromPoint(s, o, { + bias: s <= d ? (s === d ? 0 : -1) : 1, + }); + u && + e.mathlist.setRange(h, u, { + extendToWordBoundary: a, + }) && + e._requestUpdate(), + t.preventDefault(), + t.stopPropagation(); + } + const d = t.touches ? t.touches[0].clientX : t.clientX, + p = t.touches ? t.touches[0].clientY : t.clientY, + m = Date.now(); + ws && + Math.abs(ws.x - d) < 5 && + Math.abs(ws.y - p) < 5 && + Date.now() < ws.time + 500 + ? ((Ss += 1), (ws.time = m)) + : ((ws = { x: d, y: p, time: m }), (Ss = 1)); + const u = this.field.getBoundingClientRect(); + if ( + d >= u.left && + d <= u.right && + p >= u.top && + p <= u.bottom + ) { + if ( + (this.$hasFocus() || + ((o = !0), + this.textarea.focus && this.textarea.focus()), + this._resetKeystrokeBuffer(), + (this.smartModeSuppressed = !1), + (i = this._pathFromPoint(d, p, { bias: 0 })), + i) + ) { + let r = document.createElement('div'); + (r.className = 'ML__scroller'), + this.element.appendChild(r), + (r.style.left = u.left - 200 + 'px'), + (r = document.createElement('div')), + (r.className = 'ML__scroller'), + this.element.appendChild(r), + (r.style.left = u.right + 'px'), + t.shiftKey + ? (this.mathlist.setRange( + this.mathlist.path, + i + ), + (i = me.clone(this.mathlist.path)), + (i[i.length - 1].offset -= 1)) + : this.mathlist.setPath(i, 0), + (o = !0), + (this.style = {}), + 3 === t.detail || Ss > 2 + ? (n(t), + (3 !== t.detail && 3 !== Ss) || + this.mathlist.selectAll_()) + : s || + ((s = !0), + window.PointerEvent + ? (gs(e.field, 'pointermove', h), + gs( + e.field, + 'pointerend pointercancel pointerup', + n + ), + e.field.setPointerCapture(t.pointerId)) + : (gs(window, 'blur', n), + t.touches + ? (gs(t.target, 'touchmove', h), + gs(t.target, 'touchend', n)) + : (gs(window, 'mousemove', h), + gs(window, 'mouseup', n))), + (2 !== t.detail && 2 !== Ss) || + ((a = !0), this.mathlist.selectGroup_())); + } + } else ws = null; + o && this._requestUpdate(), t.preventDefault(); + } + _onSelectionDidChange() { + this.mathlist.commitCommandStringBeforeInsertionPoint(); + let t = ''; + this.mathlist.forEachSelected(e => { + t += e.toLatex(); + }), + t + ? ((this.textarea.value = t), + this.$hasFocus() && + this.textarea.select && + this.textarea.select()) + : ((this.textarea.value = ''), + this.textarea.setAttribute('aria-label', '')); + { + const t = this.mode; + (this.mode = + this.mathlist.anchorMode() || this.config.defaultMode), + this.mode !== t && + 'function' == typeof this.config.onModeChange && + this.config.onModeChange(this, this.mode), + 'command' === t && + 'command' !== this.mode && + (Je.hidePopover(this), + this.mathlist.removeCommandString()); + } + Je.updatePopoverPosition(this, { deferred: !0 }), + 'function' == typeof this.config.onSelectionDidChange && + this.config.onSelectionDidChange(this); + } + _onContentDidChange() { + this.undoManager.canRedo() + ? this.element.classList.add('can-redo') + : this.element.classList.remove('can-redo'), + this.undoManager.canUndo() + ? this.element.classList.add('can-undo') + : this.element.classList.remove('can-undo'), + 'function' == typeof this.config.onContentDidChange && + this.config.onContentDidChange(this); + } + _nextAtomSpeechText(t) { + function e(t, e) { + return 'body' === e.relation + ? { + enclose: 'cross out', + leftright: 'fence', + surd: 'square root', + root: 'math field', + }[t.type] + : { + numer: 'numerator', + denom: 'denominator', + index: 'index', + body: 'parent', + subscript: 'subscript', + superscript: 'superscript', + }[e.relation]; + } + const i = t ? t.path : [], + s = this.mathlist.path, + a = s[s.length - 1]; + let o = ''; + for (; i.length > s.length; ) + (o += 'out of ' + e(t.parent(), i[i.length - 1]) + '; '), + i.pop(); + if (!this.mathlist.isCollapsed()) + return As(this, '', this.mathlist.getSelectedAtoms()); + const n = e(this.mathlist.parent(), a); + 0 === a.offset && + (o += (n ? 'start of ' + n : 'unknown') + ': '); + const r = this.mathlist.sibling( + Math.max(1, this.mathlist.extent) + ); + return ( + r + ? (o += As(this, '', r)) + : 0 !== a.offset && + (o += n ? 'end of ' + n : 'unknown'), + o + ); + } + _announce(t, e, i) { + 'function' == typeof this.config.onAnnounce && + this.config.onAnnounce(this, t, e, i); + } + _onFocus() { + this.blurred && + ((this.blurred = !1), + this.textarea.focus && this.textarea.focus(), + 'onfocus' === this.config.virtualKeyboardMode && + this.showVirtualKeyboard_(), + Je.updatePopoverPosition(this), + this.config.onFocus && this.config.onFocus(this), + this._requestUpdate()); + } + _onBlur() { + this.blurred || + ((this.blurred = !0), + (this.ariaLiveText.textContent = ''), + 'onfocus' === this.config.virtualKeyboardMode && + this.hideVirtualKeyboard_(), + this.complete_({ discard: !0 }), + this._requestUpdate(), + this.config.onBlur && this.config.onBlur(this)); + } + _onResize() { + this.element.classList.remove( + 'ML__isNarrowWidth', + 'ML__isWideWidth', + 'ML__isExtendedWidth' + ), + window.innerWidth >= 1024 + ? this.element.classList.add('ML__isExtendedWidth') + : window.innerWidth >= 768 + ? this.element.classList.add('ML__isWideWidth') + : this.element.classList.add('ML__isNarrowWidth'), + Je.updatePopoverPosition(this); + } + toggleKeystrokeCaption_() { + (this.keystrokeCaptionVisible = !this.keystrokeCaptionVisible), + (this.keystrokeCaption.innerHTML = ''), + this.keystrokeCaptionVisible || + (this.keystrokeCaption.style.visibility = 'hidden'); + } + _showKeystroke(t) { + const e = this.keystrokeCaption; + if (e && this.keystrokeCaptionVisible) { + const i = this.element.getBoundingClientRect(); + (e.style.left = i.left + 'px'), + (e.style.top = i.top - 64 + 'px'), + (e.innerHTML = + '' + + (ve.stringify(t) || t) + + '' + + e.innerHTML), + (e.style.visibility = 'visible'), + setTimeout(function() { + e.childNodes.length > 0 && + e.removeChild( + e.childNodes[e.childNodes.length - 1] + ), + 0 === e.childNodes.length && + (e.style.visibility = 'hidden'); + }, 3e3); + } + } + $perform(t) { + if (!t) return !1; + let e, + i = !1, + s = [], + a = !1; + if ( + (Array.isArray(t) + ? ((e = t[0]), (s = t.slice(1))) + : (e = t), + (e = e.replace(/-\w/g, t => t[1].toUpperCase())), + (e += '_'), + 'function' == typeof this.mathlist[e]) + ) { + if ( + (/^(delete|transpose|add)/.test(e) && + this._resetKeystrokeBuffer(), + /^(delete|transpose|add)/.test(e) && + 'command' !== this.mode && + (this.undoManager.pop(), + this.undoManager.snapshot(this.config)), + this.mathlist[e](...s), + /^(delete|transpose|add)/.test(e) && + 'command' !== this.mode && + this.undoManager.snapshot(this.config), + /^(delete)/.test(e) && 'command' === this.mode) + ) { + const t = this.mathlist.extractCommandStringAroundInsertionPoint(), + e = At.suggest(t); + 0 === e.length + ? Je.hidePopover(this) + : Je.showPopoverWithLatex( + this, + e[0].match, + e.length > 1 + ); + } + (a = !0), (i = !0); + } else + 'function' == typeof this[e] && + ((a = this[e](...s)), (i = !0)); + return ( + (this.mathlist.isCollapsed() && + !/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test( + e + )) || + (this._resetKeystrokeBuffer(), (this.style = {})), + a && this._requestUpdate(), + i + ); + } + performWithFeedback_(t) { + return ( + this.$focus(), + this.config.keypressVibration && + navigator.vibrate && + navigator.vibrate(3), + 'moveToNextPlaceholder' === + (t = t.replace(/-\w/g, t => t[1].toUpperCase())) || + 'moveToPreviousPlaceholder' === t || + 'complete' === t + ? this.returnKeypressSound + ? (this.returnKeypressSound.load(), + this.returnKeypressSound.play().catch(t => {})) + : this.keypressSound && + (this.keypressSound.load(), + this.keypressSound.play().catch(t => {})) + : ('deletePreviousChar' !== t && + 'deleteNextChar' !== t && + 'deletePreviousWord' !== t && + 'deleteNextWord' !== t && + 'deleteToGroupStart' !== t && + 'deleteToGroupEnd' !== t && + 'deleteToMathFieldStart' !== t && + 'deleteToMathFieldEnd' !== t) || + !this.deleteKeypressSound + ? this.keypressSound && + (this.keypressSound.load(), + this.keypressSound.play().catch(t => {})) + : (this.deleteKeypressSound.load(), + this.deleteKeypressSound.play().catch(t => {})), + this.$perform(t) + ); + } + convertLastAtomsToText_(t, e) { + 'function' == typeof t && ((e = t), (t = 1 / 0)), + void 0 === t && (t = 1 / 0); + let i = 0, + s = !1; + for (this.mathlist.contentWillChange(); !s; ) { + const a = this.mathlist.sibling(i); + (s = + 0 === t || + !a || + 'math' !== a.mode || + !( + /mord|textord|mpunct/.test(a.type) || + ('mop' === a.type && /[a-zA-Z]+/.test(a.body)) + ) || + a.superscript || + a.subscript || + (e && !e(a))), + s || + (a.applyStyle({ mode: 'text' }), + (a.latex = a.body)), + (i -= 1), + (t -= 1); + } + this.mathlist.contentDidChange(); + } + convertLastAtomsToMath_(t, e) { + 'function' == typeof t && ((e = t), (t = 1 / 0)), + void 0 === t && (t = 1 / 0), + this.mathlist.contentWillChange(); + let i = 0, + s = !1; + for (; !s; ) { + const a = this.mathlist.sibling(i); + (s = + 0 === t || + !a || + 'text' !== a.mode || + ' ' === a.body || + (e && !e(a))), + s || a.applyStyle({ mode: 'math', type: 'mord' }), + (i -= 1), + (t -= 1); + } + this.removeIsolatedSpace_(), this.mathlist.contentDidChange(); + } + removeIsolatedSpace_() { + let t = 0; + for ( + ; + this.mathlist.sibling(t) && + 'math' === this.mathlist.sibling(t).mode; + + ) + t -= 1; + if ( + this.mathlist.sibling(t) && + 'text' === this.mathlist.sibling(t).mode && + ' ' === this.mathlist.sibling(t).body && + (!this.mathlist.sibling(t - 1) || + 'math' === this.mathlist.sibling(t - 1).mode) + ) { + this.mathlist.contentWillChange(), + this.mathlist.siblings().splice(t - 1, 1), + this.mathlist.contentDidChange(); + const e = this.mathlist.suppressChangeNotifications; + (this.mathlist.suppressChangeNotifications = !0), + this.mathlist.setSelection( + this.mathlist.anchorOffset() - 1 + ), + (this.mathlist.suppressChangeNotifications = e); + } + } + getTextBeforeAnchor_() { + let t = '', + e = 0, + i = !1; + for (; !i; ) { + const s = this.mathlist.sibling(e); + (i = !( + s && + (('text' === s.mode && !s.type) || + ('math' === s.mode && + /mord|textord|mpunct/.test(s.type))) + )), + i || (t = s.body + t), + (e -= 1); + } + return t; + } + smartMode_(t, e) { + if (this.smartModeSuppressed) return !1; + if ( + this.mathlist.endOffset() < + this.mathlist.siblings().length - 1 + ) + return !1; + if (!e || e.ctrlKey || e.metaKey) return !1; + const i = He.eventToChar(e); + if (i.length > 1) return !1; + if (!this.mathlist.isCollapsed()) + return !('text' !== this.mode || !/[/_^]/.test(i)); + const s = this.getTextBeforeAnchor_() + i; + if ('text' === this.mode) { + if ('Esc' === t || /[/\\]/.test(i)) return !0; + if (/[\^_]/.test(i)) + return ( + /(^|\s)[a-zA-Z][^_]$/.test(s) && + this.convertLastAtomsToMath_(1), + !0 + ); + const e = { ')': '(', '}': '{', ']': '[' }[i]; + if ( + e && + this.mathlist.parent() && + 'leftright' === this.mathlist.parent().type && + this.mathlist.parent().leftDelim === e + ) + return !0; + if (/(^|[^a-zA-Z])(a|I)[ ]$/.test(s)) return !1; + if (/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i)) return !0; + if (/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s)) + return this.convertLastAtomsToMath_(1), !1; + if (/[^0-9]\.[^0-9\s]$/.test(s)) { + this.convertLastAtomsToMath_(1); + const t = this.mathlist.sibling(0); + return ( + (t.body = '⋅'), + (t.autoFontFamily = 'cmr'), + (t.latex = '\\cdot'), + !0 + ); + } + if (/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s)) + return this.convertLastAtomsToMath_(1), !0; + if (/\.[0-9]$/.test(s)) + return this.convertLastAtomsToMath_(1), !0; + if (/[(][0-9+\-.]$/.test(s)) + return this.convertLastAtomsToMath_(1), !0; + if (/[(][a-z][,;]$/.test(s)) + return this.convertLastAtomsToMath_(2), !0; + if (/[0-9+\-=><*|]$/.test(i)) + return this.removeIsolatedSpace_(), !0; + } else { + if ('Spacebar' === t) + return ( + this.convertLastAtomsToText_(t => + /[a-z][:,;.]$/.test(t.body) + ), + !0 + ); + if ( + /[a-zA-Z]{3,}$/.test(s) && + !/(dxd|abc|xyz|uvw)$/.test(s) + ) + return ( + this.convertLastAtomsToText_(t => + /[a-zA-Z:,;.]/.test(t.body) + ), + !0 + ); + if (/(^|\W)(if|If)$/i.test(s)) + return this.convertLastAtomsToText_(1), !0; + if ( + /(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test( + s + ) && + !/(αβγ)$/.test(s) + ) + return ( + this.convertLastAtomsToText_(t => + /(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test( + t.body + ) + ), + !0 + ); + if (/\?|\./.test(i)) return !0; + } + return !1; + } + _onKeystroke(t, e) { + if ( + (this._showKeystroke(t), + clearTimeout(this.keystrokeBufferResetTimer), + this.config.onKeystroke && + !this.config.onKeystroke(this, t, e)) + ) + return ( + e && + e.preventDefault && + (e.preventDefault(), e.stopPropagation()), + !1 + ); + let i, + s, + a, + o = !1; + if ( + 'command' !== this.mode && + (!e || (!e.ctrlKey && !e.metaKey)) + ) { + const t = He.eventToChar(e); + if ('Backspace' !== t) + if (!t || t.length > 1) this._resetKeystrokeBuffer(); + else { + const e = this.keystrokeBuffer + t; + let a = 0; + for (; !i && a < e.length; ) { + let t; + if (this.keystrokeBufferStates[a]) { + const e = new Oe.EditableMathlist(); + (e.root = te.makeRoot( + 'math', + he.parseTokens( + n( + this.keystrokeBufferStates[a] + .latex + ), + this.config.default, + null, + this.config.macros + ) + )), + e.setPath( + this.keystrokeBufferStates[a] + .selection + ), + (t = e.siblings()); + } else t = this.mathlist.siblings(); + (i = ve.forString( + this.mode, + t, + e.slice(a), + this.config + )), + (a += 1); + } + (s = a - 1), + (this.keystrokeBuffer += t), + this.keystrokeBufferStates.push( + this.undoManager.save() + ), + ve.startsWithString(e, this.config).length <= 1 + ? (o = !0) + : this.config.inlineShortcutTimeout && + (this.keystrokeBufferResetTimer = setTimeout( + () => { + this._resetKeystrokeBuffer(); + }, + this.config.inlineShortcutTimeout + )); + } + } + if (this.config.smartMode) { + const s = this.mode; + i + ? (this.mode = 'math') + : this.smartMode_(t, e) && + ((this.mode = { math: 'text', text: 'math' }[ + this.mode + ]), + (a = '')), + this.mode !== s && + 'function' == typeof this.config.onModeChange && + this.config.onModeChange(this, this.mode); + } + if ( + (i || a || (a = ve.selectorForKeystroke(this.mode, t)), + !i && !a) + ) + return !0; + this.mathlist.decorateCommandStringAroundInsertionPoint(!1); + const r = this.mathlist.parent(); + if ( + ('moveAfterParent' === a && + r && + 'leftright' === r.type && + this.mathlist.endOffset() === + this.mathlist.siblings().length - 1 && + this.config.smartFence && + this.mathlist._insertSmartFence('.') && + ((a = ''), this._requestUpdate()), + 'math' === this.mode && 'Spacebar' === t && !i) + ) { + const t = this.mathlist.sibling(1), + e = this.mathlist.sibling(-1); + ((t && 'text' === t.mode) || (e && 'text' === e.mode)) && + this.mathlist.insert(' ', { mode: 'text' }); + } + if (((a && !this.$perform(a)) || i) && i) { + if ( + !/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test( + i + ) + ) { + const t = { + ...this.mathlist.anchorStyle(), + ...this.style, + }; + this.mathlist.insert(He.eventToChar(e), { + suppressChangeNotifications: !0, + mode: this.mode, + style: t, + }); + const i = this.mode; + this.undoManager.snapshotAndCoalesce(this.config), + this.undoManager.restore( + this.keystrokeBufferStates[s], + { + ...this.config, + suppressChangeNotifications: !0, + } + ), + (this.mode = i); + } + this.mathlist.contentWillChange(); + const t = this.mathlist.suppressChangeNotifications; + this.mathlist.suppressChangeNotifications = !0; + const a = { ...this.mathlist.anchorStyle(), ...this.style }; + this.mathlist.insert(i, { + format: 'latex', + mode: this.mode, + style: a, + smartFence: !0, + }), + this.removeIsolatedSpace_(), + i.endsWith(' ') && + ((this.mode = 'text'), + this.mathlist.insert(' ', { + mode: 'text', + style: a, + })), + (this.mathlist.suppressChangeNotifications = t), + this.mathlist.contentDidChange(), + this.undoManager.snapshot(this.config), + this._requestUpdate(), + this._announce('replacement'), + o && this._resetKeystrokeBuffer(); + } + return ( + this.scrollIntoView(), + e && + e.preventDefault && + (e.preventDefault(), e.stopPropagation()), + !1 + ); + } + _onTypedText(t, e) { + if ( + ((e = e || {}).focus && this.$focus(), + e.feedback && + (this.config.keypressVibration && + navigator.vibrate && + navigator.vibrate(3), + this.keypressSound && + (this.keypressSound.load(), + this.keypressSound.play().catch(t => {}))), + e.commandMode && + 'command' !== this.mode && + this.switchMode_('command'), + this.mathlist.decorateCommandStringAroundInsertionPoint(!1), + e.simulateKeystroke) + ) { + const e = t.charAt(0), + i = He.charToEvent(e); + if (!this.$keystroke(He.keyboardEventToString(i), i)) + return; + } + let i = '', + a = !1; + if (this.pasteInProgress) + (this.pasteInProgress = !1), + this.mathlist.insert(t, { + smartFence: this.config.smartFence, + mode: 'math', + }); + else { + const e = { ...this.mathlist.anchorStyle(), ...this.style }, + o = s(t); + for (const t of o) + if ('command' === this.mode) { + this.mathlist.removeSuggestion(), + (this.suggestionIndex = 0); + const e = this.mathlist.extractCommandStringAroundInsertionPoint(), + s = At.suggest(e + t); + (a = s.length > 1), + 0 === s.length + ? (this.mathlist.insert(t, { + mode: 'command', + }), + /^\\[a-zA-Z\\*]+$/.test(e + t) && + this.mathlist.decorateCommandStringAroundInsertionPoint( + !0 + ), + Je.hidePopover(this)) + : (this.mathlist.insert(t, { + mode: 'command', + }), + s[0].match !== e + t && + this.mathlist.insertSuggestion( + s[0].match, + -s[0].match.length + e.length + 1 + ), + (i = s[0].match)); + } else if ('math' === this.mode) { + const i = { + '^': 'moveToSuperscript', + _: 'moveToSubscript', + ' ': 'moveAfterParent', + }[t]; + if (i) { + if ('moveToSuperscript' === i) { + if ( + this._superscriptDepth() >= + this.config.scriptDepth[1] + ) + return void this._announce('plonk'); + } else if ( + 'moveToSubscript' === i && + this._subscriptDepth() >= + this.config.scriptDepth[0] + ) + return void this._announce('plonk'); + this.$perform(i); + } else + this.config.smartSuperscript && + 'superscript' === this.mathlist.relation() && + /[0-9]/.test(t) && + 0 === + this.mathlist + .siblings() + .filter(t => 'first' !== t.type).length + ? (this.mathlist.insert(t, { + mode: 'math', + style: e, + }), + this.mathlist.moveAfterParent_()) + : this.mathlist.insert(t, { + mode: 'math', + style: e, + smartFence: this.config.smartFence, + }); + } else + 'text' === this.mode && + this.mathlist.insert(t, { + mode: 'text', + style: e, + }); + } + 'command' !== this.mode && + this.undoManager.snapshotAndCoalesce(this.config), + this._requestUpdate(), + this.scrollIntoView(), + Je.showPopoverWithLatex(this, i, a); + } + _hash() { + let t = 0; + const e = this.mathlist.root.toLatex(!1); + for (let i = 0; i < e.length; i++) + (t = 31 * t + e.charCodeAt(i)), (t |= 0); + return Math.abs(t); + } + _requestUpdate() { + this.dirty || + ((this.dirty = !0), + requestAnimationFrame(t => ks(this) && this._render())); + } + _render(t) { + (t = t || {}), + (this.dirty = !1), + window.mathlive || (window.mathlive = {}), + this.mathlist.anchor() || + (this.mathlist.path = [ + { relation: 'body', offset: 0 }, + ]), + this.mathlist.forEach(t => { + (t.caret = ''), (t.isSelected = !1); + }); + const e = this.$hasFocus(); + this.mathlist.isCollapsed() + ? (this.mathlist.anchor().caret = e ? this.mode : '') + : this.mathlist.forEachSelected(t => { + t.isSelected = !0; + }); + const i = te.decompose( + { + mathstyle: 'displaystyle', + generateID: { + seed: this._hash(), + groupNumbers: t.forHighlighting, + }, + macros: this.config.macros, + }, + this.mathlist.root + ), + s = $.makeSpan(i, 'ML__base'); + s.attributes = { translate: 'no', 'aria-hidden': 'true' }; + const a = $.makeSpan('', 'ML__strut'); + a.setStyle('height', s.height, 'em'); + const o = [a]; + if (0 !== s.depth) { + const t = $.makeSpan('', 'ML__strut--bottom'); + t.setStyle('height', s.height + s.depth, 'em'), + t.setStyle('vertical-align', -s.depth, 'em'), + o.push(t); + } + o.push(s); + const n = $.makeSpan(o, 'ML__mathlive'); + (this.field.innerHTML = n.toMarkup( + 0, + this.config.horizontalSpacingScale + )), + this.field.classList.toggle('ML__focused', e), + (this.accessibleNode.innerHTML = + "" + + te.toMathML(this.mathlist.root, this.config) + + ''); + const r = this._getSelectionBounds(); + if (r) { + const t = document.createElement('div'); + t.classList.add('ML__selection'), + (t.style.position = 'absolute'), + (t.style.left = r.left + 'px'), + (t.style.top = r.top + 'px'), + (t.style.width = Math.ceil(r.right - r.left) + 'px'), + (t.style.height = + Math.ceil(r.bottom - r.top - 1) + 'px'), + this.field.insertBefore(t, this.field.childNodes[0]); + } + } + _onPaste() { + return (this.pasteInProgress = !0), !0; + } + _onCut() { + return ( + setTimeout( + function() { + this.$clearSelection(), this._requestUpdate(); + }.bind(this), + 0 + ), + !0 + ); + } + _onCopy(t) { + this.mathlist.isCollapsed() + ? (t.clipboardData.setData( + 'text/plain', + '$$' + this.$text('latex-expanded') + '$$' + ), + t.clipboardData.setData( + 'application/json', + this.$text('json') + ), + t.clipboardData.setData( + 'application/xml', + this.$text('mathML') + )) + : (t.clipboardData.setData( + 'text/plain', + '$$' + this.$selectedText('latex-expanded') + '$$' + ), + t.clipboardData.setData( + 'application/json', + this.$selectedText('json') + ), + t.clipboardData.setData( + 'application/xml', + this.$selectedText('mathML') + )), + t.preventDefault(); + } + formatMathlist(t, e) { + let i = ''; + if ('latex' === (e = e || 'latex') || 'latex-expanded' === e) + i = t.toLatex('latex-expanded' === e); + else if ('mathML' === e) i = t.toMathML(this.config); + else if ('spoken' === e) i = te.toSpeakableText(t, this.config); + else if ('spoken-text' === e) { + const e = this.config.textToSpeechMarkup; + (this.config.textToSpeechMarkup = ''), + (i = te.toSpeakableText(t, this.config)), + (this.config.textToSpeechMarkup = e); + } else if ( + 'spoken-ssml' === e || + 'spoken-ssml-withHighlighting' === e + ) { + const s = this.config.textToSpeechMarkup, + a = this.config.generateID; + (this.config.textToSpeechMarkup = 'ssml'), + 'spoken-ssml-withHighlighting' === e && + (this.config.generateID = !0), + (i = te.toSpeakableText(t, this.config)), + (this.config.textToSpeechMarkup = s), + (this.config.generateID = a); + } else if ('json' === e) { + const e = te.toAST(t, this.config); + i = JSON.stringify(e); + } else + 'ASCIIMath' === e && + (i = (function t(e, i) { + if (!e) return ''; + if (Array.isArray(e)) { + let i = ''; + if (0 === e.length) return ''; + if ( + ('first' === e[0].type && e.shift(), + 'text' === e[0].mode) + ) { + let s = 0; + for ( + i = '"'; + e[s] && 'text' === e[s].mode; + + ) + (i += e[s].body), s++; + i += '"' + t(e.slice(s)); + } else { + let s = 0; + for (; e[s] && 'math' === e[s].mode; ) + (i += t(e[s])), s++; + i += t(e.slice(s)); + } + return i.trim(); + } + if ('text' === e.mode) return '"' + e.body + '"'; + let s = ''; + const a = e.latex ? e.latex.trim() : null; + let o; + switch (e.type) { + case 'group': + case 'root': + s = t(e.body); + break; + case 'array': + break; + case 'genfrac': + (e.leftDelim || e.rightDelim) && + (s += + '.' !== e.leftDelim && e.leftDelim + ? e.leftDelim + : '{:'), + e.hasBarLine + ? ((s += '('), + (s += t(e.numer)), + (s += ')/('), + (s += t(e.denom)), + (s += ')')) + : ((s += '(' + t(e.numer) + '),'), + (s += '(' + t(e.denom) + ')')), + (e.leftDelim || e.rightDelim) && + (s += + '.' !== e.rightDelim && + e.rightDelim + ? e.rightDelim + : '{:'); + break; + case 'surd': + e.index + ? (s += + 'root(' + + t(e.index) + + ')(' + + t(e.body) + + ')') + : (s += 'sqrt(' + t(e.body) + ')'); + break; + case 'leftright': + (s += + '.' !== e.leftDelim && e.leftDelim + ? e.leftDelim + : '{:'), + (s += t(e.body)), + (s += + '.' !== e.rightDelim && e.rightDelim + ? e.rightDelim + : '{:'); + break; + case 'sizeddelim': + case 'delim': + case 'accent': + break; + case 'line': + case 'overlap': + case 'overunder': + break; + case 'mord': + (s = + hi[a] || + a || + ('string' == typeof e.body + ? e.body + : '')), + '\\' === s[0] && (s += ''), + (o = a + ? a.match( + /[{]?\\char"([0-9abcdefABCDEF]*)[}]?/ + ) + : null), + o + ? (s = String.fromCharCode( + parseInt('0x' + o[1]) + )) + : s.length > 0 && + '\\' === s.charAt(0) && + (s = + 'string' == typeof e.body + ? e.body.charAt(0) + : e.latex); + break; + case 'mbin': + case 'mrel': + case 'textord': + case 'minner': + s = + a && hi[a] + ? hi[a] + : a && di[a] + ? di[a] + : e.body; + break; + case 'mopen': + case 'mclose': + s += e.body; + break; + case 'mpunct': + s = di[a] || a; + break; + case 'mop': + '​' !== e.body && + ((s = ''), + (s += + '\\operatorname' === a + ? t(e.body) + : e.body || a), + (s += ' ')); + break; + case 'mathstyle': + case 'box': + case 'spacing': + case 'enclose': + break; + case 'space': + s = ' '; + } + if (e.subscript) { + s += '_'; + const i = t(e.subscript); + i.length > 1 && !/^(-)?\d+(\.\d*)?$/.test(i) + ? (s += '(' + i + ')') + : (s += i); + } + if (e.superscript) { + s += '^'; + const i = t(e.superscript); + i.length > 1 && !/^(-)?\d+(\.\d*)?$/.test(i) + ? (s += '(' + i + ')') + : (s += i); + } + return s; + })(t, this.config)); + return i; + } + $text(t) { + return this.formatMathlist(this.mathlist.root, t); + } + $selectedText(t) { + const e = this.mathlist.getSelectedAtoms(); + if (!e) return ''; + const i = te.makeRoot('math', e); + return this.formatMathlist(i, t); + } + $selectionIsCollapsed() { + return this.mathlist.isCollapsed(); + } + $selectionDepth() { + return this.mathlist.path.length; + } + _superscriptDepth() { + let t = 0, + e = 0, + i = this.mathlist.ancestor(e), + s = !1; + for (; i; ) + (i.superscript || i.subscript) && (t += 1), + i.superscript ? (s = !0) : i.subscript && (s = !1), + (e += 1), + (i = this.mathlist.ancestor(e)); + return s ? t : 0; + } + _subscriptDepth() { + let t = 0, + e = 0, + i = this.mathlist.ancestor(e), + s = !1; + for (; i; ) + (i.superscript || i.subscript) && (t += 1), + i.superscript ? (s = !1) : i.subscript && (s = !0), + (e += 1), + (i = this.mathlist.ancestor(e)); + return s ? t : 0; + } + $selectionAtStart() { + return 0 === this.mathlist.startOffset(); + } + $selectionAtEnd() { + return ( + this.mathlist.endOffset() >= + this.mathlist.siblings().length - 1 + ); + } + groupIsSelected() { + return ( + 0 === this.mathlist.startOffset() && + this.mathlist.endOffset() >= + this.mathlist.siblings().length - 1 + ); + } + $latex(t, e) { + return t + ? (t !== this.mathlist.root.toLatex() && + ((e = e || {}), + this.mathlist.insert( + t, + Object.assign({}, this.config, { + insertionMode: 'replaceAll', + selectionMode: 'after', + format: 'latex', + mode: 'math', + suppressChangeNotifications: + e.suppressChangeNotifications, + }) + ), + this.undoManager.snapshot(this.config), + this._requestUpdate()), + t) + : this.mathlist.root.toLatex(); + } + $el() { + return this.element; + } + undo() { + return this.complete_(), this.undoManager.undo(this.config), !0; + } + redo() { + return this.complete_(), this.undoManager.redo(this.config), !0; + } + scrollIntoView() { + this.dirty && this._render(); + let t = this._getCaretPosition(); + const e = this.field.getBoundingClientRect(); + if (!t) { + const i = this._getSelectionBounds(); + i && + (t = { + x: i.right + e.left - this.field.scrollLeft, + y: i.top + e.top - this.field.scrollTop, + }); + } + if (t) { + const i = t.x - window.scrollX; + i < e.left + ? this.field.scroll({ + top: 0, + left: i - e.left + this.field.scrollLeft - 20, + behavior: 'smooth', + }) + : i > e.right && + this.field.scroll({ + top: 0, + left: i - e.right + this.field.scrollLeft + 20, + behavior: 'smooth', + }); + } + } + scrollToStart() { + this.field.scroll(0, 0); + } + scrollToEnd() { + const t = this.field.getBoundingClientRect(); + this.field.scroll(t.left - window.scrollX, 0); + } + enterCommandMode_() { + this.switchMode_('command'); + } + copyToClipboard_() { + return ( + this.$focus(), + this.mathlist.isCollapsed() && this.$select(), + document.execCommand('copy'), + !1 + ); + } + cutToClipboard_() { + return this.$focus(), document.execCommand('cut'), !0; + } + pasteFromClipboard_() { + return this.$focus(), document.execCommand('paste'), !0; + } + $insert(t, e) { + if ('string' == typeof t && t.length > 0) { + if ( + ((e = e || {}).focus && this.$focus(), + e.feedback && + (this.config.keypressVibration && + navigator.vibrate && + navigator.vibrate(3), + this.keypressSound && + (this.keypressSound.load(), + this.keypressSound.play())), + '\\\\' === t) + ) + this.mathlist.addRowAfter_(); + else if ('&' === t) this.mathlist.addColumnAfter_(); + else { + const i = this.style; + this.mathlist.insert(t, { + mode: this.mode, + style: this.mathlist.anchorStyle(), + ...e, + }), + e.resetStyle && (this.style = i); + } + return ( + this.undoManager.snapshot(this.config), + this._requestUpdate(), + !0 + ); + } + return !1; + } + switchMode_(t, e, i) { + this._resetKeystrokeBuffer(), + (this.smartModeSuppressed = + /text|math/.test(this.mode) && /text|math/.test(t)), + e && + this.$insert(e, { + format: 'latex', + mode: { math: 'text', text: 'math' }[t], + }), + this.mathlist.decorateCommandStringAroundInsertionPoint(!1), + 'command' === t + ? (this.mathlist.removeSuggestion(), + Je.hidePopover(this), + (this.suggestionIndex = 0), + this.virtualKeyboardVisible && + this.switchKeyboardLayer_('lower-command'), + this.mathlist.insert('', { mode: 'math' })) + : (this.mode = t), + i && this.$insert(i, { format: 'latex', mode: t }), + 'function' == typeof this.config.onModeChange && + this.config.onModeChange(this, this.mode), + this._requestUpdate(); + } + complete_(t) { + if (((t = t || {}), Je.hidePopover(this), t.discard)) + return ( + this.mathlist.spliceCommandStringAroundInsertionPoint( + null + ), + this.switchMode_('math'), + !0 + ); + const e = this.mathlist.extractCommandStringAroundInsertionPoint( + !t.acceptSuggestion + ); + if (e) { + if ('\\(' === e || '\\)' === e) + this.mathlist.spliceCommandStringAroundInsertionPoint( + [] + ), + this.mathlist.insert(e.slice(1), { + mode: this.mode, + }); + else { + const t = 'math'; + if (At.commandAllowed(t, e)) { + const i = he.parseTokens( + n(e), + t, + null, + this.config.macros + ); + this.mathlist.spliceCommandStringAroundInsertionPoint( + i + ); + } else { + const i = he.parseTokens( + n(e), + t, + null, + this.config.macros + ); + i + ? this.mathlist.spliceCommandStringAroundInsertionPoint( + i + ) + : this.mathlist.decorateCommandStringAroundInsertionPoint( + !0 + ); + } + } + return ( + this.undoManager.snapshot(this.config), + this._announce('replacement'), + !0 + ); + } + return !1; + } + _updateSuggestion() { + this.mathlist.positionInsertionPointAfterCommitedCommand(), + this.mathlist.removeSuggestion(); + const t = this.mathlist.extractCommandStringAroundInsertionPoint(), + e = At.suggest(t); + if (0 === e.length) + Je.hidePopover(this), + this.mathlist.decorateCommandStringAroundInsertionPoint( + !0 + ); + else { + const i = this.suggestionIndex % e.length, + s = t.length - e[i].match.length; + 0 !== s && this.mathlist.insertSuggestion(e[i].match, s), + Je.showPopoverWithLatex(this, e[i].match, e.length > 1); + } + this._requestUpdate(); + } + nextSuggestion_() { + return ( + (this.suggestionIndex += 1), this._updateSuggestion(), !1 + ); + } + previousSuggestion_() { + if (((this.suggestionIndex -= 1), this.suggestionIndex < 0)) { + this.mathlist.removeSuggestion(); + const t = this.mathlist.extractCommandStringAroundInsertionPoint(), + e = At.suggest(t); + this.suggestionIndex = e.length - 1; + } + return this._updateSuggestion(), !1; + } + _attachButtonHandlers(t, e) { + const i = this; + let s, a, o, n, r; + 'object' == typeof e && (e.default || e.pressed) + ? (e.default && + t.setAttribute( + 'data-' + this.config.namespace + 'command', + JSON.stringify(e.default) + ), + e.alt && + t.setAttribute( + 'data-' + this.config.namespace + 'command-alt', + JSON.stringify(e.alt) + ), + e.altshift && + t.setAttribute( + 'data-' + + this.config.namespace + + 'command-altshift', + JSON.stringify(e.altshift) + ), + e.shift && + t.setAttribute( + 'data-' + this.config.namespace + 'command-shift', + JSON.stringify(e.shift) + ), + e.pressed && + t.setAttribute( + 'data-' + + this.config.namespace + + 'command-pressed', + JSON.stringify(e.pressed) + ), + e.pressAndHoldStart && + t.setAttribute( + 'data-' + + this.config.namespace + + 'command-pressAndHoldStart', + JSON.stringify(e.pressAndHoldStart) + ), + e.pressAndHoldEnd && + t.setAttribute( + 'data-' + + this.config.namespace + + 'command-pressAndHoldEnd', + JSON.stringify(e.pressAndHoldEnd) + )) + : t.setAttribute( + 'data-' + this.config.namespace + 'command', + JSON.stringify(e) + ), + gs(t, 'mousedown touchstart:passive', function(e) { + if ('mousedown' !== e.type || 1 === e.buttons) { + e.stopPropagation(), + e.preventDefault(), + t.classList.add('pressed'), + (s = Date.now()), + 'touchstart' === e.type && + (o = e.changedTouches[0].identifier); + const n = t.getAttribute( + 'data-' + i.config.namespace + 'command-pressed' + ); + n && i.$perform(JSON.parse(n)); + const l = t.getAttribute( + 'data-' + + i.config.namespace + + 'command-pressAndHoldStart' + ); + l && + ((a = t), + r && clearTimeout(r), + (r = window.setTimeout(function() { + t.classList.contains('pressed') && + i.$perform(JSON.parse(l)); + }, 300))); + } + }), + gs(t, 'mouseleave touchcancel', function() { + t.classList.remove('pressed'); + }), + gs(t, 'touchmove:passive', function(t) { + t.preventDefault(); + for (let e = 0; e < t.changedTouches.length; e++) + if (t.changedTouches[e].identifier === o) { + const i = document.elementFromPoint( + t.changedTouches[e].clientX, + t.changedTouches[e].clientY + ); + i !== n && + n && + (n.dispatchEvent( + new MouseEvent('mouseleave'), + { bubbles: !0 } + ), + (n = null)), + i && + ((n = i), + i.dispatchEvent( + new MouseEvent('mouseenter', { + bubbles: !0, + buttons: 1, + }) + )); + } + }), + gs(t, 'mouseenter', function(e) { + 1 === e.buttons && t.classList.add('pressed'); + }), + gs(t, 'mouseup touchend click', function(e) { + if (n) { + e.stopPropagation(), e.preventDefault(); + const t = n; + return ( + (n = null), + void t.dispatchEvent( + new MouseEvent('mouseup', { bubbles: !0 }) + ) + ); + } + if ( + (t.classList.remove('pressed'), + t.classList.add('active'), + 'click' === e.type && 0 !== e.detail) + ) + return e.stopPropagation(), void e.preventDefault(); + window.setTimeout(function() { + t.classList.remove('active'); + }, 150); + let o = t.getAttribute( + 'data-' + + i.config.namespace + + 'command-pressAndHoldEnd' + ); + const r = Date.now(); + (t !== a || r < s + 300) && (o = void 0), + !o && + e.altKey && + e.shiftKey && + (o = t.getAttribute( + 'data-' + + i.config.namespace + + 'command-altshift' + )), + !o && + e.altKey && + (o = t.getAttribute( + 'data-' + i.config.namespace + 'command-alt' + )), + !o && + e.shiftKey && + (o = t.getAttribute( + 'data-' + + i.config.namespace + + 'command-shift' + )), + o || + (o = t.getAttribute( + 'data-' + i.config.namespace + 'command' + )), + o && i.$perform(JSON.parse(o)), + e.stopPropagation(), + e.preventDefault(); + }); + } + _makeButton(t, e, i, s) { + const a = document.createElement('span'); + return ( + (a.innerHTML = t), + e && a.classList.add([].slice.call(e.split(' '))), + i && a.setAttribute('aria-label', i), + this._attachButtonHandlers(a, s), + a + ); + } + showAlternateKeys_(t, e) { + const i = bs( + 'mathlive-alternate-keys-panel', + 'ML__keyboard alternate-keys' + ); + this.virtualKeyboard.classList.contains('material') && + i.classList.add('material'), + e.length >= 7 + ? (i.style.width = '286px') + : 4 === e.length || 2 === e.length + ? (i.style.width = '146px') + : 1 === e.length + ? (i.style.width = '86px') + : (i.style.width = '146px'), + (i.style.height = 'auto'); + let s = ''; + for (const t of e) + (s += ''), + (i.innerHTML = s), + ci.makeKeycap( + this, + i.getElementsByTagName('li'), + 'performAlternateKeys' + ); + const a = this.virtualKeyboard + .querySelector( + 'div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="' + + t + + '"]' + ) + .getBoundingClientRect(); + if (a) { + a.top - i.clientHeight < 0 && + ((i.style.width = 'auto'), + e.length <= 6 + ? (i.style.height = '56px') + : e.length <= 12 + ? (i.style.height = '108px') + : (i.style.height = '205px')); + const t = (a.top - i.clientHeight + 5).toString() + 'px', + s = + Math.max( + 0, + Math.min( + window.innerWidth - i.offsetWidth, + (a.left + a.right - i.offsetWidth) / 2 + ) + ) + 'px'; + (i.style.transform = 'translate(' + s + ',' + t + ')'), + i.classList.add('is-visible'); + } + return !1; + } + hideAlternateKeys_() { + const t = document.getElementById( + 'mathlive-alternate-keys-panel' + ); + return ( + t && + (t.classList.remove('is-visible'), + (t.innerHTML = ''), + xs(t)), + !1 + ); + } + performAlternateKeys_(t) { + return this.hideAlternateKeys_(), this.$perform(t); + } + switchKeyboardLayer_(t) { + if ('off' !== this.config.virtualKeyboardMode) { + 'lower-command' !== t && + 'upper-command' !== t && + 'symbols-command' !== t && + this.complete_(), + this.showVirtualKeyboard_(), + this.hideAlternateKeys_(), + this.unshiftKeyboardLayer_(); + const e = this.virtualKeyboard.getElementsByClassName( + 'keyboard-layer' + ); + let i = !1; + for (let s = 0; s < e.length; s++) + if (e[s].dataset.layer === t) { + i = !0; + break; + } + if (i) + for (let i = 0; i < e.length; i++) + e[i].dataset.layer === t + ? e[i].classList.add('is-visible') + : e[i].classList.remove('is-visible'); + this.$focus(); + } + return !0; + } + shiftKeyboardLayer_() { + const t = this.virtualKeyboard.querySelectorAll( + 'div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action' + ); + if (t) + for (let e = 0; e < t.length; e++) { + const i = t[e]; + let s = i.getAttribute('data-shifted'); + if (s || /^[a-z]$/.test(i.innerHTML)) { + i.setAttribute( + 'data-unshifted-content', + i.innerHTML + ), + s || (s = i.innerHTML.toUpperCase()), + (i.innerHTML = s); + const t = i.getAttribute( + 'data-' + this.config.namespace + 'command' + ); + if (t) { + i.setAttribute('data-unshifted-command', t); + const e = i.getAttribute( + 'data-shifted-command' + ); + if (e) + i.setAttribute( + 'data-' + + this.config.namespace + + 'command', + e + ); + else { + const e = JSON.parse(t); + Array.isArray(e) && + (e[1] = e[1].toUpperCase()), + i.setAttribute( + 'data-' + + this.config.namespace + + 'command', + JSON.stringify(e) + ); + } + } + } + } + return !1; + } + unshiftKeyboardLayer_() { + const t = this.virtualKeyboard.querySelectorAll( + 'div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action' + ); + if (t) + for (let e = 0; e < t.length; e++) { + const i = t[e], + s = i.getAttribute('data-unshifted-content'); + s && (i.innerHTML = s); + const a = i.getAttribute('data-unshifted-command'); + a && + i.setAttribute( + 'data-' + this.config.namespace + 'command', + a + ); + } + return !1; + } + insertAndUnshiftKeyboardLayer_(t) { + return this.$insert(t), this.unshiftKeyboardLayer_(), !0; + } + toggleVirtualKeyboardAlt_() { + let t = !1; + return ( + this.virtualKeyboard && + ((t = this.virtualKeyboard.classList.contains( + 'material' + )), + this.virtualKeyboard.remove(), + delete this.virtualKeyboard, + (this.virtualKeyboard = null)), + this.showVirtualKeyboard_(t ? '' : 'material'), + !1 + ); + } + toggleVirtualKeyboardShift_() { + this.config.virtualKeyboardLayout = { + qwerty: 'azerty', + azerty: 'qwertz', + qwertz: 'dvorak', + dvorak: 'colemak', + colemak: 'qwerty', + }[this.config.virtualKeyboardLayout]; + let t = this.virtualKeyboard + ? this.virtualKeyboard.querySelector( + 'div.keyboard-layer.is-visible' + ) + : null; + return ( + (t = t ? t.id : ''), + this.virtualKeyboard && + (this.virtualKeyboard.remove(), + delete this.virtualKeyboard, + (this.virtualKeyboard = null)), + this.showVirtualKeyboard_(), + t && this.switchKeyboardLayer_(t), + !1 + ); + } + showVirtualKeyboard_(t) { + return ( + (this.virtualKeyboardVisible = !1), + this.toggleVirtualKeyboard_(t), + !1 + ); + } + hideVirtualKeyboard_() { + return ( + (this.virtualKeyboardVisible = !0), + this.toggleVirtualKeyboard_(), + !1 + ); + } + toggleVirtualKeyboard_(t) { + if ( + ((this.virtualKeyboardVisible = !this + .virtualKeyboardVisible), + this.virtualKeyboardVisible) + ) { + this.virtualKeyboard + ? this.virtualKeyboard.classList.add('is-visible') + : ((this.virtualKeyboard = ci.make(this, t)), + gs( + this.virtualKeyboard, + 'touchstart:passive mousedown', + function() { + e.$focus(); + } + ), + document.body.appendChild(this.virtualKeyboard)); + const e = this; + window.setTimeout(function() { + e.virtualKeyboard.classList.add('is-visible'); + }, 1); + } else + this.virtualKeyboard && + this.virtualKeyboard.classList.remove('is-visible'); + return ( + 'function' == typeof this.config.onVirtualKeyboardToggle && + this.config.onVirtualKeyboardToggle( + this, + this.virtualKeyboardVisible, + this.virtualKeyboard + ), + !1 + ); + } + $applyStyle(t) { + if ( + (this._resetKeystrokeBuffer(), + (t = (function(t) { + const e = {}; + return ( + 'string' == typeof t.mode && + (e.mode = t.mode.toLowerCase()), + 'string' == typeof t.color && (e.color = t.color), + 'string' == typeof t.backgroundColor && + (e.backgroundColor = t.backgroundColor), + 'string' == typeof t.fontFamily && + (e.fontFamily = t.fontFamily), + 'string' == typeof t.series && + (e.fontSeries = t.series), + 'string' == typeof t.fontSeries && + (e.fontSeries = t.fontSeries.toLowerCase()), + e.fontSeries && + (e.fontSeries = + { bold: 'b', medium: 'm', normal: 'mn' }[ + e.fontSeries + ] || e.fontSeries), + 'string' == typeof t.shape && + (e.fontShape = t.shape), + 'string' == typeof t.fontShape && + (e.fontShape = t.fontShape.toLowerCase()), + e.fontShape && + (e.fontShape = + { + italic: 'it', + up: 'n', + upright: 'n', + normal: 'n', + }[e.fontShape] || e.fontShape), + 'string' == typeof t.size + ? (e.fontSize = t.size) + : 'number' == typeof t.size && + (e.fontSize = + 'size' + + Math.min(0, Math.max(10, t.size))), + 'string' == typeof t.fontSize && + (e.fontSize = t.fontSize.toLowerCase()), + e.fontSize && + (e.fontSize = + { + tiny: 'size1', + scriptsize: 'size2', + footnotesize: 'size3', + small: 'size4', + normal: 'size5', + normalsize: 'size5', + large: 'size6', + Large: 'size7', + LARGE: 'size8', + huge: 'size9', + Huge: 'size10', + }[e.fontSize] || e.fontSize), + e + ); + })(t)).mode) + ) { + if (this.mathlist.isCollapsed()) this.switchMode_(t.mode); + else { + const t = this.mode, + e = + 'math' === + (this.mathlist.anchorMode() || + this.config.default) + ? 'text' + : 'math'; + let i = this.$selectedText('ASCIIMath'); + if ( + ('math' === e && + /^"[^"]+"$/.test(i) && + (i = i.slice(1, -1)), + this.$insert(i, { + mode: e, + selectionMode: 'item', + format: 'text' === e ? 'text' : 'ASCIIMath', + }), + (this.mode = e), + this.groupIsSelected()) + ) { + const t = this.mathlist.parent(); + !t || + ('group' !== t.type && 'root' !== t.type) || + (t.mode = e); + } + this.mode !== t && + 'function' == typeof this.config.onModeChange && + this.config.onModeChange(this, this.mode); + } + delete t.mode; + } + return ( + this.mathlist.isCollapsed() + ? (this.style.fontSeries && + t.fontSeries === this.style.fontSeries && + (t.fontSeries = 'auto'), + t.fontShape && + t.fontShape === this.style.fontShape && + (t.fontShape = 'auto'), + t.color && + t.color === this.style.color && + (t.color = 'none'), + t.backgroundColor && + t.backgroundColor === + this.style.backgroundColor && + (t.backgroundColor = 'none'), + t.fontSize && + t.fontSize === this.style.fontSize && + (t.fontSize = 'auto'), + (this.style = { ...this.style, ...t })) + : (this.mathlist._applyStyle(t), + this.undoManager.snapshot(this.config)), + !0 + ); + } + $hasFocus() { + return ( + document.hasFocus() && + document.activeElement === this.textarea + ); + } + $focus() { + this.$hasFocus() || + (this.textarea.focus && this.textarea.focus(), + this._announce('line')); + } + $blur() { + this.$hasFocus() && this.textarea.blur && this.textarea.blur(); + } + $select() { + this.mathlist.selectAll_(); + } + $clearSelection() { + this.mathlist.delete_(); + } + $keystroke(t, e) { + return this._onKeystroke(t, e); + } + $typedText(t) { + this._onTypedText(t); + } + typedText_(t, e) { + return this._onTypedText(t, e); + } + $setConfig(t) { + if ( + (this.config || + (this.config = { + smartFence: !0, + smartSuperscript: !0, + scriptDepth: [1 / 0, 1 / 0], + removeExtraneousParentheses: !0, + overrideDefaultInlineShortcuts: !1, + virtualKeyboard: '', + virtualKeyboardLayout: 'qwerty', + namespace: '', + }), + (this.config = { ...this.config, ...t }), + void 0 !== this.config.scriptDepth && + !Array.isArray(this.config.scriptDepth)) + ) { + const t = parseInt(this.config.scriptDepth); + this.config.scriptDepth = [t, t]; + } + if ( + (void 0 === this.config.removeExtraneousParentheses && + (this.config.removeExtraneousParentheses = !0), + (this.config.onAnnounce = t.onAnnounce || Ms), + (this.config.macros = Object.assign( + {}, + At.MACROS, + this.config.macros + )), + !/^[a-z]*[-]?$/.test(this.config.namespace)) + ) + throw Error( + 'options.namespace must be a string of lowercase characters only' + ); + /-$/.test(this.config.namespace) || + (this.config.namespace += '-'), + (Qe.locale = this.config.locale || Qe.locale), + Qe.merge(this.config.strings), + (this.config.virtualKeyboardLayout = + t.virtualKeyboardLayout || + { + fr: 'azerty', + be: 'azerty', + al: 'qwertz', + ba: 'qwertz', + cz: 'qwertz', + de: 'qwertz', + hu: 'qwertz', + sk: 'qwertz', + ch: 'qwertz', + }[Qe.locale.substring(0, 2)] || + 'qwerty'), + (this.keypressSound = void 0), + (this.spacebarKeypressSound = void 0), + (this.returnKeypressSound = void 0), + (this.deleteKeypressSound = void 0), + this.config.keypressSound && + ('string' == typeof this.config.keypressSound + ? ((this.keypressSound = new Audio()), + (this.keypressSound.preload = 'none'), + (this.keypressSound.src = this.config.keypressSound), + (this.keypressSound.volume = 0.5), + (this.spacebarKeypressSound = this.keypressSound), + (this.returnKeypressSound = this.keypressSound), + (this.deleteKeypressSound = this.keypressSound)) + : ((this.keypressSound = new Audio()), + (this.keypressSound.preload = 'none'), + (this.keypressSound.src = this.config.keypressSound.default), + (this.keypressSound.volume = 0.5), + (this.spacebarKeypressSound = this.keypressSound), + (this.returnKeypressSound = this.keypressSound), + (this.deleteKeypressSound = this.keypressSound), + this.config.keypressSound.spacebar && + ((this.spacebarKeypressSound = new Audio()), + (this.spacebarKeypressSound.preload = 'none'), + (this.spacebarKeypressSound.src = this.config.keypressSound.spacebar), + (this.spacebarKeypressSound.volume = 0.5)), + this.config.keypressSound.return && + ((this.returnKeypressSound = new Audio()), + (this.returnKeypressSound.preload = 'none'), + (this.returnKeypressSound.src = this.config.keypressSound.return), + (this.returnKeypressSound.volume = 0.5)), + this.config.keypressSound.delete && + ((this.deleteKeypressSound = new Audio()), + (this.deleteKeypressSound.preload = 'none'), + (this.deleteKeypressSound.src = this.config.keypressSound.delete), + (this.deleteKeypressSound.volume = 0.5)))), + this.config.plonkSound && + ((this.plonkSound = new Audio()), + (this.plonkSound.preload = 'none'), + (this.plonkSound.src = this.config.plonkSound), + (this.plonkSound.volume = 0.5)); + } + speak_(t, e) { + e = e || { withHighlighting: !1 }; + const i = (function(t, e) { + let i = null; + switch (e) { + case 'all': + i = t.mathlist.root; + break; + case 'selection': + t.mathlist.isCollapsed() || + (i = t.mathlist.getSelectedAtoms()); + break; + case 'left': { + const e = t.mathlist.siblings(), + s = t.mathlist.startOffset(); + if (s >= 1) { + i = []; + for (let t = 1; t <= s; t++) i.push(e[t]); + } + break; + } + case 'right': { + const e = t.mathlist.siblings(), + s = t.mathlist.endOffset() + 1; + if (s <= e.length - 1) { + i = []; + for (let t = s; t <= e.length - 1; t++) + i.push(e[t]); + } + break; + } + case 'start': + case 'end': + break; + case 'group': + i = t.mathlist.siblings(); + break; + case 'parent': { + const e = t.mathlist.parent(); + e && 'root' !== e.type && (i = t.mathlist.parent()); + break; + } + } + return i; + })(this, t); + if (null === i) + return ( + this.config.handleSpeak( + (function(t) { + let e = ''; + switch (t) { + case 'all': + break; + case 'selection': + e = 'no selection'; + break; + case 'left': + e = 'at start'; + break; + case 'right': + e = 'at end'; + break; + case 'group': + break; + case 'parent': + e = 'no parent'; + } + return e; + })(t) + ), + !1 + ); + const s = { ...this.config }; + (e.withHighlighting || 'amazon' === s.speechEngine) && + ((s.textToSpeechMarkup = + window.sre && 'sre' === s.textToSpeechRules + ? 'ssml_step' + : 'ssml'), + e.withHighlighting && (s.generateID = !0)); + const a = te.toSpeakableText(i, s); + return ( + e.withHighlighting + ? ((window.mathlive.readAloudMathField = this), + this._render({ forHighlighting: !0 }), + this.config.handleReadAloud && + this.config.handleReadAloud( + this.field, + a, + this.config + )) + : this.config.handleSpeak && + this.config.handleSpeak(a, s), + !1 + ); + } + } + let ws, + Ss = 0; + function As(t, e, i) { + const s = Object.assign({}, t.config); + return ( + (s.textToSpeechMarkup = ''), + (s.textToSpeechRulesOptions = s.textToSpeechRulesOptions || {}), + (s.textToSpeechRulesOptions.markup = 'none'), + e + te.toSpeakableText(i, s) + ); + } + function Ms(t, e, i, s) { + let a = ''; + 'plonk' === e + ? (t.plonkSound && + (t.plonkSound.load(), t.plonkSound.play().catch(t => {})), + t._resetKeystrokeBuffer()) + : 'delete' === e + ? (a = As(t, 'deleted: ', s)) + : 'focus' === e || /move/.test(e) + ? (a = + (t.mathlist.isCollapsed() ? '' : 'selected: ') + + t._nextAtomSpeechText(i)) + : 'replacement' === e + ? (a = As(t, '', t.mathlist.sibling(0))) + : 'line' === e + ? ((a = As(t, '', t.mathlist.root)), + (t.accessibleNode.innerHTML = + '' + + te.toMathML(t.mathlist.root, t.config) + + ''), + t.textarea.setAttribute('aria-label', 'after: ' + a)) + : (a = s ? As(t, e + ' ', s) : e); + const o = /\u00a0/.test(t.ariaLiveText.textContent) ? '   ' : '   '; + t.ariaLiveText.textContent = a + o; + } + (vs.prototype.undo_ = vs.prototype.undo), + (vs.prototype.redo_ = vs.prototype.redo), + (vs.prototype.scrollIntoView_ = vs.prototype.scrollIntoView), + (vs.prototype.scrollToStart_ = vs.prototype.scrollToStart), + (vs.prototype.scrollToEnd_ = vs.prototype.scrollToEnd), + (vs.prototype.insert_ = vs.prototype.$insert); + var Cs = { isValidMathfield: ks, MathField: vs }; + function _s(t, e, i) { + let s = i, + a = 0; + const o = t.length; + for (; s < e.length; ) { + const i = e[s]; + if (a <= 0 && e.slice(s, s + o) === t) return s; + '\\' === i ? s++ : '{' === i ? a++ : '}' === i && a--, s++; + } + return -1; + } + function Ts(t, e, i, s) { + const a = []; + for (let o = 0; o < t.length; o++) + if ('text' === t[o].type) { + const n = t[o].data; + let r, + l = !0, + c = 0; + (r = n.indexOf(e)), + -1 !== r && + ((c = r), + c > 0 && + a.push({ type: 'text', data: n.slice(0, c) }), + (l = !1)); + let h = !1; + for (; !h; ) { + if (l) { + if (((r = n.indexOf(e, c)), -1 === r)) { + h = !0; + break; + } + c !== r && + a.push({ type: 'text', data: n.slice(c, r) }), + (c = r); + } else { + if (((r = _s(i, n, c + e.length)), -1 === r)) { + h = !0; + break; + } + a.push({ + type: 'math', + data: n.slice(c + e.length, r), + rawData: n.slice(c, r + i.length), + mathstyle: s, + }), + (c = r + i.length); + } + l = !l; + } + c < n.length && a.push({ type: 'text', data: n.slice(c) }); + } else a.push(t[o]); + return a; + } + function Ls(t, e) { + let i = [{ type: 'text', data: t }]; + for (let t = 0; t < e.inline.length; t++) { + const s = e.inline[t]; + i = Ts(i, s[0], s[1], 'textstyle'); + } + for (let t = 0; t < e.display.length; t++) { + const s = e.display[t]; + i = Ts(i, s[0], s[1], 'displaystyle'); + } + return i; + } + function Fs(t, e, i, s) { + const a = (function(t, e, i, s) { + let a = document.createElement('span'); + a.setAttribute('aria-hidden', 'true'), + e.preserveOriginalContent && + (a.setAttribute( + 'data-' + e.namespace + 'original-content', + t + ), + i && + a.setAttribute( + 'data-' + e.namespace + 'original-mathstyle', + i + )); + try { + a.innerHTML = e.renderToMarkup( + t, + i || 'displaystyle', + 'html', + e.macros + ); + } catch (e) { + if (!s) return null; + a = document.createTextNode(t); + } + return a; + })(t, i, e, s); + if ( + a && + /\b(mathml|speakable-text)\b/i.test(i.renderAccessibleContent) + ) { + const e = document.createDocumentFragment(); + if ( + (/\bmathml\b/i.test(i.renderAccessibleContent) && + i.renderToMathML && + e.appendChild( + (function(t, e) { + const i = document.createElement('span'); + try { + i.innerHTML = + "" + + e.renderToMathML(t, e) + + ''; + } catch (e) { + i.textContent = t; + } + return (i.className = 'sr-only'), i; + })(t, i) + ), + /\bspeakable-text\b/i.test(i.renderAccessibleContent) && + i.renderToSpeakableText) + ) { + const s = document.createElement('span'); + (s.innerHTML = i.renderToSpeakableText(t, i)), + (s.className = 'sr-only'), + e.appendChild(s); + } + return e.appendChild(a), e; + } + return a; + } + function Ds(t, e) { + let i = null; + if (e.TeX.processEnvironments && /^\s*\\begin/.test(t)) + (i = document.createDocumentFragment()), + i.appendChild(Fs(t, void 0, e, !0)); + else { + const s = Ls(t, e.TeX.delimiters); + if (1 === s.length && 'text' === s[0].type) return null; + i = document.createDocumentFragment(); + for (let t = 0; t < s.length; t++) + 'text' === s[t].type + ? i.appendChild(document.createTextNode(s[t].data)) + : i.appendChild(Fs(s[t].data, s[t].mathstyle, e, !0)); + } + return i; + } + const zs = { + namespace: '', + skipTags: [ + 'noscript', + 'style', + 'textarea', + 'pre', + 'code', + 'annotation', + 'annotation-xml', + ], + processScriptType: 'math/tex', + ignoreClass: 'tex2jax_ignore', + processClass: 'tex2jax_process', + preserveOriginalContent: !0, + renderAccessibleContent: 'mathml', + TeX: { + disabled: !1, + processEnvironments: !0, + delimiters: { + inline: [['\\(', '\\)']], + display: [ + ['$$', '$$'], + ['\\[', '\\]'], + ], + }, + }, + }; + var Es = { + renderMathInElement: function(t, e) { + try { + if ( + (((e = Object.assign( + {}, + zs, + e + )).ignoreClassPattern = new RegExp(e.ignoreClass)), + (e.processClassPattern = new RegExp(e.processClass)), + (e.processScriptTypePattern = new RegExp( + e.processScriptType + )), + (e.macros = At.MACROS), + e.namespace) + ) { + if (!/^[a-z]+[-]?$/.test(e.namespace)) + throw Error( + 'options.namespace must be a string of lowercase characters only' + ); + /-$/.test(e.namespace) || (e.namespace += '-'); + } + !(function t(e, i) { + const s = e.getAttribute( + 'data-' + i.namespace + 'original-content' + ); + if (s) { + const t = Fs( + s, + e.getAttribute( + 'data-' + i.namespace + 'mathstyle' + ), + i, + !1 + ); + null != t && + ((e.textContent = ''), e.appendChild(t)); + } else { + if ( + 1 === e.childNodes.length && + 3 === e.childNodes[0].nodeType + ) { + const t = e.childNodes[0].textContent; + if ( + i.TeX.processEnvironments && + /^\s*\\begin/.test(t) + ) + return ( + (e.textContent = ''), + void e.appendChild(Fs(t, void 0, i, !0)) + ); + const s = Ls(t, i.TeX.delimiters); + if (1 === s.length && 'math' === s[0].type) + return ( + (e.textContent = ''), + void e.appendChild( + Fs(s[0].data, s[0].mathstyle, i, !0) + ) + ); + if (1 === s.length && 'text' === s[0].type) + return; + } + for (let s = 0; s < e.childNodes.length; s++) { + const a = e.childNodes[s]; + if (3 === a.nodeType) { + const t = Ds(a.textContent, i); + t && + ((s += t.childNodes.length - 1), + e.replaceChild(t, a)); + } else if (1 === a.nodeType) { + const e = a.nodeName.toLowerCase(); + if ( + 'script' === e && + i.processScriptTypePattern.test(a.type) + ) { + let t = 'displaystyle'; + for (const e of a.type.split(';')) { + const i = e.split('='); + 'mode' === i[0].toLowerCase() && + (t = + 'display' === + i[1].toLoweCase() + ? 'displaystyle' + : 'textstyle'); + } + const e = Fs(a.textContent, t, i, !0); + a.parentNode.replaceChild(e, a); + } else + (i.processClassPattern.test( + a.className + ) || + (!i.skipTags.includes(e) && + !i.ignoreClassPattern.test( + a.className + ))) && + t(a, i); + } + } + } + })(t, e); + } catch (t) { + Error; + } + }, + }; + function qs(t, e, i, s) { + e = e || 'displaystyle'; + const a = n(t), + o = he.parseTokens(a, 'math', null, s); + if ('mathlist' === i) return o; + let r = te.decompose({ mathstyle: e }, o); + if (((r = $.coalesce(r)), 'span' === i)) return r; + const l = $.makeSpan(r, 'ML__base'), + c = $.makeSpan('', 'ML__strut'); + c.setStyle('height', l.height, 'em'); + const h = [c]; + if (0 !== l.depth) { + const t = $.makeSpan('', 'ML__strut--bottom'); + t.setStyle('height', l.height + l.depth, 'em'), + t.setStyle('vertical-align', -l.depth, 'em'), + h.push(t); + } + return h.push(l), $.makeSpan(h, 'ML__mathlive').toMarkup(); + } + function Ps(t, e) { + if (!te.toMathML) return ''; + ((e = e || {}).macros = e.macros || {}), + Object.assign(e.macros, At.MACROS); + const i = he.parseTokens(n(t), 'math', null, e.macros); + return te.toMathML(i, e); + } + function Is(t, e) { + if (!te.toSpeakableText) return ''; + ((e = e || {}).macros = e.macros || {}), + Object.assign(e.macros, At.MACROS); + const i = he.parseTokens(n(t), 'math', null, e.macros); + return te.toSpeakableText(i, e); + } + function Bs(t, e) { + if ( + (!e && + window && + window.mathlive && + (e = window.mathlive.config), + (e = e || {}).speechEngine && 'local' !== e.speechEngine) + ) + if ('amazon' === e.speechEngine) { + if (window && window.AWS) { + const i = new window.AWS.Polly({ + apiVersion: '2016-06-10', + }), + s = { + OutputFormat: 'mp3', + VoiceId: e.speechEngineVoice || 'Joanna', + Text: t, + TextType: 'ssml', + }; + i.synthesizeSpeech(s, function(t, e) { + if (t); + else if (e && e.AudioStream) { + const t = new Uint8Array(e.AudioStream), + i = new Blob([t.buffer], { + type: 'audio/mpeg', + }), + s = URL.createObjectURL(i); + new Audio(s).play().catch(t => {}); + } + }); + } + } else e.speechEngine; + else { + const e = new SpeechSynthesisUtterance(t); + window && window.speechSynthesis.speak(e); + } + } + function Os(t, e, i) { + if (!window) return; + if ( + (!i && window.mathlive && (i = window.mathlive.config), + 'amazon' !== (i = i || {}).speechEngine) + ) + return void (i.handleSpeak && i.handleSpeak(e)); + if (!window.AWS) return; + const s = new window.AWS.Polly({ apiVersion: '2016-06-10' }), + a = { + OutputFormat: 'json', + VoiceId: i.speechEngineVoice || 'Joanna', + Text: e, + TextType: 'ssml', + SpeechMarkTypes: ['ssml'], + }; + (window.mathlive = window.mathlive || {}), + (window.mathlive.readAloudElement = t); + const o = i.onReadAloudStatus || window.mathlive.onReadAloudStatus; + s.synthesizeSpeech(a, function(t, e) { + if (t); + else if (e && e.AudioStream) { + const t = new TextDecoder('utf-8').decode( + new Uint8Array(e.AudioStream) + ); + (window.mathlive.readAloudMarks = t + .split('\n') + .map(t => (t ? JSON.parse(t) : {}))), + (window.mathlive.readAloudTokens = []); + for (const t of window.mathlive.readAloudMarks) + t.value && + window.mathlive.readAloudTokens.push(t.value); + (window.mathlive.readAloudCurrentMark = ''), + (a.OutputFormat = 'mp3'), + (a.SpeechMarkTypes = []), + s.synthesizeSpeech(a, function(t, e) { + if (t); + else if (e && e.AudioStream) { + const t = new Uint8Array(e.AudioStream), + i = new Blob([t.buffer], { + type: 'audio/mpeg', + }), + s = URL.createObjectURL(i); + window.mathlive.readAloudAudio + ? window.mathlive.readAloudAudio.pause() + : ((window.mathlive.readAloudAudio = new Audio()), + window.mathlive.readAloudAudio.addEventListener( + 'ended', + () => { + o && + o( + window.mathlive + .readAloudMathField, + 'ended' + ), + window.mathlive + .readAloudMathField + ? (window.mathlive.readAloudMathField._render(), + (window.mathlive.readAloudElement = null), + (window.mathlive.readAloudMathField = null), + (window.mathlive.readAloudTokens = []), + (window.mathlive.readAloudMarks = []), + (window.mathlive.readAloudCurrentMark = + '')) + : (function t(e) { + e.classList.remove( + 'highlight' + ), + e.children && + Array.from( + e.children + ).forEach( + e => { + t( + e + ); + } + ); + })( + window.mathlive + .readAloudElement + ); + } + ), + window.mathlive.readAloudAudio.addEventListener( + 'timeupdate', + () => { + let t = ''; + const e = + 1e3 * + window.mathlive + .readAloudAudio + .currentTime + + 100; + for (const i of window.mathlive + .readAloudMarks) + i.time < e && (t = i.value); + window.mathlive + .readAloudCurrentMark !== t && + ((window.mathlive.readAloudCurrentToken = t), + t && + t === + window.mathlive + .readAloudFinalToken + ? window.mathlive.readAloudAudio.pause() + : ((window.mathlive.readAloudCurrentMark = t), + (function t(e, i) { + i && + e.dataset.atomId !== + i + ? (e.classList.remove( + 'highlight' + ), + e.children && + e.children + .length > + 0 && + Array.from( + e.children + ).forEach( + e => { + t( + e, + i + ); + } + )) + : (e.classList.add( + 'highlight' + ), + e.children && + e.children + .length > + 0 && + Array.from( + e.children + ).forEach( + e => { + t( + e + ); + } + )); + })( + window.mathlive + .readAloudElement, + window.mathlive + .readAloudCurrentMark + ))); + } + )), + (window.mathlive.readAloudAudio.src = s), + o && + o( + window.mathlive.readAloudMathField, + 'playing' + ), + window.mathlive.readAloudAudio.play(); + } + }); + } + }); + } + function Rs(t) { + let e = t; + if ('string' == typeof t && ((e = document.getElementById(t)), !e)) + throw Error(`The element with ID "${t}" could not be found.`); + return e; + } + function Ks(t, e) { + Es && + (((e = e || {}).renderToMarkup = e.renderToMarkup || qs), + (e.renderToMathML = e.renderToMathML || Ps), + (e.renderToSpeakableText = e.renderToSpeakableText || Is), + (e.macros = e.macros || At.MACROS), + Es.renderMathInElement(Rs(t), e)); + } + function Ns(t) { + if (t.namespace) { + if (!/^[a-z]+[-]?$/.test(t.namespace)) + throw Error( + 'options.namespace must be a string of lowercase characters only' + ); + /-$/.test(t.namespace) || (t.namespace += '-'); + } + } + return { + latexToMarkup: qs, + latexToMathML: Ps, + latexToSpeakableText: Is, + latexToAST: function(t, e) { + if (!te.toAST) return {}; + ((e = e || {}).macros = e.macros || {}), + Object.assign(e.macros, At.MACROS); + const i = he.parseTokens(n(t), 'math', null, e.macros); + return te.toAST(i, e); + }, + astToLatex: function(t, e) { + return ps(t, e); + }, + makeMathField: function(t, e) { + if (!Cs) throw Error('The MathField module is not loaded.'); + return ( + ((e = e || {}).handleSpeak = e.handleSpeak || Bs), + (e.handleReadAloud = e.handleReadAloud || Os), + new Cs.MathField(Rs(t), e) + ); + }, + renderMathInDocument: function(t) { + Ks(document.body, t); + }, + renderMathInElement: Ks, + revertToOriginalContent: function(t, e) { + (t = (t = Rs(t)).children[1]) instanceof Cs.MathField + ? t.revertToOriginalContent() + : (Ns((e = e || {})), + (t.innerHTML = t.getAttribute( + 'data-' + (e.namespace || '') + 'original-content' + ))); + }, + getOriginalContent: function(t, e) { + return (t = (t = Rs(t)).children[1]) instanceof Cs.MathField + ? t.originalContent + : (Ns((e = e || {})), + t.getAttribute( + 'data-' + (e.namespace || '') + 'original-content' + )); + }, + readAloud: Os, + readAloudStatus: function() { + return window + ? ((window.mathlive = window.mathlive || {}), + window.mathlive.readAloudAudio + ? window.mathlive.readAloudAudio.paused + ? 'paused' + : window.mathlive.readAloudAudio.ended + ? 'ready' + : 'playing' + : 'ready') + : 'unavailable'; + }, + pauseReadAloud: function() { + window && + ((window.mathlive = window.mathlive || {}), + window.mathlive.readAloudAudio && + (window.mathlive.onReadAloudStatus && + window.mathlive.onReadAloudStatus( + window.mathlive.readAloudMathField, + 'paused' + ), + window.mathlive.readAloudAudio.pause())); + }, + resumeReadAloud: function() { + window && + ((window.mathlive = window.mathlive || {}), + window.mathlive.readAloudAudio && + (window.mathlive.onReadAloudStatus && + window.mathlive.onReadAloudStatus( + window.mathlive.readAloudMathField, + 'playing' + ), + window.mathlive.readAloudAudio.play())); + }, + playReadAloud: function(t, e) { + if ( + window && + ((window.mathlive = window.mathlive || {}), + window.mathlive.readAloudAudio) + ) { + let i = 0; + if (((window.mathlive.readAloudFinalToken = null), t)) { + window.mathlive.readAloudMarks = + window.mathlive.readAloudMarks || []; + for (const e of window.mathlive.readAloudMarks) + e.value === t && (i = e.time / 1e3); + let s = window.mathlive.readAloudTokens.indexOf(t); + s >= 0 && + ((s += e), + s < window.mathlive.readAloudTokens.length && + (window.mathlive.readAloudFinalToken = s)); + } + (window.mathlive.readAloudAudio.currentTime = i), + window.mathlive.onReadAloudStatus && + window.mathlive.onReadAloudStatus( + window.mathlive.readAloudMathField, + 'playing' + ), + window.mathlive.readAloudAudio.play(); + } + }, + }; + }), + 'object' == typeof exports && 'undefined' != typeof module + ? (module.exports = factory()) + : 'function' == typeof define && define.amd + ? define(factory) + : ((global = global || self).MathLive = factory()); diff --git a/dist/mathlive.mjs b/dist/mathlive.mjs index f4aa5a8ff..213a78cc1 100644 --- a/dist/mathlive.mjs +++ b/dist/mathlive.mjs @@ -1 +1 @@ -function t(t,e){e=e||0;const i=t.charCodeAt(e);if(55296<=i&&i<=56319&&e=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return K[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return K[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(N[e]?this.classes+=" "+N[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function I(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return B(i[0],e)}return new L(t,e)}function O(t,e,i){const s=B(e,i);return s.type=t,s}function R(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const K={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},N={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var $={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,I(c)||0),c.height=Math.max(-o,P(c)||0),c},makeHlist:R,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=R(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:P,depth:I,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=$.makeSymbol,Ct=$.makeSpan,_t=$.makeVlist;function Tt(t,e,i,s,a,o){const n=Mt("Size"+i+"-Regular",At.getValue("math",e)),r=$.makeStyleWrap(t,Ct(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+i)}function Ft(t,e,i,s,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Bt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Ot(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return Rt(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?Pt:Dt.includes(e)?Bt:It;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(At.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=$.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Tt(t,e,r.size,s,a,o):Ft(t,e,i,s,a,o)}function Rt(t,e,i){return $.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Kt={makeSizedDelim:function(t,e,i,s,a){return"."===e?Rt(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,i,!1,s,a):zt.includes(e)?Ft(t,e,qt[i],!1,s,a):null)},makeCustomSizedDelim:Ot,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return Rt(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Ot(t,e,h,!0,a,o)}};const Nt=$.makeSpan,$t=$.makeOrd,Wt=$.makeInner,Ht=$.makeHlist,Vt=$.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=$t(Qt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);t$.height(i)+$.depth(i)+o&&(o=(o+l-($.height(i)+$.depth(i)))/2),r.setTop(r.height-$.height(i)-(o+s));const c=Nt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Vt(t,[i,o,c,s]);if(!this.index)return this.bind(t,$t([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Nt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,$t([Nt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,$t(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=$.skew(i));const a=Math.min($.height(i),e.metrics.xHeight),o=$.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Nt(Nt(o),"accent-body"+n);return r=Vt(t,[i,-a,r]),r.children[1].setLeft(2*s),$t(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Qt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=Nt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[i,3*s,a,s]);else{const e=Nt(i);o=Vt(t,[s,a,3*s,e],"top",$.height(e))}return $t(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?Nt(Qt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?Nt(Qt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Yt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Nt(Qt(t,this.body),"inner");return $t([e,Nt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=$t("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=$.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=$.makeOp(Qt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=$t(Qt(t,this.body)),i=Nt();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=Nt([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=$t(Qt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",($.height(e)+$.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=Nt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Nt(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Nt(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=$.height(e)-s.metrics.supDrop,l=$.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-$.depth(a)-($.height(o)-l)<4*i){l=4*i-(r-a.depth)+$.height(o);const t=.8*s.metrics.xHeight-(r-$.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-$.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,$.height(o)-.8*s.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-$.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Nt(p,"msubsup");return this.caret&&(m.caret=this.caret),$.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?Nt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Nt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=$.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Xt(t){const e=Nt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,i,s){const a=[];for(const o of e){const e=Nt(Qt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Vt(t,a,"individualShift")}function Yt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=Nt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+$.height(o)+$.depth(o)+l+$.depth(e)+i;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=$.height(e)-i;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=$.depth(e)+i;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return $.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const i=new Zt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Zt("","first")),i},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},ie={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var se=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in ie)if(ie[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return se(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new re("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=At.getInfo("\\"+i.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new re(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=At.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=se(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=At.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new re(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=At.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new re(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[i])return ue[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=fe[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=xe(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(i.test(xe(ue[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ce(t,e){let i;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Be()),i}function _e(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Te(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new te.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function Le(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ce(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(De(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||De(t[i],e)})))return!0;if(t.array)for(let i=_e(t.array);i>=0;i--)if(De(Ce(t.array,i),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Pe(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=qe(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Pe(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Pe(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Pe(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=qe(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=Ie(i[1],e),t+=qe(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Pe(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=qe(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=Ie(i[1],e),t+=qe(i[2],e),s=!0)),!s)if(i=Pe(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Pe(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+qe(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+qe(i.rest,e):i.match+qe(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+qe(i[2],e),s=!0)),t}function Pe(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=ve.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function Ie(t,e){let i=ve.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Be(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},we.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new we;s.path=me.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},we.prototype.setRange=function(t,e,i){i=i||{};const s=me.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),s)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Be()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&At.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=_e(e.array);i>=0;i--)t(Ce(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},we.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=_e(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=Se(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},we.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},we.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},we.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=At.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new te.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Be()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Be()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Be()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Be()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Be()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Me(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=Ae(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=At.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Oe={EditableMathlist:we,parseMathString:Ee};const Re={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Ke={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ne={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function $e(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=Ne[t.target.value]||t.target.value),e||(Re[t.key]?(e=Re[t.key],i=!1):e=Ke[t.key],e||(e=Ne[t.key.toLowerCase()])),!e&&t.code&&(e=Ke[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function We(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke($e(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke($e(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:$e,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&Ze(t,i),t.popover.classList.add("is-visible")}function Ze(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Xe(t);const s=e,a=function(t,e){const i=he.parseTokens(n(t),"math",null,e.config.macros),s=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=$.makeSpan(s,"ML__base"),o=$.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=$.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),$.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[s]||e,t),o=je(s),r=ve.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Ye(this,this.array[s][e],t);s1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Ye(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Ye(this,this.shift,t)}em]`),i+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Ye(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ae(this.backgroundcolor)}}`),i+=`{${Ye(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Qe.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Qe.locale.substring(0,2),a="ordinal"===i.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[s]&&(o=Qe.strings[s][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const i=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ti={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ei={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ii={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let si={};const ai={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function oi(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=he.parseTokens(n(t),"math",e,i.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=$.makeSpan(a,"ML__base"),r=$.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=$.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),$.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ni(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ti,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function ri(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ei[n]&&(a.setAttribute("data-shifted",ei[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ei[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=si[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function li(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ci={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ii["foreground-color"]=[];for(const t of ne)ii["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ii["background-color"]=[];for(const t of oe)ii["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});si={...ii},Object.keys(si).forEach(t=>{si[t]=si[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),si[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),si[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),si[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ai,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ti,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ni(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=li(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,ri(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:ri};const hi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},di={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},pi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function mi(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ui(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,gi(t)&&(n=t.index,t.index+=1),yi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=Si(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,gi(t)){const e=Si(t.atoms[n].superscript,0,0,i).mathML,s=Si(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=Si(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function gi(t){return t.index"+t,a+=Si(o.subscript,0,0,i).mathML,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=Si(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function xi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&gi(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Si(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function vi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Ai(t.atoms[l],i),a+=Si(t.atoms,l+1,c,i).mathML,a+=Ai(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function wi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Mi(e.body)+"":Ai(e,i);a+=r,t.index+=1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function Si(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Ai(t,e){let i="";const s=Mi(t.body);return s&&(i=""+s+""),i}function Mi(t){if(!t)return"";if("string"==typeof t)return mi(t);if(!Array.isArray(t)&&"string"==typeof t.body)return mi(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return mi(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Si(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(pi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+Si(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(pi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Si(this.numer,0,0,t).mathML||" ",c+=Si(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Si(this.numer,0,0,t).mathML+"",c+=""+Si(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Si(this.body,0,0,t).mathML,c+=Si(this.index,0,0,t).mathML,c+=""):(c+="",c+=Si(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Si(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(pi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Si(this.body,0,0,t).mathML,c+=""+(pi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):r?(c+=""+Si(l,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):n&&(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+ui(this.id,t)+">"+mi(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&pi[p]?""+pi[p]+"":Ai(this,t);break;case"mpunct":c='"+(pi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Si(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Si(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Si(t,0,0,e).mathML};const Ci={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_i={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ti={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Li={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fi(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Di(t){return t&&Li[t]||-1}function zi(t){return/=|=>/.test(t)?"right":"left"}function Ei(t){if("f"===t||"g"===t)return!0;const e=Ti[t];return!!e&&!!/%[^01_^]?/.test(e)}function qi(t){t=(t||"").trim();let e=Ci[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=At.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Pi(t){if(!t)return null;const e=qi(Ni(t)),i=[Di(e),zi(e)];return i[0]<=0?null:i}function Ii(t){return null!==Pi(t)}const Bi={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Oi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Ri={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Ki={",":"list",";":"list2"};function Ni(t){if(Array.isArray(t)){let e="";for(const i of t)e+=Ni(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=Ni(i);return e}return""}function $i(t){return"string"==typeof t.sym?function(t){let e=Ti[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=At.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Wi(t){return parseFloat(t.num)}function Hi(t){return"object"==typeof t&&void 0!==t.num}function Vi(t){let e=0;return Hi(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hs(t.num.re):0:parseFloat(t.num)),e}function Ui(t){let e=0;return Hi(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hs(t.num.im):0),e}function ji(t){return t&&void 0!==t.sup}function Gi(t){return t&&void 0!==t.sub}function Zi(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||Ni(a)===i),s}function Xi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Ji(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Yi(t){if(Hi(t)){const e=Vi(t),i=Ui(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Xi("negate",t)}function Qi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ts(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=rs(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test(Ni(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test(Ni(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ni(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=rs(i.superscript,e)):t.ast.sup=rs(i.superscript,e))):t.index+=1,t}function es(t,e){const i=t.ast;if(ss(t,"!!"))return t.index+=1,t.ast=Xi("factorial2",i),es(t=ts(t,e),e);if(ss(t,"++"))return t.index+=1,t.ast=Xi("increment",i),es(t=ts(t,e),e);if(ss(t,"--"))return t.index+=1,t.ast=Xi("decrement",i),es(t=ts(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Oi[s.latex.trim()]&&(t.ast=Xi(Oi[s.latex.trim()],i),t=es(t=ts(t,e),e)),t}function is(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ni(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"mclose"===o.type&&Ni(o)===i&&(Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s));else if("textord"===o.type&&Ni(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"textord"===o.type&&Ni(o)===i&&(t.index+=1,t=es(t=ts(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=os(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=es(t=ts(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=es(t=ts(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=rs(o.body,s),Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=At.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=At.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=is(t,e,i))return s&&(t.index+=1),t.ast={fn:Bi[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function ss(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ni(t.atoms[t.index])+Ni(t.atoms[t.index+1])}function as(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zi(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=|\*\*|\+\+|--)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,Zi(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zi(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function os(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qi(Ni(s));if(as(e))e.ast=Xi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Yi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Xi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ns(t)))),e=[t])}return e}function rs(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=os(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Xi("text",...i):i[0]||void 0}({atoms:ns(t)},e)}function ls(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function cs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hs(t){return parseFloat(parseFloat(t).toPrecision(15))}function ds(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=cs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=cs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=cs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=hs(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=cs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=cs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}te.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=he.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=he.parseTokens(n(s),"math",null,t.macros),o=Xi("divide",rs(i,t),rs(s,t))):o.fn="divide"):o.group=rs(this.body,t);break;case"genfrac":o=Xi("divide",rs(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Ji(1):rs(this.denom,t));break;case"surd":o=this.index?Xi("pow",rs(this.body,t),Xi("divide",1,rs(this.index,t))):Xi("sqrt",rs(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qi(Ni(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=rs(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xi("card",rs(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>rs(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(rs(e[0],t));let s=rs(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return rs(t,e)};var ps=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hi(e)){const i=Wi(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":ds(e.num,s);else{const t=Vi(e),i=Ui(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ds(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?ds(i,s):"")+"\\imaginaryI "))}ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Hi(e.group)||$i(e.group)?0!==Ui(e.group)&&(a=ls(e.fence||"(),",a)):a=ls(e.fence||"(),",a),ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fi(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Fi(e,1));else{let i="";for(let s=1;s=2)a=t(Fi(e,0),s),Hi(Fi(e,0))||$i(Fi(e,0))||(a=ls(e.fence||"(),",a)),a+="^{"+t(Fi(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ti[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ls(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fi(e,0),s),r=t(Fi(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ls(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ls(e.fence||"(),","");a=ji(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Gi(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ls("() ",t(a,s))):0!==Vi(o=a)&&0!==Ui(o)?i.push(ls("() ",t(a,s))):ji(e)&&0!==Ui(a)&&1!==Ui(a)?i.push(ls("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hi(e.arg[0])&&"divide"!==e.arg[0].fn||Hi(e.arg[1])&&(0!==Vi(e.arg[1])||1!==Ui(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hi(e.arg[0])&&Wi(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function us(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function fs(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function gs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function ys(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function bs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function xs(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ks(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let i=te.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else us(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ms[t.leftDelim]||t.leftDelim,s+=te.toSpeakableFragment(t.body,e),s+=ms[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ms[a]||(o?ms[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ms[t.body]||ms[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),us(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(us(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),us(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},te.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=te.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=te.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class vs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gs(this.element,"focus",this),gs(this.element,"blur",this),gs(this.textarea,"cut",this),gs(this.textarea,"copy",this),gs(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gs(this.field,"pointerdown",this):gs(this.field,"touchstart:active mousedown",this),gs(window,"resize",this);const o={...e};o.onSelectionDidChange=vs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Oe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ks(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ys(this.textarea,"cut",this),ys(this.textarea,"copy",this),ys(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xs(this.popover),xs(this.keystrokeCaption),xs(this.virtualKeyboard),xs(document.getElementById("mathlive-alternate-keys-panel")),ys(this.element,"pointerdown",this),ys(this.element,"touchstart:active mousedown",this),ys(this.element,"focus",this),ys(this.element,"blur",this),ys(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=me.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){if(this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,i=this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=me.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||Ss>2?(n(t),3!==t.detail&&3!==Ss||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(gs(e.field,"pointermove",h),gs(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gs(window,"blur",n),t.touches?(gs(t.target,"touchmove",h),gs(t.target,"touchend",n)):(gs(window,"mousemove",h),gs(window,"mouseup",n))),2!==t.detail&&2!==Ss||(a=!0,this.mathlist.selectGroup_()))}}else ws=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return As(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=As(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=ve.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=At.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;iks(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1});const e=this.$hasFocus();this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0});const i=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=$.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=$.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=$.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=$.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=hi[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&hi[a]?hi[a]:a&&di[a]?di[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=di[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=te.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const i=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=he.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Je.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gs(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),gs(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gs(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ci.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xs(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=te.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ws,Ss=0;function As(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(i,s)}function Ms(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=As(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=As(t,"",t.mathlist.sibling(0)):"line"===e?(a=As(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?As(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vs.prototype.undo_=vs.prototype.undo,vs.prototype.redo_=vs.prototype.redo,vs.prototype.scrollIntoView_=vs.prototype.scrollIntoView,vs.prototype.scrollToStart_=vs.prototype.scrollToStart,vs.prototype.scrollToEnd_=vs.prototype.scrollToEnd,vs.prototype.insert_=vs.prototype.$insert;var Cs={isValidMathfield:ks,MathField:vs};function _s(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_s(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ds(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Fs(t,void 0,e,!0));else{const s=Ls(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Os(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function Rs(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Ks(t,e){Es&&((e=e||{}).renderToMarkup=e.renderToMarkup||qs,e.renderToMathML=e.renderToMathML||Ps,e.renderToSpeakableText=e.renderToSpeakableText||Is,e.macros=e.macros||At.MACROS,Es.renderMathInElement(Rs(t),e))}function Ns(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const $s={latexToMarkup:qs,latexToMathML:Ps,latexToSpeakableText:Is,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const i=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(i,e)},astToLatex:function(t,e){return ps(t,e)},makeMathField:function(t,e){if(!Cs)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Bs,e.handleReadAloud=e.handleReadAloud||Os,new Cs.MathField(Rs(t),e)},renderMathInDocument:function(t){Ks(document.body,t)},renderMathInElement:Ks,revertToOriginalContent:function(t,e){(t=(t=Rs(t)).children[1])instanceof Cs.MathField?t.revertToOriginalContent():(Ns(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Rs(t)).children[1])instanceof Cs.MathField?t.originalContent:(Ns(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Os,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return K[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return K[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(N[e]?this.classes+=" "+N[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function I(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return B(i[0],e)}return new L(t,e)}function O(t,e,i){const s=B(e,i);return s.type=t,s}function R(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const K={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},N={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var $={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,I(c)||0),c.height=Math.max(-o,P(c)||0),c},makeHlist:R,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=R(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:P,depth:I,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=$.makeSymbol,Ct=$.makeSpan,_t=$.makeVlist;function Tt(t,e,i,s,a,o){const n=Mt("Size"+i+"-Regular",At.getValue("math",e)),r=$.makeStyleWrap(t,Ct(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+i)}function Ft(t,e,i,s,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Bt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Ot(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return Rt(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?Pt:Dt.includes(e)?Bt:It;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(At.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=$.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Tt(t,e,r.size,s,a,o):Ft(t,e,i,s,a,o)}function Rt(t,e,i){return $.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Kt={makeSizedDelim:function(t,e,i,s,a){return"."===e?Rt(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,i,!1,s,a):zt.includes(e)?Ft(t,e,qt[i],!1,s,a):null)},makeCustomSizedDelim:Ot,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return Rt(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Ot(t,e,h,!0,a,o)}};const Nt=$.makeSpan,$t=$.makeOrd,Wt=$.makeInner,Ht=$.makeHlist,Vt=$.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=$t(Qt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);t$.height(i)+$.depth(i)+o&&(o=(o+l-($.height(i)+$.depth(i)))/2),r.setTop(r.height-$.height(i)-(o+s));const c=Nt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Vt(t,[i,o,c,s]);if(!this.index)return this.bind(t,$t([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Nt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,$t([Nt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,$t(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=$.skew(i));const a=Math.min($.height(i),e.metrics.xHeight),o=$.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Nt(Nt(o),"accent-body"+n);return r=Vt(t,[i,-a,r]),r.children[1].setLeft(2*s),$t(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Qt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=Nt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[i,3*s,a,s]);else{const e=Nt(i);o=Vt(t,[s,a,3*s,e],"top",$.height(e))}return $t(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?Nt(Qt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?Nt(Qt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Yt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Nt(Qt(t,this.body),"inner");return $t([e,Nt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=$t("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=$.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=$.makeOp(Qt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=$t(Qt(t,this.body)),i=Nt();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=Nt([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=$t(Qt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",($.height(e)+$.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=Nt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Nt(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Nt(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=$.height(e)-s.metrics.supDrop,l=$.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-$.depth(a)-($.height(o)-l)<4*i){l=4*i-(r-a.depth)+$.height(o);const t=.8*s.metrics.xHeight-(r-$.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-$.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,$.height(o)-.8*s.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-$.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Nt(p,"msubsup");return this.caret&&(m.caret=this.caret),$.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?Nt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Nt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=$.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Xt(t){const e=Nt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,i,s){const a=[];for(const o of e){const e=Nt(Qt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Vt(t,a,"individualShift")}function Yt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=Nt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+$.height(o)+$.depth(o)+l+$.depth(e)+i;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=$.height(e)-i;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=$.depth(e)+i;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return $.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const i=new Zt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Zt("","first")),i},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},ie={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var se=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in ie)if(ie[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return se(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new re("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=At.getInfo("\\"+i.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new re(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=At.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=se(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=At.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new re(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=At.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new re(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[i])return ue[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=fe[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=xe(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(i.test(xe(ue[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ce(t,e){let i;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Be()),i}function _e(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Te(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new te.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function Le(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ce(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(De(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||De(t[i],e)})))return!0;if(t.array)for(let i=_e(t.array);i>=0;i--)if(De(Ce(t.array,i),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Pe(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=qe(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Pe(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Pe(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Pe(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=qe(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=Ie(i[1],e),t+=qe(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Pe(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=qe(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=Ie(i[1],e),t+=qe(i[2],e),s=!0)),!s)if(i=Pe(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Pe(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+qe(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+qe(i.rest,e):i.match+qe(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+qe(i[2],e),s=!0)),t}function Pe(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=ve.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function Ie(t,e){let i=ve.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Be(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},we.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new we;s.path=me.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},we.prototype.setRange=function(t,e,i){i=i||{};const s=me.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),s)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Be()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&At.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=_e(e.array);i>=0;i--)t(Ce(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},we.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=_e(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=Se(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},we.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},we.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},we.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=At.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new te.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Be()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Be()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Be()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Be()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Be()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Me(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=Ae(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=At.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Oe={EditableMathlist:we,parseMathString:Ee};const Re={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Ke={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ne={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function $e(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=Ne[t.target.value]||t.target.value),e||(Re[t.key]?(e=Re[t.key],i=!1):e=Ke[t.key],e||(e=Ne[t.key.toLowerCase()])),!e&&t.code&&(e=Ke[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function We(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke($e(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke($e(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:$e,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&Ze(t,i),t.popover.classList.add("is-visible")}function Ze(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Xe(t);const s=e,a=function(t,e){const i=he.parseTokens(n(t),"math",null,e.config.macros),s=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=$.makeSpan(s,"ML__base"),o=$.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=$.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),$.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[s]||e,t),o=je(s),r=ve.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Ye(this,this.array[s][e],t);s1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Ye(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Ye(this,this.shift,t)}em]`),i+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Ye(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ae(this.backgroundcolor)}}`),i+=`{${Ye(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Qe.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Qe.locale.substring(0,2),a="ordinal"===i.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[s]&&(o=Qe.strings[s][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const i=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ti={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ei={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ii={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let si={};const ai={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function oi(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=he.parseTokens(n(t),"math",e,i.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=$.makeSpan(a,"ML__base"),r=$.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=$.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),$.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ni(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ti,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function ri(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ei[n]&&(a.setAttribute("data-shifted",ei[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ei[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=si[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function li(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ci={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ii["foreground-color"]=[];for(const t of ne)ii["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ii["background-color"]=[];for(const t of oe)ii["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});si={...ii},Object.keys(si).forEach(t=>{si[t]=si[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),si[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),si[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),si[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ai,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ti,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ni(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=li(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,ri(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:ri};const hi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},di={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},pi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function mi(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ui(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,gi(t)&&(n=t.index,t.index+=1),yi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=Si(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,gi(t)){const e=Si(t.atoms[n].superscript,0,0,i).mathML,s=Si(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=Si(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function gi(t){return t.index"+t,a+=Si(o.subscript,0,0,i).mathML,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=Si(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function xi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&gi(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Si(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function vi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Ai(t.atoms[l],i),a+=Si(t.atoms,l+1,c,i).mathML,a+=Ai(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function wi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Mi(e.body)+"":Ai(e,i);a+=r,t.index+=1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function Si(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Ai(t,e){let i="";const s=Mi(t.body);return s&&(i=""+s+""),i}function Mi(t){if(!t)return"";if("string"==typeof t)return mi(t);if(!Array.isArray(t)&&"string"==typeof t.body)return mi(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return mi(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Si(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(pi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+Si(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(pi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Si(this.numer,0,0,t).mathML||" ",c+=Si(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Si(this.numer,0,0,t).mathML+"",c+=""+Si(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Si(this.body,0,0,t).mathML,c+=Si(this.index,0,0,t).mathML,c+=""):(c+="",c+=Si(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Si(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(pi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Si(this.body,0,0,t).mathML,c+=""+(pi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):r?(c+=""+Si(l,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):n&&(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+ui(this.id,t)+">"+mi(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&pi[p]?""+pi[p]+"":Ai(this,t);break;case"mpunct":c='"+(pi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Si(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Si(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Si(t,0,0,e).mathML};const Ci={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_i={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ti={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Li={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fi(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Di(t){return t&&Li[t]||-1}function zi(t){return/=|=>/.test(t)?"right":"left"}function Ei(t){if("f"===t||"g"===t)return!0;const e=Ti[t];return!!e&&!!/%[^01_^]?/.test(e)}function qi(t){t=(t||"").trim();let e=Ci[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=At.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Pi(t){if(!t)return null;const e=qi(Ni(t)),i=[Di(e),zi(e)];return i[0]<=0?null:i}function Ii(t){return null!==Pi(t)}const Bi={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Oi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Ri={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Ki={",":"list",";":"list2"};function Ni(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const i of t)e+=Ni(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=Ni(i);return e}return""}function $i(t){return"string"==typeof t.sym?function(t){let e=Ti[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=At.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Wi(t){return parseFloat(t.num)}function Hi(t){return"object"==typeof t&&void 0!==t.num}function Vi(t){let e=0;return Hi(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hs(t.num.re):0:parseFloat(t.num)),e}function Ui(t){let e=0;return Hi(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hs(t.num.im):0),e}function ji(t){return t&&void 0!==t.sup}function Gi(t){return t&&void 0!==t.sub}function Zi(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||Ni(a)===i),s}function Xi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Ji(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Yi(t){if(Hi(t)){const e=Vi(t),i=Ui(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Xi("negate",t)}function Qi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ts(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=rs(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test(Ni(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test(Ni(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ni(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=rs(i.superscript,e)):t.ast.sup=rs(i.superscript,e))):t.index+=1,t}function es(t,e){const i=t.ast;if(ss(t,"!!"))return t.index+=1,t.ast=Xi("factorial2",i),es(t=ts(t,e),e);if(ss(t,"++"))return t.index+=1,t.ast=Xi("increment",i),es(t=ts(t,e),e);if(ss(t,"--"))return t.index+=1,t.ast=Xi("decrement",i),es(t=ts(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Oi[s.latex.trim()]&&(t.ast=Xi(Oi[s.latex.trim()],i),t=es(t=ts(t,e),e)),t}function is(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ni(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"mclose"===o.type&&Ni(o)===i&&(Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s));else if("textord"===o.type&&Ni(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"textord"===o.type&&Ni(o)===i&&(t.index+=1,t=es(t=ts(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=os(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=es(t=ts(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=es(t=ts(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=rs(o.body,s),Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=At.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=At.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=is(t,e,i))return s&&(t.index+=1),t.ast={fn:Bi[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function ss(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ni(t.atoms[t.index])+Ni(t.atoms[t.index+1])}function as(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zi(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,Zi(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zi(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function os(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qi(Ni(s));if(as(e))e.ast=Xi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Yi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Xi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ns(t)))),e=[t])}return e}function rs(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=os(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Xi("text",...i):i[0]||void 0}({atoms:ns(t)},e)}function ls(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function cs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hs(t){return parseFloat(parseFloat(t).toPrecision(15))}function ds(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=cs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=cs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=cs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=hs(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=cs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=cs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}te.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=he.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=he.parseTokens(n(s),"math",null,t.macros),o=Xi("divide",rs(i,t),rs(s,t))):o.fn="divide"):o.group=rs(this.body,t);break;case"genfrac":o=Xi("divide",rs(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Ji(1):rs(this.denom,t));break;case"surd":o=this.index?Xi("pow",rs(this.body,t),Xi("divide",Ji(1),rs(this.index,t))):Xi("sqrt",rs(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qi(Ni(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=rs(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xi("card",rs(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>rs(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(rs(e[0],t));let s=rs(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return rs(t,e)};var ps=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hi(e)){const i=Wi(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":ds(e.num,s);else{const t=Vi(e),i=Ui(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ds(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?ds(i,s):"")+"\\imaginaryI "))}ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Hi(e.group)||$i(e.group)?0!==Ui(e.group)&&(a=ls(e.fence||"(),",a)):a=ls(e.fence||"(),",a),ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fi(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Fi(e,1));else{let i="";for(let s=1;s=2)a=t(Fi(e,0),s),Hi(Fi(e,0))||$i(Fi(e,0))||(a=ls(e.fence||"(),",a)),a+="^{"+t(Fi(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ti[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ls(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fi(e,0),s),r=t(Fi(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ls(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ls(e.fence||"(),","");a=ji(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Gi(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ls("() ",t(a,s))):0!==Vi(o=a)&&0!==Ui(o)?i.push(ls("() ",t(a,s))):ji(e)&&0!==Ui(a)&&1!==Ui(a)?i.push(ls("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hi(e.arg[0])&&"divide"!==e.arg[0].fn||Hi(e.arg[1])&&(0!==Vi(e.arg[1])||1!==Ui(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hi(e.arg[0])&&Wi(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function us(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function fs(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function gs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function ys(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function bs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function xs(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ks(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let i=te.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else us(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ms[t.leftDelim]||t.leftDelim,s+=te.toSpeakableFragment(t.body,e),s+=ms[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ms[a]||(o?ms[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ms[t.body]||ms[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),us(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(us(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),us(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},te.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=te.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=te.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class vs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gs(this.element,"focus",this),gs(this.element,"blur",this),gs(this.textarea,"cut",this),gs(this.textarea,"copy",this),gs(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gs(this.field,"pointerdown",this):gs(this.field,"touchstart:active mousedown",this),gs(window,"resize",this);const o={...e};o.onSelectionDidChange=vs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Oe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ks(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ys(this.textarea,"cut",this),ys(this.textarea,"copy",this),ys(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xs(this.popover),xs(this.keystrokeCaption),xs(this.virtualKeyboard),xs(document.getElementById("mathlive-alternate-keys-panel")),ys(this.element,"pointerdown",this),ys(this.element,"touchstart:active mousedown",this),ys(this.element,"focus",this),ys(this.element,"blur",this),ys(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=me.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){if(this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,i=this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=me.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||Ss>2?(n(t),3!==t.detail&&3!==Ss||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(gs(e.field,"pointermove",h),gs(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gs(window,"blur",n),t.touches?(gs(t.target,"touchmove",h),gs(t.target,"touchend",n)):(gs(window,"mousemove",h),gs(window,"mouseup",n))),2!==t.detail&&2!==Ss||(a=!0,this.mathlist.selectGroup_()))}}else ws=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return As(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=As(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=ve.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=At.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;iks(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1});const e=this.$hasFocus();this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0});const i=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=$.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=$.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=$.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=$.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=hi[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&hi[a]?hi[a]:a&&di[a]?di[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=di[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=te.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const i=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=he.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Je.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gs(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),gs(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gs(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ci.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xs(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=te.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ws,Ss=0;function As(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(i,s)}function Ms(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=As(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=As(t,"",t.mathlist.sibling(0)):"line"===e?(a=As(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?As(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vs.prototype.undo_=vs.prototype.undo,vs.prototype.redo_=vs.prototype.redo,vs.prototype.scrollIntoView_=vs.prototype.scrollIntoView,vs.prototype.scrollToStart_=vs.prototype.scrollToStart,vs.prototype.scrollToEnd_=vs.prototype.scrollToEnd,vs.prototype.insert_=vs.prototype.$insert;var Cs={isValidMathfield:ks,MathField:vs};function _s(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_s(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ds(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Fs(t,void 0,e,!0));else{const s=Ls(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Os(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function Rs(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Ks(t,e){Es&&((e=e||{}).renderToMarkup=e.renderToMarkup||qs,e.renderToMathML=e.renderToMathML||Ps,e.renderToSpeakableText=e.renderToSpeakableText||Is,e.macros=e.macros||At.MACROS,Es.renderMathInElement(Rs(t),e))}function Ns(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const $s={latexToMarkup:qs,latexToMathML:Ps,latexToSpeakableText:Is,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const i=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(i,e)},astToLatex:function(t,e){return ps(t,e)},makeMathField:function(t,e){if(!Cs)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Bs,e.handleReadAloud=e.handleReadAloud||Os,new Cs.MathField(Rs(t),e)},renderMathInDocument:function(t){Ks(document.body,t)},renderMathInElement:Ks,revertToOriginalContent:function(t,e){(t=(t=Rs(t)).children[1])instanceof Cs.MathField?t.revertToOriginalContent():(Ns(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Rs(t)).children[1])instanceof Cs.MathField?t.originalContent:(Ns(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Os,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s=|<=|>>|<<|:=|!=|\*\*|\+\+|--)$/.test(digraph) - ? digraph - : ''; + const result = /^(>=|<=|>>|<<|:=|!=)$/.test(digraph) ? digraph : ''; if (result) { expr.index += 1; } @@ -1734,7 +1733,7 @@ MathAtom.MathAtom.prototype.toAST = function(options) { result = wrapFn( 'pow', parse(this.body, options), - wrapFn('divide', 1, parse(this.index, options)) + wrapFn('divide', wrapNum(1), parse(this.index, options)) ); } else { result = wrapFn('sqrt', parse(this.body, options)); From 8d47e060a5a0b794e6de282f0d515fbf4f253789 Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Tue, 4 Feb 2020 15:48:50 -0800 Subject: [PATCH 07/28] Fix #282: some virtual key presses produce an incorrect output --- src/editor/editor-virtualKeyboard.js | 58 ++++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/editor/editor-virtualKeyboard.js b/src/editor/editor-virtualKeyboard.js index bc20c84d9..e84b2ec10 100644 --- a/src/editor/editor-virtualKeyboard.js +++ b/src/editor/editor-virtualKeyboard.js @@ -474,8 +474,8 @@ const LAYERS = {
  • -
  • e
  • -
  • i
  • +
  • e
  • +
  • i
    • @@ -484,9 +484,9 @@ const LAYERS = {
    • -
    • x ²
    • -
    • x
    • -
    • +
    • x ²
    • +
    • x
    • +
    • (
    • @@ -576,7 +576,7 @@ const LAYERS = {
    • !
    • -
    • o
    • +
    • o
    • o
    • @@ -589,9 +589,9 @@ const LAYERS = {
    • -
    • -
    • -
    • +
    • +
    • +
    • -
    • -
    • -
    • -
    • -
    • +
    • +
    • +
    • +
    • +
    • -
    • -
    • -
    • -
    • -
    • -
    • +
    • +
    • +
    • +
    • +
    • +
    • -
    • -
    • -
    • -
    • -
    • -
    • +
    • +
    • +
    • +
    • +
    • +
    • (
    • )
    • -
    • -
    • +
    • +
    •  
    @@ -827,7 +827,7 @@ const LAYERS = {
  • -
  • +
    • From 3eecc9b3409ad7593b2be53caefa38f612eb413d Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Tue, 4 Feb 2020 15:50:27 -0800 Subject: [PATCH 08/28] bug: fix #364. Placeholder incorrectly selected when clicked on in some cases --- src/editor/editor-editableMathlist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor/editor-editableMathlist.js b/src/editor/editor-editableMathlist.js index 697e64496..d7be0e41d 100644 --- a/src/editor/editor-editableMathlist.js +++ b/src/editor/editor-editableMathlist.js @@ -275,7 +275,7 @@ EditableMathlist.prototype.setPath = function(selection, extent) { this.path = newPath; if (extent === 0 && this.anchor().type === 'placeholder') { // select the placeholder - newPath[newPath.length - 1].offset = 0; + newPath[newPath.length - 1].offset = this.anchorOffset() - 1; extent = 1; } selection = { From 2ebda2211c6f42f0136c28032c4a73d359a49bb3 Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Wed, 5 Feb 2020 15:10:53 -0800 Subject: [PATCH 09/28] feat: #368 --- css/mathlive.core.less | 14 +- css/mathlive.less | 796 +++++++++++++++++++-------------- src/core/mathAtom.js | 19 +- src/editor/editor-mathfield.js | 15 + 4 files changed, 506 insertions(+), 338 deletions(-) diff --git a/css/mathlive.core.less b/css/mathlive.core.less index 64b775cdc..ca6fa9c15 100644 --- a/css/mathlive.core.less +++ b/css/mathlive.core.less @@ -72,7 +72,7 @@ margin-right: -1ex; position: relative; color: var(--caret); - animation: ML__caret-command-blink 1.05s step-end forwards infinite; + animation: ML__caret-blink 1.05s step-end forwards infinite; } /* Text mode */ @@ -85,7 +85,7 @@ background: hsla(var(--hue), 40%, 50%, 0.1); } -@keyframes ML__caret-command-blink { +@keyframes ML__caret-blink { from, to { opacity: 1; @@ -95,16 +95,6 @@ } } -@keyframes ML__caret-blink { - from, - to { - border-color: var(--caret); - } - 50% { - border-color: transparent; - } -} - /* Style for the invisible textarea element which is used to capture keyboard events. We're just trying really hard to make sure it doesn't show. */ diff --git a/css/mathlive.less b/css/mathlive.less index 2cb3bac33..4f67eaa83 100755 --- a/css/mathlive.less +++ b/css/mathlive.less @@ -1,35 +1,36 @@ -@import "__fonts.less"; +@import '__fonts.less'; -@monospace: 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', - 'DejaVu Sans Mono', Monaco, Courier, monospace; -@system: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", - "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", - "Droid Sans", "Helvetica Neue", sans-serif; +@monospace: 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, + 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace; +@system: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', + 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + sans-serif; @math_main: KaTeX_Main; @math_math: KaTeX_Math; @font-face { font-family: KaTeX_Main; - src: url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"); + src: url(fonts/KaTeX_Main-Regular.woff2) format('woff2'), + url(fonts/KaTeX_Main-Regular.woff) format('woff'); font-weight: 400; font-style: normal; - font-display: "swap"; + font-display: 'swap'; } @font-face { font-family: KaTeX_Math; - src: url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"); + src: url(fonts/KaTeX_Math-Italic.woff2) format('woff2'), + url(fonts/KaTeX_Math-Italic.woff) format('woff'); font-weight: 400; font-style: italic; - font-display: "swap"; + font-display: 'swap'; } - -@shadow1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); -@shadow2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); -@shadow3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); -@shadow4: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22); -@shadow5: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22); +@shadow1: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); +@shadow2: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); +@shadow3: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); +@shadow4: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); +@shadow5: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22); // 0 8px 10px 1px rgba(0, 0, 0, .14), // 0 3px 14px 2px rgba(0, 0, 0, .12), @@ -44,7 +45,6 @@ @secondary: #cd0030; // @highlight: rgba(243, 243, 21, 0.28); - // The mu (mathematical unit) is defined by TeX as 1/18 em @mu: 1/18em; @@ -65,7 +65,7 @@ by default, so the font-style below is only useful when a fallback font is used */ - font-style: italic; + font-style: italic; } .ML__mathrm { @@ -118,39 +118,80 @@ font-style: italic; } -.ML__series_ul { font-weight: 100; } -.ML__series_el { font-weight: 100; } -.ML__series_l { font-weight: 200; } -.ML__series_sl { font-weight: 300; } - -.ML__series_sb { font-weight: 500; } -.ML__bold { font-weight: 700; } -.ML__series_eb { font-weight: 800; } -.ML__series_ub { font-weight: 900; } - -.ML__series_uc { font-stretch: ultra-condensed; } -.ML__series_ec { font-stretch: extra-condensed; } -.ML__series_c { font-stretch: condensed; } -.ML__series_sc { font-stretch: semi-condensed; } -.ML__series_sx { font-stretch: semi-expanded; } -.ML__series_x { font-stretch: expanded; } -.ML__series_ex { font-stretch: extra-expanded; } -.ML__series_ux { font-stretch: ultra-expanded; } +.ML__series_ul { + font-weight: 100; +} +.ML__series_el { + font-weight: 100; +} +.ML__series_l { + font-weight: 200; +} +.ML__series_sl { + font-weight: 300; +} +.ML__series_sb { + font-weight: 500; +} +.ML__bold { + font-weight: 700; +} +.ML__series_eb { + font-weight: 800; +} +.ML__series_ub { + font-weight: 900; +} -.ML__it { font-style: italic; } -.ML__shape_ol { -webkit-text-stroke: 1px black; text-stroke: 1px black; color: transparent; } -.ML__shape_sc { font-variant: small-caps; } -.ML__shape_sl { font-style: oblique; } +.ML__series_uc { + font-stretch: ultra-condensed; +} +.ML__series_ec { + font-stretch: extra-condensed; +} +.ML__series_c { + font-stretch: condensed; +} +.ML__series_sc { + font-stretch: semi-condensed; +} +.ML__series_sx { + font-stretch: semi-expanded; +} +.ML__series_x { + font-stretch: expanded; +} +.ML__series_ex { + font-stretch: extra-expanded; +} +.ML__series_ux { + font-stretch: ultra-expanded; +} +.ML__it { + font-style: italic; +} +.ML__shape_ol { + -webkit-text-stroke: 1px black; + text-stroke: 1px black; + color: transparent; +} +.ML__shape_sc { + font-variant: small-caps; +} +.ML__shape_sl { + font-style: oblique; +} /* First level emphasis */ -.ML__emph { color: #bc2612; } +.ML__emph { + color: #bc2612; +} /* Second level emphasis */ -.ML__emph .ML__emph{ color: #0c7f99; } - - - +.ML__emph .ML__emph { + color: #0c7f99; +} .ML__mathlive { // Style used to highlight a portion of the expression when speaking @@ -158,29 +199,39 @@ // See https://www.w3.org/WAI/RD/2012/text-customization/r11 // and https://www.cs.cmu.edu/~jbigham/pubs/pdfs/2017/colors.pdf .highlight { - color: #007CB2; // Complementary to peach - background: #edd1b0; // Peach + color: #007cb2; // Complementary to peach + background: #edd1b0; // Peach } // This value is also used in fontMetrics.js, if you change it make sure the // values match. - @ptperem: 10.0; + @ptperem: 10; @nulldelimiterspace: 1.2em / @ptperem; - @thinspace: 0.16667em; // 3mu - @mediumspace: 0.22222em; // 4mu - @thickspace: 0.27778em; // 5mu - + @thinspace: 0.16667em; // 3mu + @mediumspace: 0.22222em; // 4mu + @thickspace: 0.27778em; // 5mu + .reset-textstyle.scriptstyle { + font-size: 0.7em; + } + .reset-textstyle.scriptscriptstyle { + font-size: 0.5em; + } - .reset-textstyle.scriptstyle { font-size: 0.7em; } - .reset-textstyle.scriptscriptstyle { font-size: 0.5em; } - - .reset-scriptstyle.textstyle { font-size: 1.42857em; } - .reset-scriptstyle.scriptscriptstyle { font-size: 0.71429em; } + .reset-scriptstyle.textstyle { + font-size: 1.42857em; + } + .reset-scriptstyle.scriptscriptstyle { + font-size: 0.71429em; + } - .reset-scriptscriptstyle.textstyle { font-size: 2em; } - .reset-scriptscriptstyle.scriptstyle { font-size: 1.4em; } + .reset-scriptscriptstyle.textstyle { + font-size: 2em; + } + .reset-scriptscriptstyle.scriptstyle { + font-size: 1.4em; + } .style-wrap { position: relative; } @@ -210,12 +261,12 @@ .mfrac { // line-height: 0; - > span { + > span { // justify-content: center; text-align: center; } - .frac-line { + .frac-line { width: 100%; // &:before { @@ -226,13 +277,13 @@ // } &:after { - content: ""; + content: ''; display: block; margin-top: -0.04em; border-bottom-style: solid; - border-bottom-width: 0.04em; - min-height: 0.04em; - /* There's a bug since Chrome 62 where + border-bottom-width: 0.04em; + min-height: 0.04em; + /* There's a bug since Chrome 62 where sub-pixel border lines don't draw at some zoom levels (110%, 90%). Setting the min-height seems to work around it. */ @@ -285,7 +336,7 @@ margin-right: 2em; } } - + .mspace { display: inline-block; @@ -369,18 +420,18 @@ &:before { border-bottom-style: solid; border-bottom-width: 0.04em; - content: ""; + content: ''; display: block; } &:after { border-bottom-style: solid; - border-bottom-width: 0.04em; - min-height: thin; /* There's a bug since Chrome 62 where + border-bottom-width: 0.04em; + min-height: thin; /* There's a bug since Chrome 62 where sub-pixel border lines don't draw at some zoom levels (110%, 90%). Setting the min-height seems to work around it. */ - content: ""; + content: ''; display: block; margin-top: -1px; } @@ -400,12 +451,12 @@ width: 100%; &:before { - content: ""; + content: ''; display: block; margin-top: -0.04em; border-bottom-style: solid; - border-bottom-width: .04em; - min-height: 0.5px; + border-bottom-width: 0.04em; + min-height: 0.5px; /* There's a bug since Chrome 62 where sub-pixel border lines don't draw at some zoom levels (110%, 90%). Setting the min-height seems to work around it. @@ -414,7 +465,7 @@ &:after { border-bottom-width: 1px; - content: " "; + content: ' '; display: block; margin-top: -0.1em; } @@ -423,19 +474,20 @@ > .root { // These values are taken from the definition of `\r@@t`, // `\mkern 5mu` and `\mkern -10mu`. - margin-left: 5*(@mu); - margin-right: -10*(@mu); + margin-left: 5 * (@mu); + margin-right: -10 * (@mu); } } - .sizing, .fontsize-ensurer { + .sizing, + .fontsize-ensurer { display: inline-block; @size1: 0.5; @size2: 0.7; @size3: 0.8; @size4: 0.9; - @size5: 1.0; + @size5: 1; @size6: 1.2; @size7: 1.44; @size8: 1.73; @@ -444,8 +496,8 @@ .generate-size-change(@from, @to) { &.reset-size@{from}.size@{to} { - @sizeFromVariable: ~"size@{from}"; - @sizeToVariable: ~"size@{to}"; + @sizeFromVariable: ~'size@{from}'; + @sizeToVariable: ~'size@{to}'; font-size: (@@sizeToVariable / @@sizeFromVariable) * 1em; } } @@ -466,10 +518,18 @@ } .delimsizing { - &.size1 { font-family: KaTeX_Size1; } - &.size2 { font-family: KaTeX_Size2; } - &.size3 { font-family: KaTeX_Size3; } - &.size4 { font-family: KaTeX_Size4; } + &.size1 { + font-family: KaTeX_Size1; + } + &.size2 { + font-family: KaTeX_Size2; + } + &.size3 { + font-family: KaTeX_Size3; + } + &.size4 { + font-family: KaTeX_Size4; + } &.mult { .delim-size1 > span { @@ -532,7 +592,7 @@ display: inline-block; } - .col-align-c > .vlist { + .col-align-c > .vlist { text-align: center; } @@ -540,17 +600,16 @@ text-align: left; } - .col-align-r > .vlist{ + .col-align-r > .vlist { text-align: right; } } } .ML__smart-fence__close { - opacity: .5; + opacity: 0.5; } - .ML__selection { background: var(--highlight-inactive); box-sizing: border-box; @@ -562,7 +621,14 @@ // display:inline-block; } - +.ML__contains-caret.ML__close, +.ML__contains-caret.ML__open, +.ML__contains-caret > .ML__close, +.ML__contains-caret > .ML__open, +.sqrt.ML__contains-caret > .sqrt-sign, +.sqrt.ML__contains-caret > .vlist > span > .sqrt-line { + color: var(--caret); +} .ML__command { font-family: @monospace; @@ -572,21 +638,18 @@ color: var(--primary); } - - :not(.ML__command) + .ML__command { - margin-left: .25em; + margin-left: 0.25em; } -.ML__command + :not(.ML__command) { - padding-left: .25em; +.ML__command + :not(.ML__command) { + padding-left: 0.25em; } - /* When using smartFence, the anticipated closing fence is displayed with this style */ .ML__smart-fence__close { - opacity: .5; + opacity: 0.5; } /* The element that displays the keys as the user type them */ @@ -596,7 +659,7 @@ with this style */ /*background-color: rgba(97, 97, 200, .95);*/ background: var(--secondary); border-color: var(--secondary-border); - box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); + box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); text-align: center; border-radius: 6px; padding: 16px; @@ -613,14 +676,14 @@ with this style */ --keystroke-border: #f7f7f7; } @media (prefers-color-scheme: dark) { - body:not([theme="light"]) .ML__keystroke-caption { + body:not([theme='light']) .ML__keystroke-caption { --keystroke: hsl(var(--hue), 50%, 30%); --on-keystroke: hsl(0, 0%, 98%); --keystroke-border: hsl(var(--hue), 50%, 25%); } } -body[theme="dark"] .ML__keystroke-caption { +body[theme='dark'] .ML__keystroke-caption { --keystroke: hsl(var(--hue), 50%, 30%); --on-keystroke: hsl(0, 0%, 98%); --keystroke-border: hsl(var(--hue), 50%, 25%); @@ -642,7 +705,7 @@ body[theme="dark"] .ML__keystroke-caption { position: absolute; visibility: hidden; content: attr(data-tooltip); - + display: inline-table; top: 110%; @@ -651,12 +714,13 @@ body[theme="dark"] .ML__keystroke-caption { width: max-content; max-width: 200px; padding: 8px 8px; - background: #616161; // Grey 700 + background: #616161; // Grey 700 color: #fff; text-align: center; z-index: 2; - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), + 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); border-radius: 2px; font-family: @system; @@ -664,7 +728,7 @@ body[theme="dark"] .ML__keystroke-caption { font-size: 12px; /* Phone */ - @media only screen and (max-width : 767px) { + @media only screen and (max-width: 767px) { height: 32px; padding: 4px 16px; font-size: 14px; @@ -673,18 +737,17 @@ body[theme="dark"] .ML__keystroke-caption { opacity: 0; transform: scale(0.5); // animation: .150s tooltipFadeOut cubic-bezier(0.4, 0.0, 1, 1) forwards; - transition: all .150s cubic-bezier(0.4, 0.0, 1, 1); - + transition: all 0.15s cubic-bezier(0.4, 0, 1, 1); } } [data-tooltip]:hover { position: relative; &::after { - visibility: visible; // Visible triggers the animation... - opacity: 1; // ... but we start fully transparent to - // give ourselves a delay before showing - transform: scale(1); + visibility: visible; // Visible triggers the animation... + opacity: 1; // ... but we start fully transparent to + // give ourselves a delay before showing + transform: scale(1); } } @@ -697,7 +760,6 @@ body[theme="dark"] .ML__keystroke-caption { transition-delay: 1s; /* attr(data-delay); Should work. But doesn't. */ } - // @keyframes tooltipFadeIn { // 0% { // opacity: 0; @@ -731,17 +793,15 @@ body[theme="dark"] .ML__keystroke-caption { // } // } - -.can-redo [data-command="\"redo\""] { +.can-redo [data-command='"redo"'] { opacity: 1 !important; } -.can-undo [data-command="\"undo\""] { +.can-undo [data-command='"undo"'] { opacity: 1 !important; } - .ML__keyboard { - --keyboard-background: rgba(209, 213, 217, .95); + --keyboard-background: rgba(209, 213, 217, 0.95); --keyboard-text: #000; --keyboard-text-active: var(--primary); --keyboard-background-border: #ddd; @@ -757,7 +817,6 @@ body[theme="dark"] .ML__keystroke-caption { --keycap-modifier-border: #c5c9d0; --keycap-modifier-border-bottom: #989da6; - --keyboard-alternate-background: #fff; --keyboard-alternate-background-active: #e5e5e5; --keyboard-alternate-text: #000; @@ -770,18 +829,23 @@ body[theme="dark"] .ML__keystroke-caption { padding-top: 5px; - transform: translate(0, 0); + transform: translate(0, 0); opacity: 0; visibility: hidden; // To make the keyboard visible, add the .is-visible class // This will slide in and fade in the keyboard - transition: .28s cubic-bezier(0.0, 0.0, 0.2, 1); // Deceleration curve + transition: 0.28s cubic-bezier(0, 0, 0.2, 1); // Deceleration curve transition-property: transform, opacity; &.is-visible { - transform: translate(0, -267px); + transform: translate(0, -267px); opacity: 1; visibility: visible; - transition-timing-function: cubic-bezier(0.4, 0.0, 1, 1); // Acceleration curve + transition-timing-function: cubic-bezier( + 0.4, + 0, + 1, + 1 + ); // Acceleration curve } backdrop-filter: grayscale(50%); @@ -803,10 +867,12 @@ body[theme="dark"] .ML__keystroke-caption { box-shadow: @shadow2; .tex { - font-family: @math_main, "Cambria Math", "Asana Math", OpenSymbol, Symbola, STIX, Times, serif !important; + font-family: @math_main, 'Cambria Math', 'Asana Math', OpenSymbol, + Symbola, STIX, Times, serif !important; } .tex-math { - font-family: @math_math, "Cambria Math", "Asana Math", OpenSymbol, Symbola, STIX, Times, serif !important; + font-family: @math_math, 'Cambria Math', 'Asana Math', OpenSymbol, + Symbola, STIX, Times, serif !important; } .tt { font-family: @monospace !important; @@ -818,7 +884,8 @@ body[theme="dark"] .ML__keystroke-caption { &.alternate-keys { visibility: hidden; max-width: 286px; - @media only screen and (max-height : 412px) { // 412 is the height of the Google Pixel in landscape mode + @media only screen and (max-height: 412px) { + // 412 is the height of the Google Pixel in landscape mode max-width: 320px; } @@ -826,17 +893,17 @@ body[theme="dark"] .ML__keystroke-caption { text-align: center; border-radius: 6px; position: fixed; - bottom: auto; // Override the value from ML__keyboard - top: 0; // " - box-sizing: content-box; // " - transform: none; // " - z-index: 106; // Above the keyboard (105) - + bottom: auto; // Override the value from ML__keyboard + top: 0; // " + box-sizing: content-box; // " + transform: none; // " + z-index: 106; // Above the keyboard (105) + display: flex; flex-direction: row; justify-content: center; align-content: center; - + box-shadow: @shadow4; transition: none; @@ -851,17 +918,18 @@ body[theme="dark"] .ML__keystroke-caption { display: flex; flex-flow: row wrap-reverse; justify-content: center; - & > li { // Alternate Keys + & > li { + // Alternate Keys display: flex; flex-flow: column; align-items: center; justify-content: center; font-size: 30px; - + height: 70px; width: 70px; - @media only screen and (max-height : 412px) { + @media only screen and (max-height: 412px) { font-size: 24px; height: 50px; width: 50px; @@ -874,7 +942,9 @@ body[theme="dark"] .ML__keystroke-caption { pointer-events: all; color: var(--keyboard-alternate-text); fill: currentColor; - &:hover, &.pressed, &.active { + &:hover, + &.pressed, + &.active { box-shadow: @shadow3; background: var(--keyboard-alternate-background-active); color: var(--keyboard-text-active); @@ -891,8 +961,9 @@ body[theme="dark"] .ML__keystroke-caption { background: var(--keyboard-alternate-background-active); } } - &.box > div, &.box > span { - border: 1px dashed rgba(0, 0, 0, .24); + &.box > div, + &.box > span { + border: 1px dashed rgba(0, 0, 0, 0.24); } // Use to display warning icons, with a SVG icon .warning { @@ -905,29 +976,30 @@ body[theme="dark"] .ML__keystroke-caption { align-items: center; justify-content: center; border-radius: 5px; - &:hover, &.pressed, &.active { + &:hover, + &.pressed, + &.active { background: red; } svg { width: 50px; height: 50px; } - } + } aside { font-size: 12px; line-height: 12px; - opacity: .78; + opacity: 0.78; } } } } - & > div.keyboard-layer { display: none; outline: none; - &.is-visible { - display: flex; + &.is-visible { + display: flex; flex-flow: column; } } @@ -936,23 +1008,23 @@ body[theme="dark"] .ML__keystroke-caption { display: flex; flex-flow: row; justify-content: space-between; - width: 736px; // Desktop + width: 736px; // Desktop /* Tablet */ - @media only screen and (min-width : 768px) and (max-width : 1024px) { + @media only screen and (min-width: 768px) and (max-width: 1024px) { width: 556px; } /* Phone */ - @media only screen and (max-width : 767px) { + @media only screen and (max-width: 767px) { width: 365px; - max-width: 100vw; // iPhone 5 is 320px + max-width: 100vw; // iPhone 5 is 320px } - + /* Icons for undo/redo, etc. */ svg { height: 20px; width: 20px; } - @media only screen and (max-width : 767px) { + @media only screen and (max-width: 767px) { svg { height: 13px; width: 17px; @@ -992,23 +1064,28 @@ body[theme="dark"] .ML__keystroke-caption { box-shadow: none; border-bottom: 2px solid transparent; - &.disabled svg, &.disabled:hover svg, &.disabled.pressed svg { + &.disabled svg, + &.disabled:hover svg, + &.disabled.pressed svg { color: var(--keyboard-text); - opacity: .2; + opacity: 0.2; } /* iPhone 5 */ - @media only screen and (max-width : 414px) { + @media only screen and (max-width: 414px) { font-size: 100%; padding: 0 6px 0 0; } /* Phone */ - @media only screen and (max-width : 767px) { + @media only screen and (max-width: 767px) { padding-left: 4px; padding-right: 4px; font-size: 90%; } - &:hover, &:active, &.pressed, &.active { + &:hover, + &:active, + &.pressed, + &.active { color: var(--keyboard-text-active); } &.selected { @@ -1035,8 +1112,6 @@ body[theme="dark"] .ML__keystroke-caption { margin: 0 0 3px 0; padding: 0; - - & > li { /* Key widths. A standard key is 10 units wide (w10) */ /* The formula for wn = n * w10 / 10 + (n -1) * margin-right */ @@ -1068,8 +1143,12 @@ body[theme="dark"] .ML__keystroke-caption { margin-right: 0; } - &.small {font-size: 16px;} - &.tt {color: var(--keyboard-text-active);} + &.small { + font-size: 16px; + } + &.tt { + color: var(--keyboard-text-active); + } /* For the alignment of the text on some modifiers (e.g. shift) */ &.bottom { @@ -1084,7 +1163,10 @@ body[theme="dark"] .ML__keystroke-caption { padding-right: 4px; } - svg {width: 20px; height: 20px;} + svg { + width: 20px; + height: 20px; + } // Use to display warning icons, with a SVG icon .warning { height: 25px; @@ -1103,7 +1185,7 @@ body[theme="dark"] .ML__keystroke-caption { width: 16px; height: 16px; } - @media only screen and (max-width : 768px) { + @media only screen and (max-width: 768px) { height: 16px; width: 16px; min-height: 16px; @@ -1113,12 +1195,22 @@ body[theme="dark"] .ML__keystroke-caption { height: 14px; } } - } - & > .w0 {width: 0;} - & > .w5 {width: 16px;} - & > .w15 {width: 52px;} - & > .w20 {width: 70px;} - & > .w50 {width: 178px;} + } + & > .w0 { + width: 0; + } + & > .w5 { + width: 16px; + } + & > .w15 { + width: 52px; + } + & > .w20 { + width: 70px; + } + & > .w50 { + width: 178px; + } /* Extra spacing between two adjacent keys */ &.separator { background: transparent; @@ -1127,36 +1219,43 @@ body[theme="dark"] .ML__keystroke-caption { } // Only show if there's extra room (up to four more columns) - @media only screen and (max-width : 560px) { + @media only screen and (max-width: 560px) { &.if-wide { display: none; } } - &.tex-math {font-size: 25px;} + &.tex-math { + font-size: 25px; + } // &.tt {font-size: 30px;} - &:hover, &.pressed { + &:hover, + &.pressed { // box-shadow: inset 0 0 1px 1px #8d8f92; background: var(--keycap-background-active); color: var(--keyboard-text-active); } - &.keycap:active, &.keycap.active, &.action:active, &.action.active { + &.keycap:active, + &.keycap.active, + &.action:active, + &.action.active { transform: translateY(-20px) scale(1.4, 1.4); z-index: 100; color: var(--keyboard-text-active); } - &.modifier:active, &.modifier.active { + &.modifier:active, + &.modifier.active { background: var(--keyboard-text-active); color: var(--keycap-text-active); } - &.action.font-glyph, &.modifier.font-glyph { + &.action.font-glyph, + &.modifier.font-glyph { font-size: 18px; - @media only screen and (max-width : 767px) { + @media only screen and (max-width: 767px) { font-size: 16px; } } - // Waves effect position: relative; overflow: hidden; @@ -1164,8 +1263,9 @@ body[theme="dark"] .ML__keystroke-caption { -webkit-tap-highlight-color: transparent; // z-index: 1; // transition: .14s cubic-bezier(.4, 0, .2, 1); - &.fnbutton, &.bigfnbutton { - @media only screen and (max-width : 767px) { + &.fnbutton, + &.bigfnbutton { + @media only screen and (max-width: 767px) { font-size: 12px; } // width: 60px; @@ -1173,20 +1273,25 @@ body[theme="dark"] .ML__keystroke-caption { } &.bigfnbutton { font-size: 14px; - @media only screen and (max-width : 767px) { + @media only screen and (max-width: 767px) { font-size: 9px; } } - &.modifier, &.action { + &.modifier, + &.action { background-color: var(--keycap-modifier-background); border-color: var(--keycap-modifier-border); border-bottom-color: var(--keycap-modifier-border-bottom); font-size: 65%; font-weight: 100; } - &.modifier.selected, &.action.selected { + &.modifier.selected, + &.action.selected { color: var(--keyboard-text-active); - &:hover, &:active, &.pressed, &.active { + &:hover, + &:active, + &.pressed, + &.active { color: white; } } @@ -1194,12 +1299,12 @@ body[theme="dark"] .ML__keystroke-caption { font-size: 80%; padding-top: 10px; font-weight: 100; - } + } small { color: #555; - @media only screen and (max-width : 767px) { + @media only screen and (max-width: 767px) { font-size: 9px; - } + } } aside { font-family: @system; @@ -1207,86 +1312,118 @@ body[theme="dark"] .ML__keystroke-caption { line-height: 10px; color: #666; /* On small screens, don't display */ - @media only screen and (max-width : 767px) { + @media only screen and (max-width: 767px) { display: none; } } - } - + } } /* iPhone 5 */ - @media only screen and (max-width : 414px) { - & > ul { + @media only screen and (max-width: 414px) { + & > ul { & > li { width: 29px; margin-right: 2px; } - & > .w5 { width: 13.5px; } - & > .w15 { width: 44.5px; } - & > .w20 { width: 60px; } - & > .w50 { width: 153px; } + & > .w5 { + width: 13.5px; + } + & > .w15 { + width: 44.5px; + } + & > .w20 { + width: 60px; + } + & > .w50 { + width: 153px; + } } } /* Pixel, iPhone 6,7,8+ */ - @media only screen and (min-width : 415px) and (max-width : 768px) { - & > ul { + @media only screen and (min-width: 415px) and (max-width: 768px) { + & > ul { & > li { width: 37px; margin-right: 3px; } - & > .w5 { width: 17px; } - & > .w15 { width: 57px; } - & > .w20 { width: 77px; } - & > .w50 { width: 197px; } + & > .w5 { + width: 17px; + } + & > .w15 { + width: 57px; + } + & > .w20 { + width: 77px; + } + & > .w50 { + width: 197px; + } } } /* Tablet size */ - @media only screen and (min-width : 768px) and (max-width : 1024px) { - & > ul { - height: 52px; + @media only screen and (min-width: 768px) and (max-width: 1024px) { + & > ul { + height: 52px; & > li { height: 52px; width: 51px; margin-right: 4px; } - & > .w5 { width: 23.5px; } - & > .w15 { width: 78.5px; } - & > .w20 { width: 106px; } - & > .w50 { width: 271px; } + & > .w5 { + width: 23.5px; + } + & > .w15 { + width: 78.5px; + } + & > .w20 { + width: 106px; + } + & > .w50 { + width: 271px; + } } } /* Desktop size */ - @media only screen and (min-width : 1025px) { - & > ul { - height: 52px; + @media only screen and (min-width: 1025px) { + & > ul { + height: 52px; & > li { height: 52px; width: 66px; margin-right: 6px; } - & > .modifier, & > .action { + & > .modifier, + & > .action { font-size: 80%; } - & > .w5 { width: 30px; } - & > .w15 { width: 102px; } - & > .w20 { width: 138px; } - & > .w50 { width: 354px; } + & > .w5 { + width: 30px; + } + & > .w15 { + width: 102px; + } + & > .w20 { + width: 138px; + } + & > .w50 { + width: 354px; + } } } } } @media (prefers-color-scheme: dark) { - body:not([theme="light"]) .ML__keyboard { + body:not([theme='light']) .ML__keyboard { --hue: 206; - --keyboard-background: hsl(var(--hue),19%,38%); + --keyboard-background: hsl(var(--hue), 19%, 38%); --keyboard-text: #f0f0f0; --keyboard-text-active: hsl(var(--hue), 100%, 60%); - --keyboard-background-border: hsl(0,0%,20%); + --keyboard-background-border: hsl(0, 0%, 20%); --keycap-background: hsl(var(--hue), 25%, 39%); --keycap-background-active: hsl(var(--hue), 35%, 42%); --keycap-background-border: hsl(var(--hue), 25%, 35%); --keycap-background-border-bottom: hsl(206, 35%, 40%); - --keycap-text: hsl(0,0%,81.6%); + --keycap-text: hsl(0, 0%, 81.6%); --keycap-text-active: #000; --keycap-secondary-text: #fff; @@ -1294,39 +1431,38 @@ body[theme="dark"] .ML__keystroke-caption { --keycap-modifier-border: hsl(var(--hue), 35%, 35%); --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); - --keyboard-alternate-background: hsl(var(--hue),19%,38%); - --keyboard-alternate-background-active: hsl(var(--hue),35%,42%); - --keyboard-alternate-text: hsl(0,0%,82%); + --keyboard-alternate-background: hsl(var(--hue), 19%, 38%); + --keyboard-alternate-background-active: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-text: hsl(0, 0%, 82%); } } - /* Same as the media query, but with a class */ - body[theme="dark"] .ML__keyboard { - --hue: 206; - --keyboard-background: hsl(var(--hue),19%,38%); - --keyboard-text: #f0f0f0; - --keyboard-text-active: hsl(var(--hue), 100%, 60%); - --keyboard-background-border: hsl(0,0%,20%); - --keycap-background: hsl(var(--hue), 25%, 39%); - --keycap-background-active: hsl(var(--hue), 35%, 42%); - --keycap-background-border: hsl(var(--hue), 25%, 35%); - --keycap-background-border-bottom: hsl(206, 35%, 40%); - --keycap-text: hsl(0,0%,81.6%); - --keycap-text-active: #000; - --keycap-secondary-text: #fff; - - --keycap-modifier-background: hsl(var(--hue), 35%, 40%); - --keycap-modifier-border: hsl(var(--hue), 35%, 35%); - --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); +/* Same as the media query, but with a class */ +body[theme='dark'] .ML__keyboard { + --hue: 206; + --keyboard-background: hsl(var(--hue), 19%, 38%); + --keyboard-text: #f0f0f0; + --keyboard-text-active: hsl(var(--hue), 100%, 60%); + --keyboard-background-border: hsl(0, 0%, 20%); + --keycap-background: hsl(var(--hue), 25%, 39%); + --keycap-background-active: hsl(var(--hue), 35%, 42%); + --keycap-background-border: hsl(var(--hue), 25%, 35%); + --keycap-background-border-bottom: hsl(206, 35%, 40%); + --keycap-text: hsl(0, 0%, 81.6%); + --keycap-text-active: #000; + --keycap-secondary-text: #fff; - --keyboard-alternate-background: hsl(var(--hue),19%,38%); - --keyboard-alternate-background-active: hsl(var(--hue),35%,42%); - --keyboard-alternate-text: hsl(0,0%,82%);; - } + --keycap-modifier-background: hsl(var(--hue), 35%, 40%); + --keycap-modifier-border: hsl(var(--hue), 35%, 35%); + --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-background: hsl(var(--hue), 19%, 38%); + --keyboard-alternate-background-active: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-text: hsl(0, 0%, 82%); +} /* The 'material' theme for the virtual keyboard */ -div.ML__keyboard.material { - --keyboard-background: rgba(209, 213, 217, .9); +div.ML__keyboard.material { + --keyboard-background: rgba(209, 213, 217, 0.9); --keyboard-background-border: #ddd; --keycap-background: transparent; --keycap-background-active: #cccfd1; @@ -1343,7 +1479,10 @@ div.ML__keyboard.material { border-radius: 5px; box-shadow: @shadow4; - ul li:hover, ul li:active, ul li.active, ul li.pressed { + ul li:hover, + ul li:active, + ul li.active, + ul li.pressed { border: 1px solid transparent; background: @material-primary; color: white; @@ -1355,7 +1494,10 @@ div.ML__keyboard.material { & > div > div { font-size: 16px; } - div div:hover, div div:active, div.div.active, div.div.pressed { + div div:hover, + div div:active, + div.div.active, + div.div.pressed { color: @material-primary; fill: currentColor; } @@ -1372,7 +1514,7 @@ div.ML__keyboard.material { border: 1px solid transparent; border-radius: 5px; color: var(--keycap-text); - fill: currentColor; + fill: currentColor; &.tt { color: @material-primary; @@ -1386,7 +1528,10 @@ div.ML__keyboard.material { height: 20px; background: #e0e0e0; - &:hover, &:active, &.active, &.pressed { + &:hover, + &:active, + &.active, + &.pressed { background: #d0d0d0; box-shadow: none; transform: none; @@ -1397,13 +1542,13 @@ div.ML__keyboard.material { background: var(--keycap-background-active); box-shadow: none; } - &:not([data-key=' ']).pressed, + &:not([data-key=' ']).pressed, &:not([data-key=' ']).active, - &:not([data-key=' ']):active { + &:not([data-key=' ']):active { background: var(--keyboard-alternate-background); color: var(--keyboard-alternate-text); box-shadow: @shadow3; - @media only screen and (max-width : 767px) { + @media only screen and (max-width: 767px) { box-shadow: @shadow3; font-size: 10px; vertical-align: top; @@ -1417,19 +1562,20 @@ div.ML__keyboard.material { padding: 2px 0 0 0; z-index: 100; } - @media only screen and (max-width : 414px) { + @media only screen and (max-width: 414px) { width: 16.5px; } } - &:last-child:active, + &:last-child:active, &:last-child.active { - @media only screen and (max-width : 767px) { + @media only screen and (max-width: 767px) { margin-right: 0; margin-left: 14px; } } } - div div.rows ul li.modifier, div div.rows ul li.action { + div div.rows ul li.modifier, + div div.rows ul li.action { background: transparent; border: 0; color: #869096; @@ -1442,47 +1588,53 @@ div.ML__keyboard.material { border-radius: 0; border-bottom: 2px solid @material-primary; } - &:hover, &:active, &.active, &.pressed { + &:hover, + &:active, + &.active, + &.pressed { border: 0; color: var(--keycap-text); background: var(--keycap-background-active); box-shadow: none; } } - div div.rows ul li.fnbutton, div div.rows ul li.bigfnbutton { + div div.rows ul li.fnbutton, + div div.rows ul li.bigfnbutton { background: transparent; border: 0; // transition: .28s cubic-bezier(.4, 0, .2, 1); - &.selected, &.selected { + &.selected, + &.selected { color: @material-primary; fill: currentColor; border-radius: 0; border-bottom: 2px solid @material-primary; } - &:hover, &:active, &.pressed, &.active { + &:hover, + &:active, + &.pressed, + &.active { border: 0; color: @material-primary; fill: currentColor; background: var(--keycap-background-active); box-shadow: none; } - } -}; - +} @media (prefers-color-scheme: dark) { - body:not([theme="light"]) div.ML__keyboard.material { + body:not([theme='light']) div.ML__keyboard.material { --hue: 198; - --keyboard-background: hsl(var(--hue),19%,18%); + --keyboard-background: hsl(var(--hue), 19%, 18%); --keyboard-text: #d4d6d7; --keyboard-text-active: @material-primary; - --keyboard-background-border: hsl(0,0%,20%); + --keyboard-background-border: hsl(0, 0%, 20%); --keycap-background: hsl(var(--hue), 25%, 39%); --keycap-background-active: @material-primary; --keycap-background-border: transparent; --keycap-background-border-bottom: transparent; - --keycap-text: hsl(0,0%,81.6%); + --keycap-text: hsl(0, 0%, 81.6%); --keycap-text-active: #d4d6d7; --keycap-secondary-text: @material-primary; @@ -1490,23 +1642,22 @@ div.ML__keyboard.material { --keycap-modifier-border: hsl(var(--hue), 35%, 35%); --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); - - --keyboard-alternate-background: hsl(var(--hue),8%,2%); - --keyboard-alternate-background-active: hsl(var(--hue),35%,42%); - --keyboard-alternate-text: hsl(0,0%,82%); + --keyboard-alternate-background: hsl(var(--hue), 8%, 2%); + --keyboard-alternate-background-active: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-text: hsl(0, 0%, 82%); } } -body[theme="dark"] div.ML__keyboard.material { +body[theme='dark'] div.ML__keyboard.material { --hue: 198; - --keyboard-background: hsl(var(--hue),19%,18%); + --keyboard-background: hsl(var(--hue), 19%, 18%); --keyboard-text: #d4d6d7; --keyboard-text-active: @material-primary; - --keyboard-background-border: hsl(0,0%,20%); + --keyboard-background-border: hsl(0, 0%, 20%); --keycap-background: hsl(var(--hue), 25%, 39%); --keycap-background-active: @material-primary; --keycap-background-border: transparent; --keycap-background-border-bottom: transparent; - --keycap-text: hsl(0,0%,81.6%); + --keycap-text: hsl(0, 0%, 81.6%); --keycap-text-active: #d4d6d7; --keycap-secondary-text: @material-primary; @@ -1514,34 +1665,34 @@ body[theme="dark"] div.ML__keyboard.material { --keycap-modifier-border: hsl(var(--hue), 35%, 35%); --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); - - --keyboard-alternate-background: hsl(var(--hue),8%,2%); - --keyboard-alternate-background-active: hsl(var(--hue),35%,42%); - --keyboard-alternate-text: hsl(0,0%,82%); + --keyboard-alternate-background: hsl(var(--hue), 8%, 2%); + --keyboard-alternate-background-active: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-text: hsl(0, 0%, 82%); } - .ML__error { // Wavy pattern - background-image: radial-gradient(ellipse at center, - hsl(341,100%,40%),rgba(0,0,0,0) 70%); + background-image: radial-gradient( + ellipse at center, + hsl(341, 100%, 40%), + rgba(0, 0, 0, 0) 70% + ); background-repeat: repeat-x; background-size: 3px 3px; - background-position:0 98%; + background-position: 0 98%; } .ML__suggestion { - opacity: .50; + opacity: 0.5; } .ML__placeholder { - opacity: .7; - padding-left: .5ex; - padding-right: .5ex; + opacity: 0.7; + padding-left: 0.5ex; + padding-right: 0.5ex; } - .ML__keystroke-caption > span { min-width: 14px; /*height: 8px;*/ @@ -1564,10 +1715,8 @@ body[theme="dark"] div.ML__keyboard.material { // box-shadow: @shadow1; } - - .ML__virtual-keyboard-toggle.pressed { - background: hsla(0, 0%, 70%, .5); + background: hsla(0, 0%, 70%, 0.5); } .ML__virtual-keyboard-toggle:focus { @@ -1576,22 +1725,24 @@ body[theme="dark"] div.ML__keyboard.material { border: 2px solid var(--primary); } - -.ML__virtual-keyboard-toggle.active:hover, +.ML__virtual-keyboard-toggle.active:hover, .ML__virtual-keyboard-toggle.active { - background: hsla(0, 0%, 70%, .5); + background: hsla(0, 0%, 70%, 0.5); color: #000; fill: currentColor; } - div.ML__popover.is-visible { visibility: visible; - animation: ML__fade-in cubic-bezier(0.0, 0.0, 0.2, 1) .15s; + animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s; } @keyframes ML__fade-in { - from {opacity: 0;} - to {opacity:1 ;} + from { + opacity: 0; + } + to { + opacity: 1; + } } /* The wrapper class for the entire content of the popover panel */ @@ -1607,25 +1758,23 @@ div.ML__popover.is-visible { margin-left: 8px; margin-right: 8px; a { - color: #5Ea6Fd; - padding-top: .3em; - margin-top: .4em; + color: #5ea6fd; + padding-top: 0.3em; + margin-top: 0.4em; display: block; &:hover { - color: #5Ea6Fd; + color: #5ea6fd; text-decoration: underline; } } /* Since the content can be clicked on, provide feedback on hover */ - &:hover, + &:hover, &.pressed, &.active { - background: rgba(255, 255, 255, .1); + background: rgba(255, 255, 255, 0.1); } } - - /* The command inside a popover (inside a ML__popover-content) */ .ML__popover__command { font-size: 1.6rem; @@ -1633,7 +1782,7 @@ div.ML__popover.is-visible { .ML__popover__prev-shortcut { height: 31px; - opacity: .1; + opacity: 0.1; cursor: pointer; margin-left: 8px; @@ -1642,9 +1791,9 @@ div.ML__popover.is-visible { padding-bottom: 2px; } -.ML__popover__prev-shortcut:hover, -.ML__popover__next-shortcut:hover{ - opacity: .3; +.ML__popover__prev-shortcut:hover, +.ML__popover__next-shortcut:hover { + opacity: 0.3; } .ML__popover__prev-shortcut.pressed, @@ -1652,12 +1801,12 @@ div.ML__popover.is-visible { opacity: 1; } -.ML__popover__prev-shortcut.active, +.ML__popover__prev-shortcut.active, .ML__popover__next-shortcut.active { opacity: 1; } -.ML__popover__prev-shortcut > span, +.ML__popover__prev-shortcut > span, .ML__popover__next-shortcut > span { padding: 5px; border-radius: 50%; @@ -1676,15 +1825,14 @@ div.ML__popover.is-visible { display: block; } - -.ML__popover__prev-shortcut:hover > span, +.ML__popover__prev-shortcut:hover > span, .ML__popover__next-shortcut:hover > span { - background: rgba(255, 255, 255, .1); + background: rgba(255, 255, 255, 0.1); } .ML__popover__next-shortcut { height: 34px; - opacity: .1; + opacity: 0.1; cursor: pointer; margin-left: 8px; @@ -1696,30 +1844,30 @@ div.ML__popover.is-visible { /* The keyboard shortcuts for a symbol as displayed in the popover */ .ML__popover__shortcut { font-family: @system; - font-size: .8em; - opacity: .7; + font-size: 0.8em; + opacity: 0.7; - margin-top: .25em; - padding-top: .25em; + margin-top: 0.25em; + padding-top: 0.25em; } /* The field in a popover that provides some info about the symbol */ .ML__popover__note { font-family: @system; - font-size: .8rem; - opacity: .7; + font-size: 0.8rem; + opacity: 0.7; line-height: 1em; - padding-left: .5em; - padding-right: .5em; - padding-top: .25em; + padding-left: 0.5em; + padding-right: 0.5em; + padding-top: 0.25em; } /* Style for the character that joins the modifiers of a keyboard shortcut (usually a "+" sign)*/ .ML__shortcut-join { - opacity: .5; + opacity: 0.5; } /* Styling for an element which is overlaid diff --git a/src/core/mathAtom.js b/src/core/mathAtom.js index 95053a6df..96f438ffc 100644 --- a/src/core/mathAtom.js +++ b/src/core/mathAtom.js @@ -802,7 +802,8 @@ class MathAtom { this.leftDelim, innerHeight, innerDepth, - localContext + localContext, + 'ML__open' ) ) ); @@ -867,7 +868,7 @@ class MathAtom { innerHeight, innerDepth, localContext, - classes + (classes || '') + ' ML__close' ) ) ); @@ -1535,6 +1536,20 @@ class MathAtom { result.caret = this.caret; } } + if (this.containsCaret) { + if (Array.isArray(result)) { + // For a /mleft.../mright, tag the first and last atom in the + // list with the "ML__contains-caret" style (it's the open and + // closing fence, respectively) + result[0].classes = + (result[0].classes || '') + ' ML__contains-caret'; + result[result.length - 1].classes = + (result[result.length - 1].classes || '') + + ' ML__contains-caret'; + } else { + result.classes = (result.classes || '') + ' ML__contains-caret'; + } + } // Finally, attach any necessary superscript, subscripts if (!this.limits && (this.superscript || this.subscript)) { // If limits is set, the attachment of sup/sub was handled diff --git a/src/editor/editor-mathfield.js b/src/editor/editor-mathfield.js index f316459af..6a81ea8ec 100644 --- a/src/editor/editor-mathfield.js +++ b/src/editor/editor-mathfield.js @@ -2168,6 +2168,7 @@ class MathField { this.mathlist.forEach(a => { a.caret = ''; a.isSelected = false; + a.containsCaret = false; }); const hasFocus = this.$hasFocus(); if (this.mathlist.isCollapsed()) { @@ -2177,6 +2178,20 @@ class MathField { a.isSelected = true; }); } + + if (hasFocus) { + let ancestor = this.mathlist.ancestor(1); + let i = 1; + let done = false; + while (ancestor && !done) { + if (ancestor.type === 'surd' || ancestor.type === 'leftright') { + ancestor.containsCaret = true; + done = true; + } + i += 1; + ancestor = this.mathlist.ancestor(i); + } + } // // 4. Create spans corresponding to the updated mathlist // From 4ef57e309f52dfc0436e6ea0d44bb7f474e7dc20 Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Wed, 5 Feb 2020 15:11:16 -0800 Subject: [PATCH 10/28] Need for proper rendering --- examples/basic/index.esm.html | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/basic/index.esm.html b/examples/basic/index.esm.html index f9caf9b0d..753b66c31 100644 --- a/examples/basic/index.esm.html +++ b/examples/basic/index.esm.html @@ -1,3 +1,4 @@ + From c12631b2533998cfc9b068195b00435a7c810bf7 Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Wed, 5 Feb 2020 17:03:07 -0800 Subject: [PATCH 11/28] Feat: read-only mode (#339) --- dist/mathlive.core.css | 26 +- dist/mathlive.css | 2085 +++++++++++++++++++- dist/mathlive.d.ts | 2 + dist/mathlive.js | 610 +++--- dist/mathlive.mjs | 2 +- dist/src/core/mathAtom.js | 19 +- dist/src/editor/editor-editableMathlist.js | 2 +- dist/src/editor/editor-mathfield.js | 45 +- dist/src/editor/editor-virtualKeyboard.js | 58 +- docs/global.html | 25 + docs/tutorial-CONFIG.html | 3 + src/editor/editor-mathfield.js | 32 +- tutorials/CONFIG.md | 6 + 13 files changed, 2562 insertions(+), 353 deletions(-) diff --git a/dist/mathlive.core.css b/dist/mathlive.core.css index 99667cad6..23c4ba849 100644 --- a/dist/mathlive.core.css +++ b/dist/mathlive.core.css @@ -59,8 +59,8 @@ margin-right: -1ex; position: relative; color: var(--caret); - -webkit-animation: ML__caret-command-blink 1.05s step-end infinite forwards; - animation: ML__caret-command-blink 1.05s step-end infinite forwards; + -webkit-animation: ML__caret-blink 1.05s step-end infinite forwards; + animation: ML__caret-blink 1.05s step-end infinite forwards; } .ML__text { line-height: 1; @@ -69,7 +69,7 @@ .ML__focused .ML__text { background: hsla(var(--hue), 40%, 50%, 0.1); } -@-webkit-keyframes ML__caret-command-blink { +@-webkit-keyframes ML__caret-blink { 0%, to { opacity: 1; @@ -78,7 +78,7 @@ opacity: 0; } } -@keyframes ML__caret-command-blink { +@keyframes ML__caret-blink { 0%, to { opacity: 1; @@ -87,24 +87,6 @@ opacity: 0; } } -@-webkit-keyframes ML__caret-blink { - 0%, - to { - border-color: var(--caret); - } - 50% { - border-color: transparent; - } -} -@keyframes ML__caret-blink { - 0%, - to { - border-color: var(--caret); - } - 50% { - border-color: transparent; - } -} .ML__textarea__textarea { transform: scale(0); resize: none; diff --git a/dist/mathlive.css b/dist/mathlive.css index 41a8f1a11..4cd382404 100644 --- a/dist/mathlive.css +++ b/dist/mathlive.css @@ -1 +1,2084 @@ -@font-face{font-family:KaTeX_AMS;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff");font-weight:700;font-style:italic;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff");font-weight:400;font-style:italic;font-display:"swap"}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff");font-weight:700;font-style:italic;font-display:"swap"}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff");font-weight:400;font-style:italic;font-display:"swap"}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Script;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size1;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size2;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size3;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size4;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Typewriter;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff");font-weight:400;font-style:italic;font-display:"swap"}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.ML__mathit{font-family:KaTeX_Math;font-style:italic}.ML__mathrm{font-family:KaTeX_Main;font-style:normal}.ML__mathbf{font-family:KaTeX_Main;font-weight:700}.ML__mathbfit{font-family:KaTeX_Math;font-weight:700;font-style:italic}.ML__ams,.ML__bb{font-family:KaTeX_AMS}.ML__cal{font-family:KaTeX_Caligraphic}.ML__frak{font-family:KaTeX_Fraktur}.ML__tt{font-family:KaTeX_Typewriter}.ML__script{font-family:KaTeX_Script}.ML__sans{font-family:KaTeX_SansSerif}.ML__mainit{font-family:KaTeX_Main;font-style:italic}.ML__series_el,.ML__series_ul{font-weight:100}.ML__series_l{font-weight:200}.ML__series_sl{font-weight:300}.ML__series_sb{font-weight:500}.ML__bold{font-weight:700}.ML__series_eb{font-weight:800}.ML__series_ub{font-weight:900}.ML__series_uc{font-stretch:ultra-condensed}.ML__series_ec{font-stretch:extra-condensed}.ML__series_c{font-stretch:condensed}.ML__series_sc{font-stretch:semi-condensed}.ML__series_sx{font-stretch:semi-expanded}.ML__series_x{font-stretch:expanded}.ML__series_ex{font-stretch:extra-expanded}.ML__series_ux{font-stretch:ultra-expanded}.ML__it{font-style:italic}.ML__shape_ol{-webkit-text-stroke:1px #000;text-stroke:1px #000;color:transparent}.ML__shape_sc{font-variant:small-caps}.ML__shape_sl{font-style:oblique}.ML__emph{color:#bc2612}.ML__emph .ML__emph{color:#0c7f99}.ML__mathlive .highlight{color:#007cb2;background:#edd1b0}.ML__mathlive .reset-textstyle.scriptstyle{font-size:.7em}.ML__mathlive .reset-textstyle.scriptscriptstyle{font-size:.5em}.ML__mathlive .reset-scriptstyle.textstyle{font-size:1.42857em}.ML__mathlive .reset-scriptstyle.scriptscriptstyle{font-size:.71429em}.ML__mathlive .reset-scriptscriptstyle.textstyle{font-size:2em}.ML__mathlive .reset-scriptscriptstyle.scriptstyle{font-size:1.4em}.ML__mathlive .style-wrap{position:relative}.ML__mathlive .vlist{display:inline-block}.ML__mathlive .vlist>span{display:block;height:0;position:relative;line-height:0}.ML__mathlive .vlist>span>span{display:inline-block}.ML__mathlive .msubsup{text-align:left}.ML__mathlive .mfrac>span{text-align:center}.ML__mathlive .mfrac .frac-line{width:100%}.ML__mathlive .mfrac .frac-line:after{content:"";display:block;margin-top:-.04em;border-bottom-style:solid;border-bottom-width:.04em;min-height:.04em}.ML__mathlive .rspace.negativethinspace{margin-right:-.16667em}.ML__mathlive .rspace.thinspace{margin-right:.16667em}.ML__mathlive .rspace.negativemediumspace{margin-right:-.22222em}.ML__mathlive .rspace.mediumspace{margin-right:.22222em}.ML__mathlive .rspace.thickspace{margin-right:.27778em}.ML__mathlive .rspace.sixmuspace{margin-right:.333333em}.ML__mathlive .rspace.eightmuspace{margin-right:.444444em}.ML__mathlive .rspace.enspace{margin-right:.5em}.ML__mathlive .rspace.twelvemuspace{margin-right:.666667em}.ML__mathlive .rspace.quad{margin-right:1em}.ML__mathlive .rspace.qquad{margin-right:2em}.ML__mathlive .mspace{display:inline-block}.ML__mathlive .mspace.negativethinspace{margin-left:-.16667em}.ML__mathlive .mspace.thinspace{width:.16667em}.ML__mathlive .mspace.negativemediumspace{margin-left:-.22222em}.ML__mathlive .mspace.mediumspace{width:.22222em}.ML__mathlive .mspace.thickspace{width:.27778em}.ML__mathlive .mspace.sixmuspace{width:.333333em}.ML__mathlive .mspace.eightmuspace{width:.444444em}.ML__mathlive .mspace.enspace{width:.5em}.ML__mathlive .mspace.twelvemuspace{width:.666667em}.ML__mathlive .mspace.quad{width:1em}.ML__mathlive .mspace.qquad{width:2em}.ML__mathlive .llap,.ML__mathlive .rlap{width:0;position:relative}.ML__mathlive .llap>.inner,.ML__mathlive .rlap>.inner{position:absolute}.ML__mathlive .llap>.fix,.ML__mathlive .rlap>.fix{display:inline-block}.ML__mathlive .llap>.inner{right:0}.ML__mathlive .rlap>.inner{left:0}.ML__mathlive .rule{display:inline-block;border:0 solid;position:relative}.ML__mathlive .overline .overline-line,.ML__mathlive .underline .underline-line{width:100%}.ML__mathlive .overline .overline-line:before,.ML__mathlive .underline .underline-line:before{border-bottom-style:solid;border-bottom-width:.04em;content:"";display:block}.ML__mathlive .overline .overline-line:after,.ML__mathlive .underline .underline-line:after{border-bottom-style:solid;border-bottom-width:.04em;min-height:thin;content:"";display:block;margin-top:-1px}.ML__mathlive .sqrt{display:inline-block}.ML__mathlive .sqrt>.sqrt-sign{font-family:KaTeX_Main;position:relative}.ML__mathlive .sqrt .sqrt-line{height:.04em;width:100%}.ML__mathlive .sqrt .sqrt-line:before{content:"";display:block;margin-top:-.04em;border-bottom-style:solid;border-bottom-width:.04em;min-height:.5px}.ML__mathlive .sqrt .sqrt-line:after{border-bottom-width:1px;content:" ";display:block;margin-top:-.1em}.ML__mathlive .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.ML__mathlive .fontsize-ensurer,.ML__mathlive .sizing{display:inline-block}.ML__mathlive .fontsize-ensurer.reset-size1.size1,.ML__mathlive .sizing.reset-size1.size1{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size1.size2,.ML__mathlive .sizing.reset-size1.size2{font-size:1.4em}.ML__mathlive .fontsize-ensurer.reset-size1.size3,.ML__mathlive .sizing.reset-size1.size3{font-size:1.6em}.ML__mathlive .fontsize-ensurer.reset-size1.size4,.ML__mathlive .sizing.reset-size1.size4{font-size:1.8em}.ML__mathlive .fontsize-ensurer.reset-size1.size5,.ML__mathlive .sizing.reset-size1.size5{font-size:2em}.ML__mathlive .fontsize-ensurer.reset-size1.size6,.ML__mathlive .sizing.reset-size1.size6{font-size:2.4em}.ML__mathlive .fontsize-ensurer.reset-size1.size7,.ML__mathlive .sizing.reset-size1.size7{font-size:2.88em}.ML__mathlive .fontsize-ensurer.reset-size1.size8,.ML__mathlive .sizing.reset-size1.size8{font-size:3.46em}.ML__mathlive .fontsize-ensurer.reset-size1.size9,.ML__mathlive .sizing.reset-size1.size9{font-size:4.14em}.ML__mathlive .fontsize-ensurer.reset-size1.size10,.ML__mathlive .sizing.reset-size1.size10{font-size:4.98em}.ML__mathlive .fontsize-ensurer.reset-size2.size1,.ML__mathlive .sizing.reset-size2.size1{font-size:.71428571em}.ML__mathlive .fontsize-ensurer.reset-size2.size2,.ML__mathlive .sizing.reset-size2.size2{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size2.size3,.ML__mathlive .sizing.reset-size2.size3{font-size:1.14285714em}.ML__mathlive .fontsize-ensurer.reset-size2.size4,.ML__mathlive .sizing.reset-size2.size4{font-size:1.28571429em}.ML__mathlive .fontsize-ensurer.reset-size2.size5,.ML__mathlive .sizing.reset-size2.size5{font-size:1.42857143em}.ML__mathlive .fontsize-ensurer.reset-size2.size6,.ML__mathlive .sizing.reset-size2.size6{font-size:1.71428571em}.ML__mathlive .fontsize-ensurer.reset-size2.size7,.ML__mathlive .sizing.reset-size2.size7{font-size:2.05714286em}.ML__mathlive .fontsize-ensurer.reset-size2.size8,.ML__mathlive .sizing.reset-size2.size8{font-size:2.47142857em}.ML__mathlive .fontsize-ensurer.reset-size2.size9,.ML__mathlive .sizing.reset-size2.size9{font-size:2.95714286em}.ML__mathlive .fontsize-ensurer.reset-size2.size10,.ML__mathlive .sizing.reset-size2.size10{font-size:3.55714286em}.ML__mathlive .fontsize-ensurer.reset-size3.size1,.ML__mathlive .sizing.reset-size3.size1{font-size:.625em}.ML__mathlive .fontsize-ensurer.reset-size3.size2,.ML__mathlive .sizing.reset-size3.size2{font-size:.875em}.ML__mathlive .fontsize-ensurer.reset-size3.size3,.ML__mathlive .sizing.reset-size3.size3{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size3.size4,.ML__mathlive .sizing.reset-size3.size4{font-size:1.125em}.ML__mathlive .fontsize-ensurer.reset-size3.size5,.ML__mathlive .sizing.reset-size3.size5{font-size:1.25em}.ML__mathlive .fontsize-ensurer.reset-size3.size6,.ML__mathlive .sizing.reset-size3.size6{font-size:1.5em}.ML__mathlive .fontsize-ensurer.reset-size3.size7,.ML__mathlive .sizing.reset-size3.size7{font-size:1.8em}.ML__mathlive .fontsize-ensurer.reset-size3.size8,.ML__mathlive .sizing.reset-size3.size8{font-size:2.1625em}.ML__mathlive .fontsize-ensurer.reset-size3.size9,.ML__mathlive .sizing.reset-size3.size9{font-size:2.5875em}.ML__mathlive .fontsize-ensurer.reset-size3.size10,.ML__mathlive .sizing.reset-size3.size10{font-size:3.1125em}.ML__mathlive .fontsize-ensurer.reset-size4.size1,.ML__mathlive .sizing.reset-size4.size1{font-size:.55555556em}.ML__mathlive .fontsize-ensurer.reset-size4.size2,.ML__mathlive .sizing.reset-size4.size2{font-size:.77777778em}.ML__mathlive .fontsize-ensurer.reset-size4.size3,.ML__mathlive .sizing.reset-size4.size3{font-size:.88888889em}.ML__mathlive .fontsize-ensurer.reset-size4.size4,.ML__mathlive .sizing.reset-size4.size4{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size4.size5,.ML__mathlive .sizing.reset-size4.size5{font-size:1.11111111em}.ML__mathlive .fontsize-ensurer.reset-size4.size6,.ML__mathlive .sizing.reset-size4.size6{font-size:1.33333333em}.ML__mathlive .fontsize-ensurer.reset-size4.size7,.ML__mathlive .sizing.reset-size4.size7{font-size:1.6em}.ML__mathlive .fontsize-ensurer.reset-size4.size8,.ML__mathlive .sizing.reset-size4.size8{font-size:1.92222222em}.ML__mathlive .fontsize-ensurer.reset-size4.size9,.ML__mathlive .sizing.reset-size4.size9{font-size:2.3em}.ML__mathlive .fontsize-ensurer.reset-size4.size10,.ML__mathlive .sizing.reset-size4.size10{font-size:2.76666667em}.ML__mathlive .fontsize-ensurer.reset-size5.size1,.ML__mathlive .sizing.reset-size5.size1{font-size:.5em}.ML__mathlive .fontsize-ensurer.reset-size5.size2,.ML__mathlive .sizing.reset-size5.size2{font-size:.7em}.ML__mathlive .fontsize-ensurer.reset-size5.size3,.ML__mathlive .sizing.reset-size5.size3{font-size:.8em}.ML__mathlive .fontsize-ensurer.reset-size5.size4,.ML__mathlive .sizing.reset-size5.size4{font-size:.9em}.ML__mathlive .fontsize-ensurer.reset-size5.size5,.ML__mathlive .sizing.reset-size5.size5{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size5.size6,.ML__mathlive .sizing.reset-size5.size6{font-size:1.2em}.ML__mathlive .fontsize-ensurer.reset-size5.size7,.ML__mathlive .sizing.reset-size5.size7{font-size:1.44em}.ML__mathlive .fontsize-ensurer.reset-size5.size8,.ML__mathlive .sizing.reset-size5.size8{font-size:1.73em}.ML__mathlive .fontsize-ensurer.reset-size5.size9,.ML__mathlive .sizing.reset-size5.size9{font-size:2.07em}.ML__mathlive .fontsize-ensurer.reset-size5.size10,.ML__mathlive .sizing.reset-size5.size10{font-size:2.49em}.ML__mathlive .fontsize-ensurer.reset-size6.size1,.ML__mathlive .sizing.reset-size6.size1{font-size:.41666667em}.ML__mathlive .fontsize-ensurer.reset-size6.size2,.ML__mathlive .sizing.reset-size6.size2{font-size:.58333333em}.ML__mathlive .fontsize-ensurer.reset-size6.size3,.ML__mathlive .sizing.reset-size6.size3{font-size:.66666667em}.ML__mathlive .fontsize-ensurer.reset-size6.size4,.ML__mathlive .sizing.reset-size6.size4{font-size:.75em}.ML__mathlive .fontsize-ensurer.reset-size6.size5,.ML__mathlive .sizing.reset-size6.size5{font-size:.83333333em}.ML__mathlive .fontsize-ensurer.reset-size6.size6,.ML__mathlive .sizing.reset-size6.size6{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size6.size7,.ML__mathlive .sizing.reset-size6.size7{font-size:1.2em}.ML__mathlive .fontsize-ensurer.reset-size6.size8,.ML__mathlive .sizing.reset-size6.size8{font-size:1.44166667em}.ML__mathlive .fontsize-ensurer.reset-size6.size9,.ML__mathlive .sizing.reset-size6.size9{font-size:1.725em}.ML__mathlive .fontsize-ensurer.reset-size6.size10,.ML__mathlive .sizing.reset-size6.size10{font-size:2.075em}.ML__mathlive .fontsize-ensurer.reset-size7.size1,.ML__mathlive .sizing.reset-size7.size1{font-size:.34722222em}.ML__mathlive .fontsize-ensurer.reset-size7.size2,.ML__mathlive .sizing.reset-size7.size2{font-size:.48611111em}.ML__mathlive .fontsize-ensurer.reset-size7.size3,.ML__mathlive .sizing.reset-size7.size3{font-size:.55555556em}.ML__mathlive .fontsize-ensurer.reset-size7.size4,.ML__mathlive .sizing.reset-size7.size4{font-size:.625em}.ML__mathlive .fontsize-ensurer.reset-size7.size5,.ML__mathlive .sizing.reset-size7.size5{font-size:.69444444em}.ML__mathlive .fontsize-ensurer.reset-size7.size6,.ML__mathlive .sizing.reset-size7.size6{font-size:.83333333em}.ML__mathlive .fontsize-ensurer.reset-size7.size7,.ML__mathlive .sizing.reset-size7.size7{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size7.size8,.ML__mathlive .sizing.reset-size7.size8{font-size:1.20138889em}.ML__mathlive .fontsize-ensurer.reset-size7.size9,.ML__mathlive .sizing.reset-size7.size9{font-size:1.4375em}.ML__mathlive .fontsize-ensurer.reset-size7.size10,.ML__mathlive .sizing.reset-size7.size10{font-size:1.72916667em}.ML__mathlive .fontsize-ensurer.reset-size8.size1,.ML__mathlive .sizing.reset-size8.size1{font-size:.28901734em}.ML__mathlive .fontsize-ensurer.reset-size8.size2,.ML__mathlive .sizing.reset-size8.size2{font-size:.40462428em}.ML__mathlive .fontsize-ensurer.reset-size8.size3,.ML__mathlive .sizing.reset-size8.size3{font-size:.46242775em}.ML__mathlive .fontsize-ensurer.reset-size8.size4,.ML__mathlive .sizing.reset-size8.size4{font-size:.52023121em}.ML__mathlive .fontsize-ensurer.reset-size8.size5,.ML__mathlive .sizing.reset-size8.size5{font-size:.57803468em}.ML__mathlive .fontsize-ensurer.reset-size8.size6,.ML__mathlive .sizing.reset-size8.size6{font-size:.69364162em}.ML__mathlive .fontsize-ensurer.reset-size8.size7,.ML__mathlive .sizing.reset-size8.size7{font-size:.83236994em}.ML__mathlive .fontsize-ensurer.reset-size8.size8,.ML__mathlive .sizing.reset-size8.size8{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size8.size9,.ML__mathlive .sizing.reset-size8.size9{font-size:1.19653179em}.ML__mathlive .fontsize-ensurer.reset-size8.size10,.ML__mathlive .sizing.reset-size8.size10{font-size:1.43930636em}.ML__mathlive .fontsize-ensurer.reset-size9.size1,.ML__mathlive .sizing.reset-size9.size1{font-size:.24154589em}.ML__mathlive .fontsize-ensurer.reset-size9.size2,.ML__mathlive .sizing.reset-size9.size2{font-size:.33816425em}.ML__mathlive .fontsize-ensurer.reset-size9.size3,.ML__mathlive .sizing.reset-size9.size3{font-size:.38647343em}.ML__mathlive .fontsize-ensurer.reset-size9.size4,.ML__mathlive .sizing.reset-size9.size4{font-size:.43478261em}.ML__mathlive .fontsize-ensurer.reset-size9.size5,.ML__mathlive .sizing.reset-size9.size5{font-size:.48309179em}.ML__mathlive .fontsize-ensurer.reset-size9.size6,.ML__mathlive .sizing.reset-size9.size6{font-size:.57971014em}.ML__mathlive .fontsize-ensurer.reset-size9.size7,.ML__mathlive .sizing.reset-size9.size7{font-size:.69565217em}.ML__mathlive .fontsize-ensurer.reset-size9.size8,.ML__mathlive .sizing.reset-size9.size8{font-size:.83574879em}.ML__mathlive .fontsize-ensurer.reset-size9.size9,.ML__mathlive .sizing.reset-size9.size9{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size9.size10,.ML__mathlive .sizing.reset-size9.size10{font-size:1.20289855em}.ML__mathlive .fontsize-ensurer.reset-size10.size1,.ML__mathlive .sizing.reset-size10.size1{font-size:.20080321em}.ML__mathlive .fontsize-ensurer.reset-size10.size2,.ML__mathlive .sizing.reset-size10.size2{font-size:.2811245em}.ML__mathlive .fontsize-ensurer.reset-size10.size3,.ML__mathlive .sizing.reset-size10.size3{font-size:.32128514em}.ML__mathlive .fontsize-ensurer.reset-size10.size4,.ML__mathlive .sizing.reset-size10.size4{font-size:.36144578em}.ML__mathlive .fontsize-ensurer.reset-size10.size5,.ML__mathlive .sizing.reset-size10.size5{font-size:.40160643em}.ML__mathlive .fontsize-ensurer.reset-size10.size6,.ML__mathlive .sizing.reset-size10.size6{font-size:.48192771em}.ML__mathlive .fontsize-ensurer.reset-size10.size7,.ML__mathlive .sizing.reset-size10.size7{font-size:.57831325em}.ML__mathlive .fontsize-ensurer.reset-size10.size8,.ML__mathlive .sizing.reset-size10.size8{font-size:.69477912em}.ML__mathlive .fontsize-ensurer.reset-size10.size9,.ML__mathlive .sizing.reset-size10.size9{font-size:.8313253em}.ML__mathlive .fontsize-ensurer.reset-size10.size10,.ML__mathlive .sizing.reset-size10.size10{font-size:1em}.ML__mathlive .delimsizing.size1{font-family:KaTeX_Size1}.ML__mathlive .delimsizing.size2{font-family:KaTeX_Size2}.ML__mathlive .delimsizing.size3{font-family:KaTeX_Size3}.ML__mathlive .delimsizing.size4{font-family:KaTeX_Size4}.ML__mathlive .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1;vertical-align:top}.ML__mathlive .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4;vertical-align:top}.ML__mathlive .nulldelimiter{width:.12em}.ML__mathlive .op-symbol{position:relative}.ML__mathlive .op-symbol.small-op{font-family:KaTeX_Size1}.ML__mathlive .op-symbol.large-op{font-family:KaTeX_Size2}.ML__mathlive .op-limits .vlist>span{text-align:center}.ML__mathlive .accent>.vlist>span{text-align:center}.ML__mathlive .accent .accent-body>span{width:0}.ML__mathlive .accent .accent-body.accent-vec>span{position:relative;left:.326em}.ML__mathlive .mtable .vertical-separator{display:inline-block;margin:0 -.025em;border-right:.05em solid #000}.ML__mathlive .mtable .arraycolsep{display:inline-block}.ML__mathlive .mtable .col-align-c>.vlist{text-align:center}.ML__mathlive .mtable .col-align-l>.vlist{text-align:left}.ML__mathlive .mtable .col-align-r>.vlist{text-align:right}.ML__selection{background:var(--highlight-inactive);box-sizing:border-box}.ML__focused .ML__selection{background:var(--highlight)!important;color:var(--on-highlight)}.ML__command{font-family:Source Code Pro,Consolas,Roboto Mono,Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Courier,monospace;letter-spacing:-1px;font-weight:400;color:var(--primary)}:not(.ML__command)+.ML__command{margin-left:.25em}.ML__command+:not(.ML__command){padding-left:.25em}.ML__smart-fence__close{opacity:.5}.ML__keystroke-caption{visibility:hidden;background:var(--secondary);border-color:var(--secondary-border);box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);text-align:center;border-radius:6px;padding:16px;position:absolute;z-index:1;display:flex;flex-direction:row;justify-content:center;--keystroke:#fff;--on-keystroke:#555;--keystroke-border:#f7f7f7}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__keystroke-caption{--keystroke:hsl(var(--hue),50%,30%);--on-keystroke:#fafafa;--keystroke-border:hsl(var(--hue),50%,25%)}}body[theme=dark] .ML__keystroke-caption{--keystroke:hsl(var(--hue),50%,30%);--on-keystroke:#fafafa;--keystroke-border:hsl(var(--hue),50%,25%)}[data-tooltip]{position:relative}[data-tooltip][data-placement=top]:after{top:inherit;bottom:100%}[data-tooltip]:after{position:absolute;visibility:hidden;content:attr(data-tooltip);display:inline-table;top:110%;width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:200px;padding:8px;background:#616161;color:#fff;text-align:center;z-index:2;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);border-radius:2px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-weight:400;font-size:12px;opacity:0;transform:scale(.5);transition:all .15s cubic-bezier(.4,0,1,1)}@media only screen and (max-width:767px){[data-tooltip]:after{height:32px;padding:4px 16px;font-size:14px}}[data-tooltip]:hover{position:relative}[data-tooltip]:hover:after{visibility:visible;opacity:1;transform:scale(1)}[data-tooltip][data-delay]:after{transition-delay:0s}[data-tooltip][data-delay]:hover:after{transition-delay:1s}.can-redo [data-command='"redo"']{opacity:1!important}.can-undo [data-command='"undo"']{opacity:1!important}.ML__keyboard{--keyboard-background:rgba(209,213,217,0.95);--keyboard-text:#000;--keyboard-text-active:var(--primary);--keyboard-background-border:#ddd;--keycap-background:#fff;--keycap-background-active:#e5e5e5;--keycap-background-border:#e5e6e9;--keycap-background-border-bottom:#8d8f92;--keycap-text:#000;--keycap-text-active:#fff;--keycap-secondary-text:#000;--keycap-modifier-background:#b9bdc7;--keycap-modifier-border:#c5c9d0;--keycap-modifier-border-bottom:#989da6;--keyboard-alternate-background:#fff;--keyboard-alternate-background-active:#e5e5e5;--keyboard-alternate-text:#000;position:fixed;left:0;bottom:-267px;width:100vw;z-index:105;padding-top:5px;transform:translate(0);opacity:0;visibility:hidden;transition:.28s cubic-bezier(0,0,.2,1);transition-property:transform,opacity;-webkit-backdrop-filter:grayscale(50%);backdrop-filter:grayscale(50%);background-color:var(--keyboard-background);border:1px solid var(--keyboard-background-border);font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:16px;font-weight:400;margin:0;text-shadow:none;box-sizing:border-box;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23)}.ML__keyboard.is-visible{transform:translateY(-267px);opacity:1;visibility:visible;transition-timing-function:cubic-bezier(.4,0,1,1)}.ML__keyboard .tex{font-family:KaTeX_Main,Cambria Math,Asana Math,OpenSymbol,Symbola,STIX,Times,serif!important}.ML__keyboard .tex-math{font-family:KaTeX_Math,Cambria Math,Asana Math,OpenSymbol,Symbola,STIX,Times,serif!important}.ML__keyboard .tt{font-family:Source Code Pro,Consolas,Roboto Mono,Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Courier,monospace!important;font-size:30px;font-weight:400}.ML__keyboard.alternate-keys{visibility:hidden;max-width:286px;background-color:var(--keyboard-alternate-background);text-align:center;border-radius:6px;position:fixed;bottom:auto;top:0;box-sizing:content-box;transform:none;z-index:106;display:flex;flex-direction:row;justify-content:center;align-content:center;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);transition:none}@media only screen and (max-height:412px){.ML__keyboard.alternate-keys{max-width:320px}}.ML__keyboard.alternate-keys.is-visible{visibility:visible}.ML__keyboard.alternate-keys ul{list-style:none;margin:3px;padding:0;display:flex;flex-flow:row wrap-reverse;justify-content:center}.ML__keyboard.alternate-keys ul>li{display:flex;flex-flow:column;align-items:center;justify-content:center;font-size:30px;height:70px;width:70px;box-sizing:border-box;margin:0;background:transparent;border:1px solid transparent;border-radius:5px;pointer-events:all;color:var(--keyboard-alternate-text);fill:currentColor}@media only screen and (max-height:412px){.ML__keyboard.alternate-keys ul>li{font-size:24px;height:50px;width:50px}}.ML__keyboard.alternate-keys ul>li.active,.ML__keyboard.alternate-keys ul>li.pressed,.ML__keyboard.alternate-keys ul>li:hover{box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23);background:var(--keyboard-alternate-background-active);color:var(--keyboard-text-active)}.ML__keyboard.alternate-keys ul>li.small{font-size:18px}.ML__keyboard.alternate-keys ul>li.small-button{width:42px;height:42px;margin:2px;background:#fbfbfb}.ML__keyboard.alternate-keys ul>li.small-button:hover{background:var(--keyboard-alternate-background-active)}.ML__keyboard.alternate-keys ul>li.box>div,.ML__keyboard.alternate-keys ul>li.box>span{border:1px dashed rgba(0,0,0,.24)}.ML__keyboard.alternate-keys ul>li .warning{min-height:60px;min-width:60px;background:#cd0030;color:#fff;padding:5px;display:flex;align-items:center;justify-content:center;border-radius:5px}.ML__keyboard.alternate-keys ul>li .warning.active,.ML__keyboard.alternate-keys ul>li .warning.pressed,.ML__keyboard.alternate-keys ul>li .warning:hover{background:red}.ML__keyboard.alternate-keys ul>li .warning svg{width:50px;height:50px}.ML__keyboard.alternate-keys ul>li aside{font-size:12px;line-height:12px;opacity:.78}.ML__keyboard>div.keyboard-layer{display:none;outline:none}.ML__keyboard>div.keyboard-layer.is-visible{display:flex;flex-flow:column}.ML__keyboard>div>div.keyboard-toolbar{align-self:center;display:flex;flex-flow:row;justify-content:space-between;width:736px}@media only screen and (min-width:768px) and (max-width:1024px){.ML__keyboard>div>div.keyboard-toolbar{width:556px}}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar{width:365px;max-width:100vw}}.ML__keyboard>div>div.keyboard-toolbar svg{height:20px;width:20px}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar svg{height:13px;width:17px}}.ML__keyboard>div>div.keyboard-toolbar>.left{justify-content:flex-start;display:flex;flex-flow:row}.ML__keyboard>div>div.keyboard-toolbar>.right{justify-content:flex-end;display:flex;flex-flow:row}.ML__keyboard>div>div.keyboard-toolbar>div>div{display:flex;align-items:baseline;justify-content:center;pointer-events:all;color:var(--keyboard-text);fill:currentColor;background:0;font-size:110%;cursor:pointer;min-height:0;padding:4px 10px;margin:7px 4px 6px;box-shadow:none;border:none;border-bottom:2px solid transparent}.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled.pressed svg,.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled:hover svg,.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled svg{color:var(--keyboard-text);opacity:.2}@media only screen and (max-width:414px){.ML__keyboard>div>div.keyboard-toolbar>div>div{font-size:100%;padding:0 6px 0 0}}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar>div>div{padding-left:4px;padding-right:4px;font-size:90%}}.ML__keyboard>div>div.keyboard-toolbar>div>div.active,.ML__keyboard>div>div.keyboard-toolbar>div>div.pressed,.ML__keyboard>div>div.keyboard-toolbar>div>div:active,.ML__keyboard>div>div.keyboard-toolbar>div>div:hover{color:var(--keyboard-text-active)}.ML__keyboard>div>div.keyboard-toolbar>div>div.selected{color:var(--keyboard-text-active);border-bottom:2px solid var(--keyboard-text-active);margin-bottom:8px;padding-bottom:0}.ML__keyboard div .rows{border:0;border-collapse:separate;clear:both;margin:auto;display:flex;flex-flow:column;align-items:center}.ML__keyboard div .rows>ul{list-style:none;height:40px;margin:0 0 3px;padding:0}.ML__keyboard div .rows>ul>li{display:flex;flex-flow:column;align-items:center;justify-content:center;width:34px;margin-right:2px;height:40px;box-sizing:border-box;padding:8px 0;vertical-align:top;text-align:center;float:left;color:var(--keycap-text);fill:currentColor;font-size:20px;background:var(--keycap-background);border:1px solid var(--keycap-background-border);border-bottom-color:var(--keycap-background-border-bottom);border-radius:5px;pointer-events:all;position:relative;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ML__keyboard div .rows>ul>li:last-child{margin-right:0}.ML__keyboard div .rows>ul>li.small{font-size:16px}.ML__keyboard div .rows>ul>li.tt{color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.bottom{justify-content:flex-end}.ML__keyboard div .rows>ul>li.left{align-items:flex-start;padding-left:4px}.ML__keyboard div .rows>ul>li.right{align-items:flex-end;padding-right:4px}.ML__keyboard div .rows>ul>li svg{width:20px;height:20px}.ML__keyboard div .rows>ul>li .warning{height:25px;width:25px;min-height:25px;min-width:25px;background:#cd0030;color:#fff;border-radius:100%;padding:5px;display:flex;align-items:center;justify-content:center;margin-bottom:-2px}.ML__keyboard div .rows>ul>li .warning svg{width:16px;height:16px}@media only screen and (max-width:768px){.ML__keyboard div .rows>ul>li .warning{height:16px;width:16px;min-height:16px;min-width:16px}.ML__keyboard div .rows>ul>li .warning svg{width:14px;height:14px}}.ML__keyboard div .rows>ul>li>.w0{width:0}.ML__keyboard div .rows>ul>li>.w5{width:16px}.ML__keyboard div .rows>ul>li>.w15{width:52px}.ML__keyboard div .rows>ul>li>.w20{width:70px}.ML__keyboard div .rows>ul>li>.w50{width:178px}.ML__keyboard div .rows>ul>li.separator{background:transparent;border:none;pointer-events:none}@media only screen and (max-width:560px){.ML__keyboard div .rows>ul>li.if-wide{display:none}}.ML__keyboard div .rows>ul>li.tex-math{font-size:25px}.ML__keyboard div .rows>ul>li.pressed,.ML__keyboard div .rows>ul>li:hover{background:var(--keycap-background-active);color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.action.active,.ML__keyboard div .rows>ul>li.action:active,.ML__keyboard div .rows>ul>li.keycap.active,.ML__keyboard div .rows>ul>li.keycap:active{transform:translateY(-20px) scale(1.4);z-index:100;color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.modifier.active,.ML__keyboard div .rows>ul>li.modifier:active{background:var(--keyboard-text-active);color:var(--keycap-text-active)}.ML__keyboard div .rows>ul>li.action.font-glyph,.ML__keyboard div .rows>ul>li.modifier.font-glyph{font-size:18px}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.action.font-glyph,.ML__keyboard div .rows>ul>li.modifier.font-glyph{font-size:16px}}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.bigfnbutton,.ML__keyboard div .rows>ul>li.fnbutton{font-size:12px}}.ML__keyboard div .rows>ul>li.bigfnbutton{font-size:14px}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.bigfnbutton{font-size:9px}}.ML__keyboard div .rows>ul>li.action,.ML__keyboard div .rows>ul>li.modifier{background-color:var(--keycap-modifier-background);border-bottom-color:var(--keycap-modifier-border);border-color:var(--keycap-modifier-border) var(--keycap-modifier-border) var(--keycap-modifier-border-bottom);font-size:65%;font-weight:100}.ML__keyboard div .rows>ul>li.action.selected,.ML__keyboard div .rows>ul>li.modifier.selected{color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.action.selected.active,.ML__keyboard div .rows>ul>li.action.selected.pressed,.ML__keyboard div .rows>ul>li.action.selected:active,.ML__keyboard div .rows>ul>li.action.selected:hover,.ML__keyboard div .rows>ul>li.modifier.selected.active,.ML__keyboard div .rows>ul>li.modifier.selected.pressed,.ML__keyboard div .rows>ul>li.modifier.selected:active,.ML__keyboard div .rows>ul>li.modifier.selected:hover{color:#fff}.ML__keyboard div .rows>ul>li.keycap.w50{font-size:80%;padding-top:10px;font-weight:100}.ML__keyboard div .rows>ul>li small{color:#555}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li small{font-size:9px}}.ML__keyboard div .rows>ul>li aside{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:10px;line-height:10px;color:#666}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li aside{display:none}}@media only screen and (max-width:414px){.ML__keyboard div .rows>ul>li{width:29px;margin-right:2px}.ML__keyboard div .rows>ul>.w5{width:13.5px}.ML__keyboard div .rows>ul>.w15{width:44.5px}.ML__keyboard div .rows>ul>.w20{width:60px}.ML__keyboard div .rows>ul>.w50{width:153px}}@media only screen and (min-width:415px) and (max-width:768px){.ML__keyboard div .rows>ul>li{width:37px;margin-right:3px}.ML__keyboard div .rows>ul>.w5{width:17px}.ML__keyboard div .rows>ul>.w15{width:57px}.ML__keyboard div .rows>ul>.w20{width:77px}.ML__keyboard div .rows>ul>.w50{width:197px}}@media only screen and (min-width:768px) and (max-width:1024px){.ML__keyboard div .rows>ul{height:52px}.ML__keyboard div .rows>ul>li{height:52px;width:51px;margin-right:4px}.ML__keyboard div .rows>ul>.w5{width:23.5px}.ML__keyboard div .rows>ul>.w15{width:78.5px}.ML__keyboard div .rows>ul>.w20{width:106px}.ML__keyboard div .rows>ul>.w50{width:271px}}@media only screen and (min-width:1025px){.ML__keyboard div .rows>ul{height:52px}.ML__keyboard div .rows>ul>li{height:52px;width:66px;margin-right:6px}.ML__keyboard div .rows>ul>.action,.ML__keyboard div .rows>ul>.modifier{font-size:80%}.ML__keyboard div .rows>ul>.w5{width:30px}.ML__keyboard div .rows>ul>.w15{width:102px}.ML__keyboard div .rows>ul>.w20{width:138px}.ML__keyboard div .rows>ul>.w50{width:354px}}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__keyboard{--hue:206;--keyboard-background:hsl(var(--hue),19%,38%);--keyboard-text:#f0f0f0;--keyboard-text-active:hsl(var(--hue),100%,60%);--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:hsl(var(--hue),35%,42%);--keycap-background-border:hsl(var(--hue),25%,35%);--keycap-background-border-bottom:#426b8a;--keycap-text:#d0d0d0;--keycap-text-active:#000;--keycap-secondary-text:#fff;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),19%,38%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}}body[theme=dark] .ML__keyboard{--hue:206;--keyboard-background:hsl(var(--hue),19%,38%);--keyboard-text:#f0f0f0;--keyboard-text-active:hsl(var(--hue),100%,60%);--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:hsl(var(--hue),35%,42%);--keycap-background-border:hsl(var(--hue),25%,35%);--keycap-background-border-bottom:#426b8a;--keycap-text:#d0d0d0;--keycap-text-active:#000;--keycap-secondary-text:#fff;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),19%,38%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}div.ML__keyboard.material{--keyboard-background:rgba(209,213,217,0.9);--keyboard-background-border:#ddd;--keycap-background:transparent;--keycap-background-active:#cccfd1;--keycap-background-border:transparent;--keyboard-alternate-background:#efefef;--keyboard-alternate-text:#000;font-family:Roboto,sans-serif}div.ML__keyboard.material.alternate-keys{background:var(--keyboard-alternate-background);border:1px solid transparent;border-radius:5px;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22)}div.ML__keyboard.material.alternate-keys ul li.active,div.ML__keyboard.material.alternate-keys ul li.pressed,div.ML__keyboard.material.alternate-keys ul li:active,div.ML__keyboard.material.alternate-keys ul li:hover{border:1px solid transparent;background:#5f97fc;color:#fff;fill:currentColor}div.ML__keyboard.material .keyboard-toolbar>div>div{font-size:16px}div.ML__keyboard.material .keyboard-toolbar div.div.active,div.ML__keyboard.material .keyboard-toolbar div.div.pressed,div.ML__keyboard.material .keyboard-toolbar div div:active,div.ML__keyboard.material .keyboard-toolbar div div:hover{color:#5f97fc;fill:currentColor}div.ML__keyboard.material .keyboard-toolbar>div>.selected{color:#5f97fc;fill:currentColor;border-bottom:2px solid #5f97fc;margin-bottom:8px;padding-bottom:0}div.ML__keyboard.material div>.rows>ul>.keycap{background:transparent;border:1px solid transparent;border-radius:5px;color:var(--keycap-text);fill:currentColor;transition:none}div.ML__keyboard.material div>.rows>ul>.keycap.tt{color:#5f97fc}div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]{margin-top:10px;margin-bottom:10px;height:20px;background:#e0e0e0}div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "].active,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "].pressed,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]:active,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]:hover{background:#d0d0d0;box-shadow:none;transform:none}div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):hover{border:1px solid transparent;background:var(--keycap-background-active);box-shadow:none}div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{background:var(--keyboard-alternate-background);color:var(--keyboard-alternate-text);box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23)}@media only screen and (max-width:767px){div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23);font-size:10px;vertical-align:top;width:19.5px;margin-right:10px;margin-left:10px;transform:translateY(-20px) scale(2);transition:none;justify-content:flex-start;padding:2px 0 0;z-index:100}}@media only screen and (max-width:414px){div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{width:16.5px}}@media only screen and (max-width:767px){div.ML__keyboard.material div>.rows>ul>.keycap:last-child.active,div.ML__keyboard.material div>.rows>ul>.keycap:last-child:active{margin-right:0;margin-left:14px}}div.ML__keyboard.material div div.rows ul li.action,div.ML__keyboard.material div div.rows ul li.modifier{background:transparent;border:0;color:#869096;fill:currentColor;font-size:16px;transition:none}div.ML__keyboard.material div div.rows ul li.action.selected,div.ML__keyboard.material div div.rows ul li.modifier.selected{color:#5f97fc;border-radius:0;border-bottom:2px solid #5f97fc}div.ML__keyboard.material div div.rows ul li.action.active,div.ML__keyboard.material div div.rows ul li.action.pressed,div.ML__keyboard.material div div.rows ul li.action:active,div.ML__keyboard.material div div.rows ul li.action:hover,div.ML__keyboard.material div div.rows ul li.modifier.active,div.ML__keyboard.material div div.rows ul li.modifier.pressed,div.ML__keyboard.material div div.rows ul li.modifier:active,div.ML__keyboard.material div div.rows ul li.modifier:hover{border:0;color:var(--keycap-text);background:var(--keycap-background-active);box-shadow:none}div.ML__keyboard.material div div.rows ul li.bigfnbutton,div.ML__keyboard.material div div.rows ul li.fnbutton{background:transparent;border:0}div.ML__keyboard.material div div.rows ul li.bigfnbutton.selected,div.ML__keyboard.material div div.rows ul li.fnbutton.selected{color:#5f97fc;fill:currentColor;border-radius:0;border-bottom:2px solid #5f97fc}div.ML__keyboard.material div div.rows ul li.bigfnbutton.active,div.ML__keyboard.material div div.rows ul li.bigfnbutton.pressed,div.ML__keyboard.material div div.rows ul li.bigfnbutton:active,div.ML__keyboard.material div div.rows ul li.bigfnbutton:hover,div.ML__keyboard.material div div.rows ul li.fnbutton.active,div.ML__keyboard.material div div.rows ul li.fnbutton.pressed,div.ML__keyboard.material div div.rows ul li.fnbutton:active,div.ML__keyboard.material div div.rows ul li.fnbutton:hover{border:0;color:#5f97fc;fill:currentColor;background:var(--keycap-background-active);box-shadow:none}@media (prefers-color-scheme:dark){body:not([theme=light]) div.ML__keyboard.material{--hue:198;--keyboard-background:hsl(var(--hue),19%,18%);--keyboard-text:#d4d6d7;--keyboard-text-active:#5f97fc;--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:#5f97fc;--keycap-background-border:transparent;--keycap-background-border-bottom:transparent;--keycap-text:#d0d0d0;--keycap-text-active:#d4d6d7;--keycap-secondary-text:#5f97fc;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),8%,2%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}}body[theme=dark] div.ML__keyboard.material{--hue:198;--keyboard-background:hsl(var(--hue),19%,18%);--keyboard-text:#d4d6d7;--keyboard-text-active:#5f97fc;--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:#5f97fc;--keycap-background-border:transparent;--keycap-background-border-bottom:transparent;--keycap-text:#d0d0d0;--keycap-text-active:#d4d6d7;--keycap-secondary-text:#5f97fc;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),8%,2%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}.ML__error{background-image:radial-gradient(ellipse at center,#cc0041,transparent 70%);background-repeat:repeat-x;background-size:3px 3px;background-position:0 98%}.ML__suggestion{opacity:.5}.ML__placeholder{opacity:.7;padding-left:.5ex;padding-right:.5ex}.ML__keystroke-caption>span{min-width:14px;margin:0 8px 0 0;padding:4px;background-color:var(--keystroke);color:var(--on-keystroke);fill:currentColor;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:1em;border-radius:6px;border:2px solid var(--keystroke-border)}.ML__virtual-keyboard-toggle.pressed{background:hsla(0,0%,70%,.5)}.ML__virtual-keyboard-toggle:focus{outline:none;border-radius:50%;border:2px solid var(--primary)}.ML__virtual-keyboard-toggle.active,.ML__virtual-keyboard-toggle.active:hover{background:hsla(0,0%,70%,.5);color:#000;fill:currentColor}div.ML__popover.is-visible{visibility:visible;-webkit-animation:ML__fade-in .15s cubic-bezier(0,0,.2,1);animation:ML__fade-in .15s cubic-bezier(0,0,.2,1)}@-webkit-keyframes ML__fade-in{0%{opacity:0}to{opacity:1}}@keyframes ML__fade-in{0%{opacity:0}to{opacity:1}}.ML__popover__content{border-radius:6px;padding:2px;cursor:pointer;min-height:100px;display:flex;flex-direction:column;justify-content:center;margin-left:8px;margin-right:8px}.ML__popover__content a{color:#5ea6fd;padding-top:.3em;margin-top:.4em;display:block}.ML__popover__content a:hover{color:#5ea6fd;text-decoration:underline}.ML__popover__content.active,.ML__popover__content.pressed,.ML__popover__content:hover{background:hsla(0,0%,100%,.1)}.ML__popover__command{font-size:1.6rem}.ML__popover__prev-shortcut{height:31px;opacity:.1;cursor:pointer;margin-left:8px;margin-right:8px;padding-top:4px;padding-bottom:2px}.ML__popover__next-shortcut:hover,.ML__popover__prev-shortcut:hover{opacity:.3}.ML__popover__next-shortcut.active,.ML__popover__next-shortcut.pressed,.ML__popover__prev-shortcut.active,.ML__popover__prev-shortcut.pressed{opacity:1}.ML__popover__next-shortcut>span,.ML__popover__prev-shortcut>span{padding:5px;border-radius:50%;width:20px;height:20px;display:inline-block}.ML__popover__prev-shortcut>span>span{margin-top:-2px;display:block}.ML__popover__next-shortcut>span>span{margin-top:2px;display:block}.ML__popover__next-shortcut:hover>span,.ML__popover__prev-shortcut:hover>span{background:hsla(0,0%,100%,.1)}.ML__popover__next-shortcut{height:34px;opacity:.1;cursor:pointer;margin-left:8px;margin-right:8px;padding-top:2px;padding-bottom:4px}.ML__popover__shortcut{font-size:.8em;margin-top:.25em}.ML__popover__note,.ML__popover__shortcut{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;opacity:.7;padding-top:.25em}.ML__popover__note{font-size:.8rem;line-height:1em;padding-left:.5em;padding-right:.5em}.ML__shortcut-join{opacity:.5}.ML__scroller{position:fixed;z-index:1;top:0;height:100vh;width:200px} \ No newline at end of file +@font-face { + font-family: KaTeX_AMS; + src: url(fonts/KaTeX_AMS-Regular.woff2) format('woff2'), + url(fonts/KaTeX_AMS-Regular.woff) format('woff'); + font-weight: 400; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Caligraphic; + src: url(fonts/KaTeX_Caligraphic-Bold.woff2) format('woff2'), + url(fonts/KaTeX_Caligraphic-Bold.woff) format('woff'); + font-weight: 700; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Caligraphic; + src: url(fonts/KaTeX_Caligraphic-Regular.woff2) format('woff2'), + url(fonts/KaTeX_Caligraphic-Regular.woff) format('woff'); + font-weight: 400; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Fraktur; + src: url(fonts/KaTeX_Fraktur-Bold.woff2) format('woff2'), + url(fonts/KaTeX_Fraktur-Bold.woff) format('woff'); + font-weight: 700; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Fraktur; + src: url(fonts/KaTeX_Fraktur-Regular.woff2) format('woff2'), + url(fonts/KaTeX_Fraktur-Regular.woff) format('woff'); + font-weight: 400; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Main; + src: url(fonts/KaTeX_Main-BoldItalic.woff2) format('woff2'), + url(fonts/KaTeX_Main-BoldItalic.woff) format('woff'); + font-weight: 700; + font-style: italic; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Main; + src: url(fonts/KaTeX_Main-Bold.woff2) format('woff2'), + url(fonts/KaTeX_Main-Bold.woff) format('woff'); + font-weight: 700; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Main; + src: url(fonts/KaTeX_Main-Italic.woff2) format('woff2'), + url(fonts/KaTeX_Main-Italic.woff) format('woff'); + font-weight: 400; + font-style: italic; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Math; + src: url(fonts/KaTeX_Math-BoldItalic.woff2) format('woff2'), + url(fonts/KaTeX_Math-BoldItalic.woff) format('woff'); + font-weight: 700; + font-style: italic; + font-display: 'swap'; +} +@font-face { + font-family: 'KaTeX_SansSerif'; + src: url(fonts/KaTeX_SansSerif-Bold.woff2) format('woff2'), + url(fonts/KaTeX_SansSerif-Bold.woff) format('woff'); + font-weight: 700; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: 'KaTeX_SansSerif'; + src: url(fonts/KaTeX_SansSerif-Italic.woff2) format('woff2'), + url(fonts/KaTeX_SansSerif-Italic.woff) format('woff'); + font-weight: 400; + font-style: italic; + font-display: 'swap'; +} +@font-face { + font-family: 'KaTeX_SansSerif'; + src: url(fonts/KaTeX_SansSerif-Regular.woff2) format('woff2'), + url(fonts/KaTeX_SansSerif-Regular.woff) format('woff'); + font-weight: 400; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Script; + src: url(fonts/KaTeX_Script-Regular.woff2) format('woff2'), + url(fonts/KaTeX_Script-Regular.woff) format('woff'); + font-weight: 400; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Size1; + src: url(fonts/KaTeX_Size1-Regular.woff2) format('woff2'), + url(fonts/KaTeX_Size1-Regular.woff) format('woff'); + font-weight: 400; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Size2; + src: url(fonts/KaTeX_Size2-Regular.woff2) format('woff2'), + url(fonts/KaTeX_Size2-Regular.woff) format('woff'); + font-weight: 400; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Size3; + src: url(fonts/KaTeX_Size3-Regular.woff2) format('woff2'), + url(fonts/KaTeX_Size3-Regular.woff) format('woff'); + font-weight: 400; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Size4; + src: url(fonts/KaTeX_Size4-Regular.woff2) format('woff2'), + url(fonts/KaTeX_Size4-Regular.woff) format('woff'); + font-weight: 400; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Typewriter; + src: url(fonts/KaTeX_Typewriter-Regular.woff2) format('woff2'), + url(fonts/KaTeX_Typewriter-Regular.woff) format('woff'); + font-weight: 400; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Main; + src: url(fonts/KaTeX_Main-Regular.woff2) format('woff2'), + url(fonts/KaTeX_Main-Regular.woff) format('woff'); + font-weight: 400; + font-style: normal; + font-display: 'swap'; +} +@font-face { + font-family: KaTeX_Math; + src: url(fonts/KaTeX_Math-Italic.woff2) format('woff2'), + url(fonts/KaTeX_Math-Italic.woff) format('woff'); + font-weight: 400; + font-style: italic; + font-display: 'swap'; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} +.ML__mathit { + font-family: KaTeX_Math; + font-style: italic; +} +.ML__mathrm { + font-family: KaTeX_Main; + font-style: normal; +} +.ML__mathbf { + font-family: KaTeX_Main; + font-weight: 700; +} +.ML__mathbfit { + font-family: KaTeX_Math; + font-weight: 700; + font-style: italic; +} +.ML__ams, +.ML__bb { + font-family: KaTeX_AMS; +} +.ML__cal { + font-family: KaTeX_Caligraphic; +} +.ML__frak { + font-family: KaTeX_Fraktur; +} +.ML__tt { + font-family: KaTeX_Typewriter; +} +.ML__script { + font-family: KaTeX_Script; +} +.ML__sans { + font-family: KaTeX_SansSerif; +} +.ML__mainit { + font-family: KaTeX_Main; + font-style: italic; +} +.ML__series_el, +.ML__series_ul { + font-weight: 100; +} +.ML__series_l { + font-weight: 200; +} +.ML__series_sl { + font-weight: 300; +} +.ML__series_sb { + font-weight: 500; +} +.ML__bold { + font-weight: 700; +} +.ML__series_eb { + font-weight: 800; +} +.ML__series_ub { + font-weight: 900; +} +.ML__series_uc { + font-stretch: ultra-condensed; +} +.ML__series_ec { + font-stretch: extra-condensed; +} +.ML__series_c { + font-stretch: condensed; +} +.ML__series_sc { + font-stretch: semi-condensed; +} +.ML__series_sx { + font-stretch: semi-expanded; +} +.ML__series_x { + font-stretch: expanded; +} +.ML__series_ex { + font-stretch: extra-expanded; +} +.ML__series_ux { + font-stretch: ultra-expanded; +} +.ML__it { + font-style: italic; +} +.ML__shape_ol { + -webkit-text-stroke: 1px #000; + text-stroke: 1px #000; + color: transparent; +} +.ML__shape_sc { + font-variant: small-caps; +} +.ML__shape_sl { + font-style: oblique; +} +.ML__emph { + color: #bc2612; +} +.ML__emph .ML__emph { + color: #0c7f99; +} +.ML__mathlive .highlight { + color: #007cb2; + background: #edd1b0; +} +.ML__mathlive .reset-textstyle.scriptstyle { + font-size: 0.7em; +} +.ML__mathlive .reset-textstyle.scriptscriptstyle { + font-size: 0.5em; +} +.ML__mathlive .reset-scriptstyle.textstyle { + font-size: 1.42857em; +} +.ML__mathlive .reset-scriptstyle.scriptscriptstyle { + font-size: 0.71429em; +} +.ML__mathlive .reset-scriptscriptstyle.textstyle { + font-size: 2em; +} +.ML__mathlive .reset-scriptscriptstyle.scriptstyle { + font-size: 1.4em; +} +.ML__mathlive .style-wrap { + position: relative; +} +.ML__mathlive .vlist { + display: inline-block; +} +.ML__mathlive .vlist > span { + display: block; + height: 0; + position: relative; + line-height: 0; +} +.ML__mathlive .vlist > span > span { + display: inline-block; +} +.ML__mathlive .msubsup { + text-align: left; +} +.ML__mathlive .mfrac > span { + text-align: center; +} +.ML__mathlive .mfrac .frac-line { + width: 100%; +} +.ML__mathlive .mfrac .frac-line:after { + content: ''; + display: block; + margin-top: -0.04em; + border-bottom-style: solid; + border-bottom-width: 0.04em; + min-height: 0.04em; +} +.ML__mathlive .rspace.negativethinspace { + margin-right: -0.16667em; +} +.ML__mathlive .rspace.thinspace { + margin-right: 0.16667em; +} +.ML__mathlive .rspace.negativemediumspace { + margin-right: -0.22222em; +} +.ML__mathlive .rspace.mediumspace { + margin-right: 0.22222em; +} +.ML__mathlive .rspace.thickspace { + margin-right: 0.27778em; +} +.ML__mathlive .rspace.sixmuspace { + margin-right: 0.333333em; +} +.ML__mathlive .rspace.eightmuspace { + margin-right: 0.444444em; +} +.ML__mathlive .rspace.enspace { + margin-right: 0.5em; +} +.ML__mathlive .rspace.twelvemuspace { + margin-right: 0.666667em; +} +.ML__mathlive .rspace.quad { + margin-right: 1em; +} +.ML__mathlive .rspace.qquad { + margin-right: 2em; +} +.ML__mathlive .mspace { + display: inline-block; +} +.ML__mathlive .mspace.negativethinspace { + margin-left: -0.16667em; +} +.ML__mathlive .mspace.thinspace { + width: 0.16667em; +} +.ML__mathlive .mspace.negativemediumspace { + margin-left: -0.22222em; +} +.ML__mathlive .mspace.mediumspace { + width: 0.22222em; +} +.ML__mathlive .mspace.thickspace { + width: 0.27778em; +} +.ML__mathlive .mspace.sixmuspace { + width: 0.333333em; +} +.ML__mathlive .mspace.eightmuspace { + width: 0.444444em; +} +.ML__mathlive .mspace.enspace { + width: 0.5em; +} +.ML__mathlive .mspace.twelvemuspace { + width: 0.666667em; +} +.ML__mathlive .mspace.quad { + width: 1em; +} +.ML__mathlive .mspace.qquad { + width: 2em; +} +.ML__mathlive .llap, +.ML__mathlive .rlap { + width: 0; + position: relative; +} +.ML__mathlive .llap > .inner, +.ML__mathlive .rlap > .inner { + position: absolute; +} +.ML__mathlive .llap > .fix, +.ML__mathlive .rlap > .fix { + display: inline-block; +} +.ML__mathlive .llap > .inner { + right: 0; +} +.ML__mathlive .rlap > .inner { + left: 0; +} +.ML__mathlive .rule { + display: inline-block; + border: 0 solid; + position: relative; +} +.ML__mathlive .overline .overline-line, +.ML__mathlive .underline .underline-line { + width: 100%; +} +.ML__mathlive .overline .overline-line:before, +.ML__mathlive .underline .underline-line:before { + border-bottom-style: solid; + border-bottom-width: 0.04em; + content: ''; + display: block; +} +.ML__mathlive .overline .overline-line:after, +.ML__mathlive .underline .underline-line:after { + border-bottom-style: solid; + border-bottom-width: 0.04em; + min-height: thin; + content: ''; + display: block; + margin-top: -1px; +} +.ML__mathlive .sqrt { + display: inline-block; +} +.ML__mathlive .sqrt > .sqrt-sign { + font-family: KaTeX_Main; + position: relative; +} +.ML__mathlive .sqrt .sqrt-line { + height: 0.04em; + width: 100%; +} +.ML__mathlive .sqrt .sqrt-line:before { + content: ''; + display: block; + margin-top: -0.04em; + border-bottom-style: solid; + border-bottom-width: 0.04em; + min-height: 0.5px; +} +.ML__mathlive .sqrt .sqrt-line:after { + border-bottom-width: 1px; + content: ' '; + display: block; + margin-top: -0.1em; +} +.ML__mathlive .sqrt > .root { + margin-left: 0.27777778em; + margin-right: -0.55555556em; +} +.ML__mathlive .fontsize-ensurer, +.ML__mathlive .sizing { + display: inline-block; +} +.ML__mathlive .fontsize-ensurer.reset-size1.size1, +.ML__mathlive .sizing.reset-size1.size1 { + font-size: 1em; +} +.ML__mathlive .fontsize-ensurer.reset-size1.size2, +.ML__mathlive .sizing.reset-size1.size2 { + font-size: 1.4em; +} +.ML__mathlive .fontsize-ensurer.reset-size1.size3, +.ML__mathlive .sizing.reset-size1.size3 { + font-size: 1.6em; +} +.ML__mathlive .fontsize-ensurer.reset-size1.size4, +.ML__mathlive .sizing.reset-size1.size4 { + font-size: 1.8em; +} +.ML__mathlive .fontsize-ensurer.reset-size1.size5, +.ML__mathlive .sizing.reset-size1.size5 { + font-size: 2em; +} +.ML__mathlive .fontsize-ensurer.reset-size1.size6, +.ML__mathlive .sizing.reset-size1.size6 { + font-size: 2.4em; +} +.ML__mathlive .fontsize-ensurer.reset-size1.size7, +.ML__mathlive .sizing.reset-size1.size7 { + font-size: 2.88em; +} +.ML__mathlive .fontsize-ensurer.reset-size1.size8, +.ML__mathlive .sizing.reset-size1.size8 { + font-size: 3.46em; +} +.ML__mathlive .fontsize-ensurer.reset-size1.size9, +.ML__mathlive .sizing.reset-size1.size9 { + font-size: 4.14em; +} +.ML__mathlive .fontsize-ensurer.reset-size1.size10, +.ML__mathlive .sizing.reset-size1.size10 { + font-size: 4.98em; +} +.ML__mathlive .fontsize-ensurer.reset-size2.size1, +.ML__mathlive .sizing.reset-size2.size1 { + font-size: 0.71428571em; +} +.ML__mathlive .fontsize-ensurer.reset-size2.size2, +.ML__mathlive .sizing.reset-size2.size2 { + font-size: 1em; +} +.ML__mathlive .fontsize-ensurer.reset-size2.size3, +.ML__mathlive .sizing.reset-size2.size3 { + font-size: 1.14285714em; +} +.ML__mathlive .fontsize-ensurer.reset-size2.size4, +.ML__mathlive .sizing.reset-size2.size4 { + font-size: 1.28571429em; +} +.ML__mathlive .fontsize-ensurer.reset-size2.size5, +.ML__mathlive .sizing.reset-size2.size5 { + font-size: 1.42857143em; +} +.ML__mathlive .fontsize-ensurer.reset-size2.size6, +.ML__mathlive .sizing.reset-size2.size6 { + font-size: 1.71428571em; +} +.ML__mathlive .fontsize-ensurer.reset-size2.size7, +.ML__mathlive .sizing.reset-size2.size7 { + font-size: 2.05714286em; +} +.ML__mathlive .fontsize-ensurer.reset-size2.size8, +.ML__mathlive .sizing.reset-size2.size8 { + font-size: 2.47142857em; +} +.ML__mathlive .fontsize-ensurer.reset-size2.size9, +.ML__mathlive .sizing.reset-size2.size9 { + font-size: 2.95714286em; +} +.ML__mathlive .fontsize-ensurer.reset-size2.size10, +.ML__mathlive .sizing.reset-size2.size10 { + font-size: 3.55714286em; +} +.ML__mathlive .fontsize-ensurer.reset-size3.size1, +.ML__mathlive .sizing.reset-size3.size1 { + font-size: 0.625em; +} +.ML__mathlive .fontsize-ensurer.reset-size3.size2, +.ML__mathlive .sizing.reset-size3.size2 { + font-size: 0.875em; +} +.ML__mathlive .fontsize-ensurer.reset-size3.size3, +.ML__mathlive .sizing.reset-size3.size3 { + font-size: 1em; +} +.ML__mathlive .fontsize-ensurer.reset-size3.size4, +.ML__mathlive .sizing.reset-size3.size4 { + font-size: 1.125em; +} +.ML__mathlive .fontsize-ensurer.reset-size3.size5, +.ML__mathlive .sizing.reset-size3.size5 { + font-size: 1.25em; +} +.ML__mathlive .fontsize-ensurer.reset-size3.size6, +.ML__mathlive .sizing.reset-size3.size6 { + font-size: 1.5em; +} +.ML__mathlive .fontsize-ensurer.reset-size3.size7, +.ML__mathlive .sizing.reset-size3.size7 { + font-size: 1.8em; +} +.ML__mathlive .fontsize-ensurer.reset-size3.size8, +.ML__mathlive .sizing.reset-size3.size8 { + font-size: 2.1625em; +} +.ML__mathlive .fontsize-ensurer.reset-size3.size9, +.ML__mathlive .sizing.reset-size3.size9 { + font-size: 2.5875em; +} +.ML__mathlive .fontsize-ensurer.reset-size3.size10, +.ML__mathlive .sizing.reset-size3.size10 { + font-size: 3.1125em; +} +.ML__mathlive .fontsize-ensurer.reset-size4.size1, +.ML__mathlive .sizing.reset-size4.size1 { + font-size: 0.55555556em; +} +.ML__mathlive .fontsize-ensurer.reset-size4.size2, +.ML__mathlive .sizing.reset-size4.size2 { + font-size: 0.77777778em; +} +.ML__mathlive .fontsize-ensurer.reset-size4.size3, +.ML__mathlive .sizing.reset-size4.size3 { + font-size: 0.88888889em; +} +.ML__mathlive .fontsize-ensurer.reset-size4.size4, +.ML__mathlive .sizing.reset-size4.size4 { + font-size: 1em; +} +.ML__mathlive .fontsize-ensurer.reset-size4.size5, +.ML__mathlive .sizing.reset-size4.size5 { + font-size: 1.11111111em; +} +.ML__mathlive .fontsize-ensurer.reset-size4.size6, +.ML__mathlive .sizing.reset-size4.size6 { + font-size: 1.33333333em; +} +.ML__mathlive .fontsize-ensurer.reset-size4.size7, +.ML__mathlive .sizing.reset-size4.size7 { + font-size: 1.6em; +} +.ML__mathlive .fontsize-ensurer.reset-size4.size8, +.ML__mathlive .sizing.reset-size4.size8 { + font-size: 1.92222222em; +} +.ML__mathlive .fontsize-ensurer.reset-size4.size9, +.ML__mathlive .sizing.reset-size4.size9 { + font-size: 2.3em; +} +.ML__mathlive .fontsize-ensurer.reset-size4.size10, +.ML__mathlive .sizing.reset-size4.size10 { + font-size: 2.76666667em; +} +.ML__mathlive .fontsize-ensurer.reset-size5.size1, +.ML__mathlive .sizing.reset-size5.size1 { + font-size: 0.5em; +} +.ML__mathlive .fontsize-ensurer.reset-size5.size2, +.ML__mathlive .sizing.reset-size5.size2 { + font-size: 0.7em; +} +.ML__mathlive .fontsize-ensurer.reset-size5.size3, +.ML__mathlive .sizing.reset-size5.size3 { + font-size: 0.8em; +} +.ML__mathlive .fontsize-ensurer.reset-size5.size4, +.ML__mathlive .sizing.reset-size5.size4 { + font-size: 0.9em; +} +.ML__mathlive .fontsize-ensurer.reset-size5.size5, +.ML__mathlive .sizing.reset-size5.size5 { + font-size: 1em; +} +.ML__mathlive .fontsize-ensurer.reset-size5.size6, +.ML__mathlive .sizing.reset-size5.size6 { + font-size: 1.2em; +} +.ML__mathlive .fontsize-ensurer.reset-size5.size7, +.ML__mathlive .sizing.reset-size5.size7 { + font-size: 1.44em; +} +.ML__mathlive .fontsize-ensurer.reset-size5.size8, +.ML__mathlive .sizing.reset-size5.size8 { + font-size: 1.73em; +} +.ML__mathlive .fontsize-ensurer.reset-size5.size9, +.ML__mathlive .sizing.reset-size5.size9 { + font-size: 2.07em; +} +.ML__mathlive .fontsize-ensurer.reset-size5.size10, +.ML__mathlive .sizing.reset-size5.size10 { + font-size: 2.49em; +} +.ML__mathlive .fontsize-ensurer.reset-size6.size1, +.ML__mathlive .sizing.reset-size6.size1 { + font-size: 0.41666667em; +} +.ML__mathlive .fontsize-ensurer.reset-size6.size2, +.ML__mathlive .sizing.reset-size6.size2 { + font-size: 0.58333333em; +} +.ML__mathlive .fontsize-ensurer.reset-size6.size3, +.ML__mathlive .sizing.reset-size6.size3 { + font-size: 0.66666667em; +} +.ML__mathlive .fontsize-ensurer.reset-size6.size4, +.ML__mathlive .sizing.reset-size6.size4 { + font-size: 0.75em; +} +.ML__mathlive .fontsize-ensurer.reset-size6.size5, +.ML__mathlive .sizing.reset-size6.size5 { + font-size: 0.83333333em; +} +.ML__mathlive .fontsize-ensurer.reset-size6.size6, +.ML__mathlive .sizing.reset-size6.size6 { + font-size: 1em; +} +.ML__mathlive .fontsize-ensurer.reset-size6.size7, +.ML__mathlive .sizing.reset-size6.size7 { + font-size: 1.2em; +} +.ML__mathlive .fontsize-ensurer.reset-size6.size8, +.ML__mathlive .sizing.reset-size6.size8 { + font-size: 1.44166667em; +} +.ML__mathlive .fontsize-ensurer.reset-size6.size9, +.ML__mathlive .sizing.reset-size6.size9 { + font-size: 1.725em; +} +.ML__mathlive .fontsize-ensurer.reset-size6.size10, +.ML__mathlive .sizing.reset-size6.size10 { + font-size: 2.075em; +} +.ML__mathlive .fontsize-ensurer.reset-size7.size1, +.ML__mathlive .sizing.reset-size7.size1 { + font-size: 0.34722222em; +} +.ML__mathlive .fontsize-ensurer.reset-size7.size2, +.ML__mathlive .sizing.reset-size7.size2 { + font-size: 0.48611111em; +} +.ML__mathlive .fontsize-ensurer.reset-size7.size3, +.ML__mathlive .sizing.reset-size7.size3 { + font-size: 0.55555556em; +} +.ML__mathlive .fontsize-ensurer.reset-size7.size4, +.ML__mathlive .sizing.reset-size7.size4 { + font-size: 0.625em; +} +.ML__mathlive .fontsize-ensurer.reset-size7.size5, +.ML__mathlive .sizing.reset-size7.size5 { + font-size: 0.69444444em; +} +.ML__mathlive .fontsize-ensurer.reset-size7.size6, +.ML__mathlive .sizing.reset-size7.size6 { + font-size: 0.83333333em; +} +.ML__mathlive .fontsize-ensurer.reset-size7.size7, +.ML__mathlive .sizing.reset-size7.size7 { + font-size: 1em; +} +.ML__mathlive .fontsize-ensurer.reset-size7.size8, +.ML__mathlive .sizing.reset-size7.size8 { + font-size: 1.20138889em; +} +.ML__mathlive .fontsize-ensurer.reset-size7.size9, +.ML__mathlive .sizing.reset-size7.size9 { + font-size: 1.4375em; +} +.ML__mathlive .fontsize-ensurer.reset-size7.size10, +.ML__mathlive .sizing.reset-size7.size10 { + font-size: 1.72916667em; +} +.ML__mathlive .fontsize-ensurer.reset-size8.size1, +.ML__mathlive .sizing.reset-size8.size1 { + font-size: 0.28901734em; +} +.ML__mathlive .fontsize-ensurer.reset-size8.size2, +.ML__mathlive .sizing.reset-size8.size2 { + font-size: 0.40462428em; +} +.ML__mathlive .fontsize-ensurer.reset-size8.size3, +.ML__mathlive .sizing.reset-size8.size3 { + font-size: 0.46242775em; +} +.ML__mathlive .fontsize-ensurer.reset-size8.size4, +.ML__mathlive .sizing.reset-size8.size4 { + font-size: 0.52023121em; +} +.ML__mathlive .fontsize-ensurer.reset-size8.size5, +.ML__mathlive .sizing.reset-size8.size5 { + font-size: 0.57803468em; +} +.ML__mathlive .fontsize-ensurer.reset-size8.size6, +.ML__mathlive .sizing.reset-size8.size6 { + font-size: 0.69364162em; +} +.ML__mathlive .fontsize-ensurer.reset-size8.size7, +.ML__mathlive .sizing.reset-size8.size7 { + font-size: 0.83236994em; +} +.ML__mathlive .fontsize-ensurer.reset-size8.size8, +.ML__mathlive .sizing.reset-size8.size8 { + font-size: 1em; +} +.ML__mathlive .fontsize-ensurer.reset-size8.size9, +.ML__mathlive .sizing.reset-size8.size9 { + font-size: 1.19653179em; +} +.ML__mathlive .fontsize-ensurer.reset-size8.size10, +.ML__mathlive .sizing.reset-size8.size10 { + font-size: 1.43930636em; +} +.ML__mathlive .fontsize-ensurer.reset-size9.size1, +.ML__mathlive .sizing.reset-size9.size1 { + font-size: 0.24154589em; +} +.ML__mathlive .fontsize-ensurer.reset-size9.size2, +.ML__mathlive .sizing.reset-size9.size2 { + font-size: 0.33816425em; +} +.ML__mathlive .fontsize-ensurer.reset-size9.size3, +.ML__mathlive .sizing.reset-size9.size3 { + font-size: 0.38647343em; +} +.ML__mathlive .fontsize-ensurer.reset-size9.size4, +.ML__mathlive .sizing.reset-size9.size4 { + font-size: 0.43478261em; +} +.ML__mathlive .fontsize-ensurer.reset-size9.size5, +.ML__mathlive .sizing.reset-size9.size5 { + font-size: 0.48309179em; +} +.ML__mathlive .fontsize-ensurer.reset-size9.size6, +.ML__mathlive .sizing.reset-size9.size6 { + font-size: 0.57971014em; +} +.ML__mathlive .fontsize-ensurer.reset-size9.size7, +.ML__mathlive .sizing.reset-size9.size7 { + font-size: 0.69565217em; +} +.ML__mathlive .fontsize-ensurer.reset-size9.size8, +.ML__mathlive .sizing.reset-size9.size8 { + font-size: 0.83574879em; +} +.ML__mathlive .fontsize-ensurer.reset-size9.size9, +.ML__mathlive .sizing.reset-size9.size9 { + font-size: 1em; +} +.ML__mathlive .fontsize-ensurer.reset-size9.size10, +.ML__mathlive .sizing.reset-size9.size10 { + font-size: 1.20289855em; +} +.ML__mathlive .fontsize-ensurer.reset-size10.size1, +.ML__mathlive .sizing.reset-size10.size1 { + font-size: 0.20080321em; +} +.ML__mathlive .fontsize-ensurer.reset-size10.size2, +.ML__mathlive .sizing.reset-size10.size2 { + font-size: 0.2811245em; +} +.ML__mathlive .fontsize-ensurer.reset-size10.size3, +.ML__mathlive .sizing.reset-size10.size3 { + font-size: 0.32128514em; +} +.ML__mathlive .fontsize-ensurer.reset-size10.size4, +.ML__mathlive .sizing.reset-size10.size4 { + font-size: 0.36144578em; +} +.ML__mathlive .fontsize-ensurer.reset-size10.size5, +.ML__mathlive .sizing.reset-size10.size5 { + font-size: 0.40160643em; +} +.ML__mathlive .fontsize-ensurer.reset-size10.size6, +.ML__mathlive .sizing.reset-size10.size6 { + font-size: 0.48192771em; +} +.ML__mathlive .fontsize-ensurer.reset-size10.size7, +.ML__mathlive .sizing.reset-size10.size7 { + font-size: 0.57831325em; +} +.ML__mathlive .fontsize-ensurer.reset-size10.size8, +.ML__mathlive .sizing.reset-size10.size8 { + font-size: 0.69477912em; +} +.ML__mathlive .fontsize-ensurer.reset-size10.size9, +.ML__mathlive .sizing.reset-size10.size9 { + font-size: 0.8313253em; +} +.ML__mathlive .fontsize-ensurer.reset-size10.size10, +.ML__mathlive .sizing.reset-size10.size10 { + font-size: 1em; +} +.ML__mathlive .delimsizing.size1 { + font-family: KaTeX_Size1; +} +.ML__mathlive .delimsizing.size2 { + font-family: KaTeX_Size2; +} +.ML__mathlive .delimsizing.size3 { + font-family: KaTeX_Size3; +} +.ML__mathlive .delimsizing.size4 { + font-family: KaTeX_Size4; +} +.ML__mathlive .delimsizing.mult .delim-size1 > span { + font-family: KaTeX_Size1; + vertical-align: top; +} +.ML__mathlive .delimsizing.mult .delim-size4 > span { + font-family: KaTeX_Size4; + vertical-align: top; +} +.ML__mathlive .nulldelimiter { + width: 0.12em; +} +.ML__mathlive .op-symbol { + position: relative; +} +.ML__mathlive .op-symbol.small-op { + font-family: KaTeX_Size1; +} +.ML__mathlive .op-symbol.large-op { + font-family: KaTeX_Size2; +} +.ML__mathlive .op-limits .vlist > span { + text-align: center; +} +.ML__mathlive .accent > .vlist > span { + text-align: center; +} +.ML__mathlive .accent .accent-body > span { + width: 0; +} +.ML__mathlive .accent .accent-body.accent-vec > span { + position: relative; + left: 0.326em; +} +.ML__mathlive .mtable .vertical-separator { + display: inline-block; + margin: 0 -0.025em; + border-right: 0.05em solid #000; +} +.ML__mathlive .mtable .arraycolsep { + display: inline-block; +} +.ML__mathlive .mtable .col-align-c > .vlist { + text-align: center; +} +.ML__mathlive .mtable .col-align-l > .vlist { + text-align: left; +} +.ML__mathlive .mtable .col-align-r > .vlist { + text-align: right; +} +.ML__selection { + background: var(--highlight-inactive); + box-sizing: border-box; +} +.ML__focused .ML__selection { + background: var(--highlight) !important; + color: var(--on-highlight); +} +.ML__contains-caret.ML__close, +.ML__contains-caret.ML__open, +.ML__contains-caret > .ML__close, +.ML__contains-caret > .ML__open, +.sqrt.ML__contains-caret > .sqrt-sign, +.sqrt.ML__contains-caret > .vlist > span > .sqrt-line { + color: var(--caret); +} +.ML__command { + font-family: Source Code Pro, Consolas, Roboto Mono, Menlo, + Bitstream Vera Sans Mono, DejaVu Sans Mono, Monaco, Courier, monospace; + letter-spacing: -1px; + font-weight: 400; + color: var(--primary); +} +:not(.ML__command) + .ML__command { + margin-left: 0.25em; +} +.ML__command + :not(.ML__command) { + padding-left: 0.25em; +} +.ML__smart-fence__close { + opacity: 0.5; +} +.ML__keystroke-caption { + visibility: hidden; + background: var(--secondary); + border-color: var(--secondary-border); + box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); + text-align: center; + border-radius: 6px; + padding: 16px; + position: absolute; + z-index: 1; + display: flex; + flex-direction: row; + justify-content: center; + --keystroke: #fff; + --on-keystroke: #555; + --keystroke-border: #f7f7f7; +} +@media (prefers-color-scheme: dark) { + body:not([theme='light']) .ML__keystroke-caption { + --keystroke: hsl(var(--hue), 50%, 30%); + --on-keystroke: #fafafa; + --keystroke-border: hsl(var(--hue), 50%, 25%); + } +} +body[theme='dark'] .ML__keystroke-caption { + --keystroke: hsl(var(--hue), 50%, 30%); + --on-keystroke: #fafafa; + --keystroke-border: hsl(var(--hue), 50%, 25%); +} +[data-tooltip] { + position: relative; +} +[data-tooltip][data-placement='top']:after { + top: inherit; + bottom: 100%; +} +[data-tooltip]:after { + position: absolute; + visibility: hidden; + content: attr(data-tooltip); + display: inline-table; + top: 110%; + width: -webkit-max-content; + width: -moz-max-content; + width: max-content; + max-width: 200px; + padding: 8px; + background: #616161; + color: #fff; + text-align: center; + z-index: 2; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), + 0 3px 1px -2px rgba(0, 0, 0, 0.2); + border-radius: 2px; + font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, + Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, + sans-serif; + font-weight: 400; + font-size: 12px; + opacity: 0; + transform: scale(0.5); + transition: all 0.15s cubic-bezier(0.4, 0, 1, 1); +} +@media only screen and (max-width: 767px) { + [data-tooltip]:after { + height: 32px; + padding: 4px 16px; + font-size: 14px; + } +} +[data-tooltip]:hover { + position: relative; +} +[data-tooltip]:hover:after { + visibility: visible; + opacity: 1; + transform: scale(1); +} +[data-tooltip][data-delay]:after { + transition-delay: 0s; +} +[data-tooltip][data-delay]:hover:after { + transition-delay: 1s; +} +.can-redo [data-command='redo'] { + opacity: 1 !important; +} +.can-undo [data-command='undo'] { + opacity: 1 !important; +} +.ML__keyboard { + --keyboard-background: rgba(209, 213, 217, 0.95); + --keyboard-text: #000; + --keyboard-text-active: var(--primary); + --keyboard-background-border: #ddd; + --keycap-background: #fff; + --keycap-background-active: #e5e5e5; + --keycap-background-border: #e5e6e9; + --keycap-background-border-bottom: #8d8f92; + --keycap-text: #000; + --keycap-text-active: #fff; + --keycap-secondary-text: #000; + --keycap-modifier-background: #b9bdc7; + --keycap-modifier-border: #c5c9d0; + --keycap-modifier-border-bottom: #989da6; + --keyboard-alternate-background: #fff; + --keyboard-alternate-background-active: #e5e5e5; + --keyboard-alternate-text: #000; + position: fixed; + left: 0; + bottom: -267px; + width: 100vw; + z-index: 105; + padding-top: 5px; + transform: translate(0); + opacity: 0; + visibility: hidden; + transition: 0.28s cubic-bezier(0, 0, 0.2, 1); + transition-property: transform, opacity; + -webkit-backdrop-filter: grayscale(50%); + backdrop-filter: grayscale(50%); + background-color: var(--keyboard-background); + border: 1px solid var(--keyboard-background-border); + font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, + Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, + sans-serif; + font-size: 16px; + font-weight: 400; + margin: 0; + text-shadow: none; + box-sizing: border-box; + touch-action: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); +} +.ML__keyboard.is-visible { + transform: translateY(-267px); + opacity: 1; + visibility: visible; + transition-timing-function: cubic-bezier(0.4, 0, 1, 1); +} +.ML__keyboard .tex { + font-family: KaTeX_Main, Cambria Math, Asana Math, OpenSymbol, Symbola, STIX, + Times, serif !important; +} +.ML__keyboard .tex-math { + font-family: KaTeX_Math, Cambria Math, Asana Math, OpenSymbol, Symbola, STIX, + Times, serif !important; +} +.ML__keyboard .tt { + font-family: Source Code Pro, Consolas, Roboto Mono, Menlo, + Bitstream Vera Sans Mono, DejaVu Sans Mono, Monaco, Courier, monospace !important; + font-size: 30px; + font-weight: 400; +} +.ML__keyboard.alternate-keys { + visibility: hidden; + max-width: 286px; + background-color: var(--keyboard-alternate-background); + text-align: center; + border-radius: 6px; + position: fixed; + bottom: auto; + top: 0; + box-sizing: content-box; + transform: none; + z-index: 106; + display: flex; + flex-direction: row; + justify-content: center; + align-content: center; + box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); + transition: none; +} +@media only screen and (max-height: 412px) { + .ML__keyboard.alternate-keys { + max-width: 320px; + } +} +.ML__keyboard.alternate-keys.is-visible { + visibility: visible; +} +.ML__keyboard.alternate-keys ul { + list-style: none; + margin: 3px; + padding: 0; + display: flex; + flex-flow: row wrap-reverse; + justify-content: center; +} +.ML__keyboard.alternate-keys ul > li { + display: flex; + flex-flow: column; + align-items: center; + justify-content: center; + font-size: 30px; + height: 70px; + width: 70px; + box-sizing: border-box; + margin: 0; + background: transparent; + border: 1px solid transparent; + border-radius: 5px; + pointer-events: all; + color: var(--keyboard-alternate-text); + fill: currentColor; +} +@media only screen and (max-height: 412px) { + .ML__keyboard.alternate-keys ul > li { + font-size: 24px; + height: 50px; + width: 50px; + } +} +.ML__keyboard.alternate-keys ul > li.active, +.ML__keyboard.alternate-keys ul > li.pressed, +.ML__keyboard.alternate-keys ul > li:hover { + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + background: var(--keyboard-alternate-background-active); + color: var(--keyboard-text-active); +} +.ML__keyboard.alternate-keys ul > li.small { + font-size: 18px; +} +.ML__keyboard.alternate-keys ul > li.small-button { + width: 42px; + height: 42px; + margin: 2px; + background: #fbfbfb; +} +.ML__keyboard.alternate-keys ul > li.small-button:hover { + background: var(--keyboard-alternate-background-active); +} +.ML__keyboard.alternate-keys ul > li.box > div, +.ML__keyboard.alternate-keys ul > li.box > span { + border: 1px dashed rgba(0, 0, 0, 0.24); +} +.ML__keyboard.alternate-keys ul > li .warning { + min-height: 60px; + min-width: 60px; + background: #cd0030; + color: #fff; + padding: 5px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 5px; +} +.ML__keyboard.alternate-keys ul > li .warning.active, +.ML__keyboard.alternate-keys ul > li .warning.pressed, +.ML__keyboard.alternate-keys ul > li .warning:hover { + background: red; +} +.ML__keyboard.alternate-keys ul > li .warning svg { + width: 50px; + height: 50px; +} +.ML__keyboard.alternate-keys ul > li aside { + font-size: 12px; + line-height: 12px; + opacity: 0.78; +} +.ML__keyboard > div.keyboard-layer { + display: none; + outline: none; +} +.ML__keyboard > div.keyboard-layer.is-visible { + display: flex; + flex-flow: column; +} +.ML__keyboard > div > div.keyboard-toolbar { + align-self: center; + display: flex; + flex-flow: row; + justify-content: space-between; + width: 736px; +} +@media only screen and (min-width: 768px) and (max-width: 1024px) { + .ML__keyboard > div > div.keyboard-toolbar { + width: 556px; + } +} +@media only screen and (max-width: 767px) { + .ML__keyboard > div > div.keyboard-toolbar { + width: 365px; + max-width: 100vw; + } +} +.ML__keyboard > div > div.keyboard-toolbar svg { + height: 20px; + width: 20px; +} +@media only screen and (max-width: 767px) { + .ML__keyboard > div > div.keyboard-toolbar svg { + height: 13px; + width: 17px; + } +} +.ML__keyboard > div > div.keyboard-toolbar > .left { + justify-content: flex-start; + display: flex; + flex-flow: row; +} +.ML__keyboard > div > div.keyboard-toolbar > .right { + justify-content: flex-end; + display: flex; + flex-flow: row; +} +.ML__keyboard > div > div.keyboard-toolbar > div > div { + display: flex; + align-items: baseline; + justify-content: center; + pointer-events: all; + color: var(--keyboard-text); + fill: currentColor; + background: 0; + font-size: 110%; + cursor: pointer; + min-height: 0; + padding: 4px 10px; + margin: 7px 4px 6px; + box-shadow: none; + border: none; + border-bottom: 2px solid transparent; +} +.ML__keyboard > div > div.keyboard-toolbar > div > div.disabled.pressed svg, +.ML__keyboard > div > div.keyboard-toolbar > div > div.disabled:hover svg, +.ML__keyboard > div > div.keyboard-toolbar > div > div.disabled svg { + color: var(--keyboard-text); + opacity: 0.2; +} +@media only screen and (max-width: 414px) { + .ML__keyboard > div > div.keyboard-toolbar > div > div { + font-size: 100%; + padding: 0 6px 0 0; + } +} +@media only screen and (max-width: 767px) { + .ML__keyboard > div > div.keyboard-toolbar > div > div { + padding-left: 4px; + padding-right: 4px; + font-size: 90%; + } +} +.ML__keyboard > div > div.keyboard-toolbar > div > div.active, +.ML__keyboard > div > div.keyboard-toolbar > div > div.pressed, +.ML__keyboard > div > div.keyboard-toolbar > div > div:active, +.ML__keyboard > div > div.keyboard-toolbar > div > div:hover { + color: var(--keyboard-text-active); +} +.ML__keyboard > div > div.keyboard-toolbar > div > div.selected { + color: var(--keyboard-text-active); + border-bottom: 2px solid var(--keyboard-text-active); + margin-bottom: 8px; + padding-bottom: 0; +} +.ML__keyboard div .rows { + border: 0; + border-collapse: separate; + clear: both; + margin: auto; + display: flex; + flex-flow: column; + align-items: center; +} +.ML__keyboard div .rows > ul { + list-style: none; + height: 40px; + margin: 0 0 3px; + padding: 0; +} +.ML__keyboard div .rows > ul > li { + display: flex; + flex-flow: column; + align-items: center; + justify-content: center; + width: 34px; + margin-right: 2px; + height: 40px; + box-sizing: border-box; + padding: 8px 0; + vertical-align: top; + text-align: center; + float: left; + color: var(--keycap-text); + fill: currentColor; + font-size: 20px; + background: var(--keycap-background); + border: 1px solid var(--keycap-background-border); + border-bottom-color: var(--keycap-background-border-bottom); + border-radius: 5px; + pointer-events: all; + position: relative; + overflow: hidden; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-tap-highlight-color: transparent; +} +.ML__keyboard div .rows > ul > li:last-child { + margin-right: 0; +} +.ML__keyboard div .rows > ul > li.small { + font-size: 16px; +} +.ML__keyboard div .rows > ul > li.tt { + color: var(--keyboard-text-active); +} +.ML__keyboard div .rows > ul > li.bottom { + justify-content: flex-end; +} +.ML__keyboard div .rows > ul > li.left { + align-items: flex-start; + padding-left: 4px; +} +.ML__keyboard div .rows > ul > li.right { + align-items: flex-end; + padding-right: 4px; +} +.ML__keyboard div .rows > ul > li svg { + width: 20px; + height: 20px; +} +.ML__keyboard div .rows > ul > li .warning { + height: 25px; + width: 25px; + min-height: 25px; + min-width: 25px; + background: #cd0030; + color: #fff; + border-radius: 100%; + padding: 5px; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: -2px; +} +.ML__keyboard div .rows > ul > li .warning svg { + width: 16px; + height: 16px; +} +@media only screen and (max-width: 768px) { + .ML__keyboard div .rows > ul > li .warning { + height: 16px; + width: 16px; + min-height: 16px; + min-width: 16px; + } + .ML__keyboard div .rows > ul > li .warning svg { + width: 14px; + height: 14px; + } +} +.ML__keyboard div .rows > ul > li > .w0 { + width: 0; +} +.ML__keyboard div .rows > ul > li > .w5 { + width: 16px; +} +.ML__keyboard div .rows > ul > li > .w15 { + width: 52px; +} +.ML__keyboard div .rows > ul > li > .w20 { + width: 70px; +} +.ML__keyboard div .rows > ul > li > .w50 { + width: 178px; +} +.ML__keyboard div .rows > ul > li.separator { + background: transparent; + border: none; + pointer-events: none; +} +@media only screen and (max-width: 560px) { + .ML__keyboard div .rows > ul > li.if-wide { + display: none; + } +} +.ML__keyboard div .rows > ul > li.tex-math { + font-size: 25px; +} +.ML__keyboard div .rows > ul > li.pressed, +.ML__keyboard div .rows > ul > li:hover { + background: var(--keycap-background-active); + color: var(--keyboard-text-active); +} +.ML__keyboard div .rows > ul > li.action.active, +.ML__keyboard div .rows > ul > li.action:active, +.ML__keyboard div .rows > ul > li.keycap.active, +.ML__keyboard div .rows > ul > li.keycap:active { + transform: translateY(-20px) scale(1.4); + z-index: 100; + color: var(--keyboard-text-active); +} +.ML__keyboard div .rows > ul > li.modifier.active, +.ML__keyboard div .rows > ul > li.modifier:active { + background: var(--keyboard-text-active); + color: var(--keycap-text-active); +} +.ML__keyboard div .rows > ul > li.action.font-glyph, +.ML__keyboard div .rows > ul > li.modifier.font-glyph { + font-size: 18px; +} +@media only screen and (max-width: 767px) { + .ML__keyboard div .rows > ul > li.action.font-glyph, + .ML__keyboard div .rows > ul > li.modifier.font-glyph { + font-size: 16px; + } +} +@media only screen and (max-width: 767px) { + .ML__keyboard div .rows > ul > li.bigfnbutton, + .ML__keyboard div .rows > ul > li.fnbutton { + font-size: 12px; + } +} +.ML__keyboard div .rows > ul > li.bigfnbutton { + font-size: 14px; +} +@media only screen and (max-width: 767px) { + .ML__keyboard div .rows > ul > li.bigfnbutton { + font-size: 9px; + } +} +.ML__keyboard div .rows > ul > li.action, +.ML__keyboard div .rows > ul > li.modifier { + background-color: var(--keycap-modifier-background); + border-bottom-color: var(--keycap-modifier-border); + border-color: var(--keycap-modifier-border) var(--keycap-modifier-border) + var(--keycap-modifier-border-bottom); + font-size: 65%; + font-weight: 100; +} +.ML__keyboard div .rows > ul > li.action.selected, +.ML__keyboard div .rows > ul > li.modifier.selected { + color: var(--keyboard-text-active); +} +.ML__keyboard div .rows > ul > li.action.selected.active, +.ML__keyboard div .rows > ul > li.action.selected.pressed, +.ML__keyboard div .rows > ul > li.action.selected:active, +.ML__keyboard div .rows > ul > li.action.selected:hover, +.ML__keyboard div .rows > ul > li.modifier.selected.active, +.ML__keyboard div .rows > ul > li.modifier.selected.pressed, +.ML__keyboard div .rows > ul > li.modifier.selected:active, +.ML__keyboard div .rows > ul > li.modifier.selected:hover { + color: #fff; +} +.ML__keyboard div .rows > ul > li.keycap.w50 { + font-size: 80%; + padding-top: 10px; + font-weight: 100; +} +.ML__keyboard div .rows > ul > li small { + color: #555; +} +@media only screen and (max-width: 767px) { + .ML__keyboard div .rows > ul > li small { + font-size: 9px; + } +} +.ML__keyboard div .rows > ul > li aside { + font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, + Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, + sans-serif; + font-size: 10px; + line-height: 10px; + color: #666; +} +@media only screen and (max-width: 767px) { + .ML__keyboard div .rows > ul > li aside { + display: none; + } +} +@media only screen and (max-width: 414px) { + .ML__keyboard div .rows > ul > li { + width: 29px; + margin-right: 2px; + } + .ML__keyboard div .rows > ul > .w5 { + width: 13.5px; + } + .ML__keyboard div .rows > ul > .w15 { + width: 44.5px; + } + .ML__keyboard div .rows > ul > .w20 { + width: 60px; + } + .ML__keyboard div .rows > ul > .w50 { + width: 153px; + } +} +@media only screen and (min-width: 415px) and (max-width: 768px) { + .ML__keyboard div .rows > ul > li { + width: 37px; + margin-right: 3px; + } + .ML__keyboard div .rows > ul > .w5 { + width: 17px; + } + .ML__keyboard div .rows > ul > .w15 { + width: 57px; + } + .ML__keyboard div .rows > ul > .w20 { + width: 77px; + } + .ML__keyboard div .rows > ul > .w50 { + width: 197px; + } +} +@media only screen and (min-width: 768px) and (max-width: 1024px) { + .ML__keyboard div .rows > ul { + height: 52px; + } + .ML__keyboard div .rows > ul > li { + height: 52px; + width: 51px; + margin-right: 4px; + } + .ML__keyboard div .rows > ul > .w5 { + width: 23.5px; + } + .ML__keyboard div .rows > ul > .w15 { + width: 78.5px; + } + .ML__keyboard div .rows > ul > .w20 { + width: 106px; + } + .ML__keyboard div .rows > ul > .w50 { + width: 271px; + } +} +@media only screen and (min-width: 1025px) { + .ML__keyboard div .rows > ul { + height: 52px; + } + .ML__keyboard div .rows > ul > li { + height: 52px; + width: 66px; + margin-right: 6px; + } + .ML__keyboard div .rows > ul > .action, + .ML__keyboard div .rows > ul > .modifier { + font-size: 80%; + } + .ML__keyboard div .rows > ul > .w5 { + width: 30px; + } + .ML__keyboard div .rows > ul > .w15 { + width: 102px; + } + .ML__keyboard div .rows > ul > .w20 { + width: 138px; + } + .ML__keyboard div .rows > ul > .w50 { + width: 354px; + } +} +@media (prefers-color-scheme: dark) { + body:not([theme='light']) .ML__keyboard { + --hue: 206; + --keyboard-background: hsl(var(--hue), 19%, 38%); + --keyboard-text: #f0f0f0; + --keyboard-text-active: hsl(var(--hue), 100%, 60%); + --keyboard-background-border: #333; + --keycap-background: hsl(var(--hue), 25%, 39%); + --keycap-background-active: hsl(var(--hue), 35%, 42%); + --keycap-background-border: hsl(var(--hue), 25%, 35%); + --keycap-background-border-bottom: #426b8a; + --keycap-text: #d0d0d0; + --keycap-text-active: #000; + --keycap-secondary-text: #fff; + --keycap-modifier-background: hsl(var(--hue), 35%, 40%); + --keycap-modifier-border: hsl(var(--hue), 35%, 35%); + --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-background: hsl(var(--hue), 19%, 38%); + --keyboard-alternate-background-active: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-text: #d1d1d1; + } +} +body[theme='dark'] .ML__keyboard { + --hue: 206; + --keyboard-background: hsl(var(--hue), 19%, 38%); + --keyboard-text: #f0f0f0; + --keyboard-text-active: hsl(var(--hue), 100%, 60%); + --keyboard-background-border: #333; + --keycap-background: hsl(var(--hue), 25%, 39%); + --keycap-background-active: hsl(var(--hue), 35%, 42%); + --keycap-background-border: hsl(var(--hue), 25%, 35%); + --keycap-background-border-bottom: #426b8a; + --keycap-text: #d0d0d0; + --keycap-text-active: #000; + --keycap-secondary-text: #fff; + --keycap-modifier-background: hsl(var(--hue), 35%, 40%); + --keycap-modifier-border: hsl(var(--hue), 35%, 35%); + --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-background: hsl(var(--hue), 19%, 38%); + --keyboard-alternate-background-active: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-text: #d1d1d1; +} +div.ML__keyboard.material { + --keyboard-background: rgba(209, 213, 217, 0.9); + --keyboard-background-border: #ddd; + --keycap-background: transparent; + --keycap-background-active: #cccfd1; + --keycap-background-border: transparent; + --keyboard-alternate-background: #efefef; + --keyboard-alternate-text: #000; + font-family: Roboto, sans-serif; +} +div.ML__keyboard.material.alternate-keys { + background: var(--keyboard-alternate-background); + border: 1px solid transparent; + border-radius: 5px; + box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); +} +div.ML__keyboard.material.alternate-keys ul li.active, +div.ML__keyboard.material.alternate-keys ul li.pressed, +div.ML__keyboard.material.alternate-keys ul li:active, +div.ML__keyboard.material.alternate-keys ul li:hover { + border: 1px solid transparent; + background: #5f97fc; + color: #fff; + fill: currentColor; +} +div.ML__keyboard.material .keyboard-toolbar > div > div { + font-size: 16px; +} +div.ML__keyboard.material .keyboard-toolbar div.div.active, +div.ML__keyboard.material .keyboard-toolbar div.div.pressed, +div.ML__keyboard.material .keyboard-toolbar div div:active, +div.ML__keyboard.material .keyboard-toolbar div div:hover { + color: #5f97fc; + fill: currentColor; +} +div.ML__keyboard.material .keyboard-toolbar > div > .selected { + color: #5f97fc; + fill: currentColor; + border-bottom: 2px solid #5f97fc; + margin-bottom: 8px; + padding-bottom: 0; +} +div.ML__keyboard.material div > .rows > ul > .keycap { + background: transparent; + border: 1px solid transparent; + border-radius: 5px; + color: var(--keycap-text); + fill: currentColor; + transition: none; +} +div.ML__keyboard.material div > .rows > ul > .keycap.tt { + color: #5f97fc; +} +div.ML__keyboard.material div > .rows > ul > .keycap[data-key=' '] { + margin-top: 10px; + margin-bottom: 10px; + height: 20px; + background: #e0e0e0; +} +div.ML__keyboard.material div > .rows > ul > .keycap[data-key=' '].active, +div.ML__keyboard.material div > .rows > ul > .keycap[data-key=' '].pressed, +div.ML__keyboard.material div > .rows > ul > .keycap[data-key=' ']:active, +div.ML__keyboard.material div > .rows > ul > .keycap[data-key=' ']:hover { + background: #d0d0d0; + box-shadow: none; + transform: none; +} +div.ML__keyboard.material div > .rows > ul > .keycap:not([data-key=' ']):hover { + border: 1px solid transparent; + background: var(--keycap-background-active); + box-shadow: none; +} +div.ML__keyboard.material div > .rows > ul > .keycap:not([data-key=' ']).active, +div.ML__keyboard.material + div + > .rows + > ul + > .keycap:not([data-key=' ']).pressed, +div.ML__keyboard.material + div + > .rows + > ul + > .keycap:not([data-key=' ']):active { + background: var(--keyboard-alternate-background); + color: var(--keyboard-alternate-text); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); +} +@media only screen and (max-width: 767px) { + div.ML__keyboard.material + div + > .rows + > ul + > .keycap:not([data-key=' ']).active, + div.ML__keyboard.material + div + > .rows + > ul + > .keycap:not([data-key=' ']).pressed, + div.ML__keyboard.material + div + > .rows + > ul + > .keycap:not([data-key=' ']):active { + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), + 0 6px 6px rgba(0, 0, 0, 0.23); + font-size: 10px; + vertical-align: top; + width: 19.5px; + margin-right: 10px; + margin-left: 10px; + transform: translateY(-20px) scale(2); + transition: none; + justify-content: flex-start; + padding: 2px 0 0; + z-index: 100; + } +} +@media only screen and (max-width: 414px) { + div.ML__keyboard.material + div + > .rows + > ul + > .keycap:not([data-key=' ']).active, + div.ML__keyboard.material + div + > .rows + > ul + > .keycap:not([data-key=' ']).pressed, + div.ML__keyboard.material + div + > .rows + > ul + > .keycap:not([data-key=' ']):active { + width: 16.5px; + } +} +@media only screen and (max-width: 767px) { + div.ML__keyboard.material div > .rows > ul > .keycap:last-child.active, + div.ML__keyboard.material div > .rows > ul > .keycap:last-child:active { + margin-right: 0; + margin-left: 14px; + } +} +div.ML__keyboard.material div div.rows ul li.action, +div.ML__keyboard.material div div.rows ul li.modifier { + background: transparent; + border: 0; + color: #869096; + fill: currentColor; + font-size: 16px; + transition: none; +} +div.ML__keyboard.material div div.rows ul li.action.selected, +div.ML__keyboard.material div div.rows ul li.modifier.selected { + color: #5f97fc; + border-radius: 0; + border-bottom: 2px solid #5f97fc; +} +div.ML__keyboard.material div div.rows ul li.action.active, +div.ML__keyboard.material div div.rows ul li.action.pressed, +div.ML__keyboard.material div div.rows ul li.action:active, +div.ML__keyboard.material div div.rows ul li.action:hover, +div.ML__keyboard.material div div.rows ul li.modifier.active, +div.ML__keyboard.material div div.rows ul li.modifier.pressed, +div.ML__keyboard.material div div.rows ul li.modifier:active, +div.ML__keyboard.material div div.rows ul li.modifier:hover { + border: 0; + color: var(--keycap-text); + background: var(--keycap-background-active); + box-shadow: none; +} +div.ML__keyboard.material div div.rows ul li.bigfnbutton, +div.ML__keyboard.material div div.rows ul li.fnbutton { + background: transparent; + border: 0; +} +div.ML__keyboard.material div div.rows ul li.bigfnbutton.selected, +div.ML__keyboard.material div div.rows ul li.fnbutton.selected { + color: #5f97fc; + fill: currentColor; + border-radius: 0; + border-bottom: 2px solid #5f97fc; +} +div.ML__keyboard.material div div.rows ul li.bigfnbutton.active, +div.ML__keyboard.material div div.rows ul li.bigfnbutton.pressed, +div.ML__keyboard.material div div.rows ul li.bigfnbutton:active, +div.ML__keyboard.material div div.rows ul li.bigfnbutton:hover, +div.ML__keyboard.material div div.rows ul li.fnbutton.active, +div.ML__keyboard.material div div.rows ul li.fnbutton.pressed, +div.ML__keyboard.material div div.rows ul li.fnbutton:active, +div.ML__keyboard.material div div.rows ul li.fnbutton:hover { + border: 0; + color: #5f97fc; + fill: currentColor; + background: var(--keycap-background-active); + box-shadow: none; +} +@media (prefers-color-scheme: dark) { + body:not([theme='light']) div.ML__keyboard.material { + --hue: 198; + --keyboard-background: hsl(var(--hue), 19%, 18%); + --keyboard-text: #d4d6d7; + --keyboard-text-active: #5f97fc; + --keyboard-background-border: #333; + --keycap-background: hsl(var(--hue), 25%, 39%); + --keycap-background-active: #5f97fc; + --keycap-background-border: transparent; + --keycap-background-border-bottom: transparent; + --keycap-text: #d0d0d0; + --keycap-text-active: #d4d6d7; + --keycap-secondary-text: #5f97fc; + --keycap-modifier-background: hsl(var(--hue), 35%, 40%); + --keycap-modifier-border: hsl(var(--hue), 35%, 35%); + --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-background: hsl(var(--hue), 8%, 2%); + --keyboard-alternate-background-active: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-text: #d1d1d1; + } +} +body[theme='dark'] div.ML__keyboard.material { + --hue: 198; + --keyboard-background: hsl(var(--hue), 19%, 18%); + --keyboard-text: #d4d6d7; + --keyboard-text-active: #5f97fc; + --keyboard-background-border: #333; + --keycap-background: hsl(var(--hue), 25%, 39%); + --keycap-background-active: #5f97fc; + --keycap-background-border: transparent; + --keycap-background-border-bottom: transparent; + --keycap-text: #d0d0d0; + --keycap-text-active: #d4d6d7; + --keycap-secondary-text: #5f97fc; + --keycap-modifier-background: hsl(var(--hue), 35%, 40%); + --keycap-modifier-border: hsl(var(--hue), 35%, 35%); + --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-background: hsl(var(--hue), 8%, 2%); + --keyboard-alternate-background-active: hsl(var(--hue), 35%, 42%); + --keyboard-alternate-text: #d1d1d1; +} +.ML__error { + background-image: radial-gradient( + ellipse at center, + #cc0041, + transparent 70% + ); + background-repeat: repeat-x; + background-size: 3px 3px; + background-position: 0 98%; +} +.ML__suggestion { + opacity: 0.5; +} +.ML__placeholder { + opacity: 0.7; + padding-left: 0.5ex; + padding-right: 0.5ex; +} +.ML__keystroke-caption > span { + min-width: 14px; + margin: 0 8px 0 0; + padding: 4px; + background-color: var(--keystroke); + color: var(--on-keystroke); + fill: currentColor; + font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, + Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, + sans-serif; + font-size: 1em; + border-radius: 6px; + border: 2px solid var(--keystroke-border); +} +.ML__virtual-keyboard-toggle.pressed { + background: hsla(0, 0%, 70%, 0.5); +} +.ML__virtual-keyboard-toggle:focus { + outline: none; + border-radius: 50%; + border: 2px solid var(--primary); +} +.ML__virtual-keyboard-toggle.active, +.ML__virtual-keyboard-toggle.active:hover { + background: hsla(0, 0%, 70%, 0.5); + color: #000; + fill: currentColor; +} +div.ML__popover.is-visible { + visibility: visible; + -webkit-animation: ML__fade-in 0.15s cubic-bezier(0, 0, 0.2, 1); + animation: ML__fade-in 0.15s cubic-bezier(0, 0, 0.2, 1); +} +@-webkit-keyframes ML__fade-in { + 0% { + opacity: 0; + } + to { + opacity: 1; + } +} +@keyframes ML__fade-in { + 0% { + opacity: 0; + } + to { + opacity: 1; + } +} +.ML__popover__content { + border-radius: 6px; + padding: 2px; + cursor: pointer; + min-height: 100px; + display: flex; + flex-direction: column; + justify-content: center; + margin-left: 8px; + margin-right: 8px; +} +.ML__popover__content a { + color: #5ea6fd; + padding-top: 0.3em; + margin-top: 0.4em; + display: block; +} +.ML__popover__content a:hover { + color: #5ea6fd; + text-decoration: underline; +} +.ML__popover__content.active, +.ML__popover__content.pressed, +.ML__popover__content:hover { + background: hsla(0, 0%, 100%, 0.1); +} +.ML__popover__command { + font-size: 1.6rem; +} +.ML__popover__prev-shortcut { + height: 31px; + opacity: 0.1; + cursor: pointer; + margin-left: 8px; + margin-right: 8px; + padding-top: 4px; + padding-bottom: 2px; +} +.ML__popover__next-shortcut:hover, +.ML__popover__prev-shortcut:hover { + opacity: 0.3; +} +.ML__popover__next-shortcut.active, +.ML__popover__next-shortcut.pressed, +.ML__popover__prev-shortcut.active, +.ML__popover__prev-shortcut.pressed { + opacity: 1; +} +.ML__popover__next-shortcut > span, +.ML__popover__prev-shortcut > span { + padding: 5px; + border-radius: 50%; + width: 20px; + height: 20px; + display: inline-block; +} +.ML__popover__prev-shortcut > span > span { + margin-top: -2px; + display: block; +} +.ML__popover__next-shortcut > span > span { + margin-top: 2px; + display: block; +} +.ML__popover__next-shortcut:hover > span, +.ML__popover__prev-shortcut:hover > span { + background: hsla(0, 0%, 100%, 0.1); +} +.ML__popover__next-shortcut { + height: 34px; + opacity: 0.1; + cursor: pointer; + margin-left: 8px; + margin-right: 8px; + padding-top: 2px; + padding-bottom: 4px; +} +.ML__popover__shortcut { + font-size: 0.8em; + margin-top: 0.25em; +} +.ML__popover__note, +.ML__popover__shortcut { + font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, + Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, + sans-serif; + opacity: 0.7; + padding-top: 0.25em; +} +.ML__popover__note { + font-size: 0.8rem; + line-height: 1em; + padding-left: 0.5em; + padding-right: 0.5em; +} +.ML__shortcut-join { + opacity: 0.5; +} +.ML__scroller { + position: fixed; + z-index: 1; + top: 0; + height: 100vh; + width: 200px; +} diff --git a/dist/mathlive.d.ts b/dist/mathlive.d.ts index 0a3397f5f..499bc3641 100644 --- a/dist/mathlive.d.ts +++ b/dist/mathlive.d.ts @@ -38,6 +38,7 @@ declare type MathFieldCallback = (mathfield: MathField) => void; @property {boolean} keypressVibration? @property {string} keypressSound? @property {string} plonkSound? + @property {boolean} readOnly? @property {"mathlive" | "sre"} textToSpeechRules? @property {"ssml" | "mac"} textToSpeechMarkup? @property {object} textToSpeechRulesOptions? @@ -99,6 +100,7 @@ declare type MathFieldConfig = { keypressVibration?: boolean; keypressSound?: string; plonkSound?: string; + readOnly?: boolean; textToSpeechRules?: "mathlive" | "sre"; textToSpeechMarkup?: "ssml" | "mac"; textToSpeechRulesOptions?: any; diff --git a/dist/mathlive.js b/dist/mathlive.js index 97616a4cf..bbedb8866 100644 --- a/dist/mathlive.js +++ b/dist/mathlive.js @@ -3602,7 +3602,7 @@ var global, factory; t.length > 1 || '​' === t ) - return K[e]; + return R[e]; if ('bb' === e || 'scr' === e) { if (!/^[A-Z ]$/.test(t)) return null; } else if ('cal' === e) { @@ -3621,7 +3621,7 @@ var global, factory; ) ) return null; - return K[e]; + return R[e]; })(this.body, e)), t.fontShape && (this.classes += @@ -3664,8 +3664,8 @@ var global, factory; }[e[2] || ''] || ''))); } if ( - (N[e] - ? (this.classes += ' ' + N[e]) + (K[e] + ? (this.classes += ' ' + K[e]) : e && this.setStyle('font-family', e), this.body && this.body.length > 0 && i) ) { @@ -4003,33 +4003,33 @@ var global, factory; const e = t.type; return 'first' === e ? 'none' : 'textord' === e ? 'mord' : e; } - function P(t) { + function I(t) { return t ? Array.isArray(t) ? t.reduce((t, e) => Math.max(t, e.height), 0) : t.height : 0; } - function I(t) { + function P(t) { return t ? Array.isArray(t) ? t.reduce((t, e) => Math.max(t, e.depth), 0) : t.depth : 0; } - function B(t, e) { + function O(t, e) { if (Array.isArray(t)) { const i = []; for (const e of t) e && i.push(e); - if (1 === i.length) return B(i[0], e); + if (1 === i.length) return O(i[0], e); } return new L(t, e); } - function O(t, e, i) { - const s = B(e, i); + function B(t, e, i) { + const s = O(e, i); return (s.type = t), s; } - function R(t, e) { + function $(t, e) { if (!e || 0 === e.length) { if (t instanceof L) return t; if (Array.isArray(t) && 1 === t.length) return t[0]; @@ -4046,7 +4046,7 @@ var global, factory; i ); } - const K = { + const R = { ams: 'AMS-Regular', bb: 'AMS-Regular', cal: 'Caligraphic-Regular', @@ -4058,7 +4058,7 @@ var global, factory; math: 'Math-Regular', mainit: 'Main-Italic', }, - N = { + K = { ams: 'ML__ams', bb: 'ML__bb', cal: 'ML__cal', @@ -4070,7 +4070,7 @@ var global, factory; math: 'ML__mathit', mainit: 'ML__mainit', }; - var $ = { + var N = { coalesce: function t(e) { if (!e || 0 === e.length) return []; e[0].children = t(e[0].children); @@ -4080,29 +4080,29 @@ var global, factory; ((e[s].children = t(e[s].children)), i.push(e[s])); return i; }, - makeSpan: B, + makeSpan: O, makeOp: function(t, e) { - return O('mop', t, e); + return B('mop', t, e); }, makeOrd: function(t, e) { - return O('mord', t, e); + return B('mord', t, e); }, makeRel: function(t, e) { - return O('mrel', t, e); + return B('mrel', t, e); }, makeClose: function(t, e) { - return O('mclose', t, e); + return B('mclose', t, e); }, makeOpen: function(t, e) { - return O('mopen', t, e); + return B('mopen', t, e); }, makeInner: function(t, e) { - return O('minner', t, e); + return B('minner', t, e); }, makePunct: function(t, e) { - return O('mpunct', t, e); + return B('mpunct', t, e); }, - makeSpanOfType: O, + makeSpanOfType: B, makeSymbol: function(t, e, i) { const s = new L(e, i), a = m.getCharacterMetrics(e, t); @@ -4123,7 +4123,7 @@ var global, factory; Array.isArray(e[t]) && (1 === e[t].length ? (e[t] = e[t][0]) - : (e[t] = B(e[t]))); + : (e[t] = O(e[t]))); if ('shift' === i) a = -e[0].depth - s; else if ('bottom' === i) a = -s; else if ('top' === i) { @@ -4168,22 +4168,22 @@ var global, factory; for (const t of e) if ('number' == typeof t) o += t; else { - const e = B([r, t]); + const e = O([r, t]); e.setTop(-t.depth - o), l.push(e), (o += t.height + t.depth); } - const c = B(l, 'vlist'); + const c = O(l, 'vlist'); return ( - (c.depth = Math.max(a, I(c) || 0)), - (c.height = Math.max(-o, P(c) || 0)), + (c.depth = Math.max(a, P(c) || 0)), + (c.height = Math.max(-o, I(c) || 0)), c ); }, - makeHlist: R, + makeHlist: $, makeStyleWrap: function(t, e, i, s, a) { a = a || ''; - const o = R(e, (a += ' style-wrap ') + i.adjustTo(s)); + const o = $(e, (a += ' style-wrap ') + i.adjustTo(s)); o.type = t; const n = s.sizeMultiplier / i.sizeMultiplier; return ( @@ -4196,8 +4196,8 @@ var global, factory; makeSVG: function(t, e, i) { return (t.svgOverlay = e), (t.svgStyle = i), t; }, - height: P, - depth: I, + height: I, + depth: P, skew: function(t) { if (!t) return 0; if (Array.isArray(t)) { @@ -6679,12 +6679,12 @@ var global, factory; LETTER: wt, LETTER_AND_DIGITS: St, }; - const Mt = $.makeSymbol, - Ct = $.makeSpan, - _t = $.makeVlist; + const Mt = N.makeSymbol, + Ct = N.makeSpan, + _t = N.makeVlist; function Tt(t, e, i, s, a, o) { const n = Mt('Size' + i + '-Regular', At.getValue('math', e)), - r = $.makeStyleWrap( + r = N.makeStyleWrap( t, Ct(n, 'delimsizing size' + i), a.mathstyle, @@ -6817,7 +6817,7 @@ var global, factory; _.setStyle('color', a.color), 'number' == typeof a.opacity && _.setStyle('opacity', a.opacity), - $.makeStyleWrap( + N.makeStyleWrap( t, Ct(_, 'delimsizing mult'), a.mathstyle, @@ -6876,7 +6876,7 @@ var global, factory; '\\gt', ], qt = [0, 1.2, 1.8, 2.4, 3], - Pt = [ + It = [ { type: 'small', mathstyle: M.SCRIPTSCRIPT }, { type: 'small', mathstyle: M.SCRIPT }, { type: 'small', mathstyle: M.TEXT }, @@ -6885,13 +6885,13 @@ var global, factory; { type: 'large', size: 3 }, { type: 'large', size: 4 }, ], - It = [ + Pt = [ { type: 'small', mathstyle: M.SCRIPTSCRIPT }, { type: 'small', mathstyle: M.SCRIPT }, { type: 'small', mathstyle: M.TEXT }, { type: 'stack' }, ], - Bt = [ + Ot = [ { type: 'small', mathstyle: M.SCRIPTSCRIPT }, { type: 'small', mathstyle: M.SCRIPT }, { type: 'small', mathstyle: M.TEXT }, @@ -6901,13 +6901,13 @@ var global, factory; { type: 'large', size: 4 }, { type: 'stack' }, ]; - function Ot(t, e, i, s, a, o) { - if (!e || 0 === e.length || '.' === e) return Rt(t, a, t); + function Bt(t, e, i, s, a, o) { + if (!e || 0 === e.length || '.' === e) return $t(t, a, t); let n; '<' === e || '\\lt' === e ? (e = '\\langle') : ('>' !== e && '\\gt' !== e) || (e = '\\rangle'), - (n = Et.includes(e) ? Pt : Dt.includes(e) ? Bt : It); + (n = Et.includes(e) ? It : Dt.includes(e) ? Ot : Pt); const r = (function(t, e, i, s) { for ( let o = Math.min(2, 3 - s.mathstyle.size); @@ -6938,7 +6938,7 @@ var global, factory; return 'small' === r.type ? (function(t, e, i, s, a, o) { const n = Mt('AMS-Regular', At.getValue('math', e)), - r = $.makeStyleWrap(t, n, a.mathstyle, i, o); + r = N.makeStyleWrap(t, n, a.mathstyle, i, o); return ( s && r.setTop( @@ -6957,8 +6957,8 @@ var global, factory; ? Tt(t, e, r.size, s, a, o) : Ft(t, e, i, s, a, o); } - function Rt(t, e, i) { - return $.makeSpanOfType( + function $t(t, e, i) { + return N.makeSpanOfType( t, '', 'sizing' + @@ -6967,10 +6967,10 @@ var global, factory; (i || '') ); } - var Kt = { + var Rt = { makeSizedDelim: function(t, e, i, s, a) { return '.' === e - ? Rt(t, s, a) + ? $t(t, s, a) : ('<' === e || '\\lt' === e ? (e = '\\langle') : ('>' !== e && '\\gt' !== e) || (e = '\\rangle'), @@ -6980,9 +6980,9 @@ var global, factory; ? Ft(t, e, qt[i], !1, s, a) : null); }, - makeCustomSizedDelim: Ot, + makeCustomSizedDelim: Bt, makeLeftRightDelim: function(t, e, i, s, a, o) { - if ('.' === e) return Rt(t, a, o); + if ('.' === e) return $t(t, a, o); const n = a.mathstyle.metrics.axisHeight * a.mathstyle.sizeMultiplier, @@ -6992,15 +6992,15 @@ var global, factory; c = Math.max(l, c); let h = (901 * c) / 500; return ( - (l = 2 * c - r), (h = Math.max(h, l)), Ot(t, e, h, !0, a, o) + (l = 2 * c - r), (h = Math.max(h, l)), Bt(t, e, h, !0, a, o) ); }, }; - const Nt = $.makeSpan, - $t = $.makeOrd, - Wt = $.makeInner, - Ht = $.makeHlist, - Vt = $.makeVlist, + const Kt = N.makeSpan, + Nt = N.makeOrd, + Wt = N.makeInner, + Ht = N.makeHlist, + Vt = N.makeVlist, Ut = /\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/, jt = /^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/, Gt = { @@ -7132,7 +7132,7 @@ var global, factory; } decomposeGroup(t) { const e = t.clone({ mathstyle: this.mathstyle }), - i = $t(Qt(e, this.body)); + i = Nt(Qt(e, this.body)); return ( this.cssId && (i.cssId = this.cssId), i.applyStyle({ @@ -7193,9 +7193,9 @@ var global, factory; t.clone({ mathstyle: this.mathstyle }), s[e] ) || [], - n = [$t(null)].concat(i); - (o = Math.max(o, $.depth(n))), - (a = Math.max(a, $.height(n))), + n = [Nt(null)].concat(i); + (o = Math.max(o, N.depth(n))), + (a = Math.max(a, N.height(n))), h.push(n); } let m = e === p - 1 ? 0 : this.jot || 0; @@ -7235,7 +7235,7 @@ var global, factory; g ? f.push(Xt(2 * h.arraycolsep)) : (y || x) && f.push(Xt(h.arraycolsep)), - f.push(Nt(u[b], 'col-align-' + i.align)), + f.push(Kt(u[b], 'col-align-' + i.align)), b++, (g = !0), (y = !1), @@ -7248,7 +7248,7 @@ var global, factory; (y = !1), (x = !1); else if (i.rule) { - const e = Nt(null, 'vertical-separator'); + const e = Kt(null, 'vertical-separator'); e.setStyle('height', l, 'em'), e.setStyle( 'margin-top', @@ -7274,19 +7274,19 @@ var global, factory; (this.rFence && '.' !== this.rFence) )) ) - return $t(f, 'mtable'); - const k = Nt(f, 'mtable'), - v = $.height(k), - w = $.depth(k); - return $t([ + return Nt(f, 'mtable'); + const k = Kt(f, 'mtable'), + v = N.height(k), + w = N.depth(k); + return Nt([ this.bind( t, - Kt.makeLeftRightDelim('mopen', this.lFence, v, w, t) + Rt.makeLeftRightDelim('mopen', this.lFence, v, w, t) ), k, this.bind( t, - Kt.makeLeftRightDelim('mclose', this.rFence, v, w, t) + Rt.makeLeftRightDelim('mclose', this.rFence, v, w, t) ), ]); } @@ -7297,12 +7297,12 @@ var global, factory; : M.toMathstyle(this.mathstyle), i = t.clone({ mathstyle: e }); let s = []; - this.numerPrefix && s.push($t(this.numerPrefix)); + this.numerPrefix && s.push(Nt(this.numerPrefix)); const a = this.continuousFraction ? e : e.fracNum(); s = s.concat(Qt(i.clone({ mathstyle: a }), this.numer)); const o = Ht(s, t.mathstyle.adjustTo(a)); let n = []; - this.denomPrefix && n.push($t(this.denomPrefix)); + this.denomPrefix && n.push(Nt(this.denomPrefix)); const r = this.continuousFraction ? e : e.fracDen(); n = n.concat(Qt(i.clone({ mathstyle: r }), this.denom)); const l = Ht(n, t.mathstyle.adjustTo(r)), @@ -7332,7 +7332,7 @@ var global, factory; (d += p - (d - u - (t + 0.5 * c))), t - 0.5 * c - (f - m) < p && (m += p - (t - 0.5 * c - (f - m))); - const s = Nt(null, ' frac-line'); + const s = Kt(null, ' frac-line'); s.applyStyle(this.getStyle()), (s.height = c); const a = []; o && (a.push(o), a.push(-d)), @@ -7350,7 +7350,7 @@ var global, factory; : e.metrics.delim2, b = this.bind( t, - Kt.makeCustomSizedDelim( + Rt.makeCustomSizedDelim( 'mopen', this.leftDelim, y, @@ -7360,7 +7360,7 @@ var global, factory; ), x = this.bind( t, - Kt.makeCustomSizedDelim( + Rt.makeCustomSizedDelim( 'mclose', this.rightDelim, y, @@ -7369,7 +7369,7 @@ var global, factory; ) ); b.applyStyle(this.getStyle()), x.applyStyle(this.getStyle()); - const k = $t( + const k = Nt( [b, g, x], t.parentSize !== t.size ? 'sizing reset-' + t.parentSize + ' ' + t.size @@ -7391,18 +7391,19 @@ var global, factory; o = 0, n = []; if ( - ((a = $.height(i) * s.sizeMultiplier), - (o = $.depth(i) * s.sizeMultiplier), + ((a = N.height(i) * s.sizeMultiplier), + (o = N.depth(i) * s.sizeMultiplier), this.leftDelim && (n.push( this.bind( t, - Kt.makeLeftRightDelim( + Rt.makeLeftRightDelim( 'mopen', this.leftDelim, a, o, - e + e, + 'ML__open' ) ) ), @@ -7415,7 +7416,7 @@ var global, factory; r = /ML__selected/.test(i[s].classes); (i[s] = this.bind( t, - Kt.makeLeftRightDelim( + Rt.makeLeftRightDelim( 'minner', i[s].delim, a, @@ -7455,7 +7456,14 @@ var global, factory; n.push( this.bind( t, - Kt.makeLeftRightDelim('mclose', s, a, o, e, i) + Rt.makeLeftRightDelim( + 'mclose', + s, + a, + o, + e, + (i || '') + ' ML__close' + ) ) ), n[n.length - 1].applyStyle(this.getStyle()); @@ -7472,55 +7480,55 @@ var global, factory; const n = Math.max( 2 * a, - ($.height(i) + $.depth(i)) * e.sizeMultiplier + (N.height(i) + N.depth(i)) * e.sizeMultiplier ) + (o + s), - r = Nt( - Kt.makeCustomSizedDelim('', '\\surd', n, !1, t), + r = Kt( + Rt.makeCustomSizedDelim('', '\\surd', n, !1, t), 'sqrt-sign' ); r.applyStyle(this.getStyle()); const l = r.height + r.depth - s; - l > $.height(i) + $.depth(i) + o && - (o = (o + l - ($.height(i) + $.depth(i))) / 2), - r.setTop(r.height - $.height(i) - (o + s)); - const c = Nt(null, t.mathstyle.adjustTo(M.TEXT) + ' sqrt-line'); + l > N.height(i) + N.depth(i) + o && + (o = (o + l - (N.height(i) + N.depth(i))) / 2), + r.setTop(r.height - N.height(i) - (o + s)); + const c = Kt(null, t.mathstyle.adjustTo(M.TEXT) + ' sqrt-line'); c.applyStyle(this.getStyle()), (c.height = s); const d = Vt(t, [i, o, c, s]); - if (!this.index) return this.bind(t, $t([r, d], 'sqrt')); + if (!this.index) return this.bind(t, Nt([r, d], 'sqrt')); const p = t.clone({ mathstyle: M.SCRIPTSCRIPT }), - m = Nt(Qt(p, this.index), e.adjustTo(M.SCRIPTSCRIPT)), + m = Kt(Qt(p, this.index), e.adjustTo(M.SCRIPTSCRIPT)), u = Math.max(r.height, d.height), f = Math.max(r.depth, d.depth), g = Vt(t, [m], 'shift', -0.6 * (u - f)); - return this.bind(t, $t([Nt(g, 'root'), r, d], 'sqrt')); + return this.bind(t, Nt([Kt(g, 'root'), r, d], 'sqrt')); } decomposeAccent(t) { const e = t.mathstyle; let i = Qt(t.cramp(), this.body); (this.superscript || this.subscript) && - (i = this.attachSupsub(t, $t(i), 'mord')); + (i = this.attachSupsub(t, Nt(i), 'mord')); let s = 0; Array.isArray(this.body) && 1 === this.body.length && this.body[0].isCharacterBox() && - (s = $.skew(i)); - const a = Math.min($.height(i), e.metrics.xHeight), - o = $.makeSymbol('Main-Regular', this.accent, 'math'); + (s = N.skew(i)); + const a = Math.min(N.height(i), e.metrics.xHeight), + o = N.makeSymbol('Main-Regular', this.accent, 'math'); o.italic = 0; const n = '⃗' === this.accent ? ' accent-vec' : ''; - let r = Nt(Nt(o), 'accent-body' + n); + let r = Kt(Kt(o), 'accent-body' + n); return ( (r = Vt(t, [i, -a, r])), r.children[1].setLeft(2 * s), - $t(r, 'accent') + Nt(r, 'accent') ); } decomposeLine(t) { const e = t.mathstyle, i = Qt(t.cramp(), this.body), s = h.defaultRuleThickness / e.sizeMultiplier, - a = Nt( + a = Kt( null, t.mathstyle.adjustTo(M.TEXT) + ' ' + @@ -7535,22 +7543,22 @@ var global, factory; ) o = Vt(t, [i, 3 * s, a, s]); else { - const e = Nt(i); - o = Vt(t, [s, a, 3 * s, e], 'top', $.height(e)); + const e = Kt(i); + o = Vt(t, [s, a, 3 * s, e], 'top', N.height(e)); } - return $t(o, this.position); + return Nt(o, this.position); } decomposeOverunder(t) { const e = Qt(t, this.body), i = t.clone({ mathstyle: 'scriptstyle' }), s = this.overscript - ? Nt( + ? Kt( Qt(i, this.overscript), t.mathstyle.adjustTo(i.mathstyle) ) : null, a = this.underscript - ? Nt( + ? Kt( Qt(i, this.underscript), t.mathstyle.adjustTo(i.mathstyle) ) @@ -7558,15 +7566,15 @@ var global, factory; return Yt(t, e, 0, 0, s, a, this.mathtype || 'mrel'); } decomposeOverlap(t) { - const e = Nt(Qt(t, this.body), 'inner'); - return $t( - [e, Nt(null, 'fix')], + const e = Kt(Qt(t, this.body), 'inner'); + return Nt( + [e, Kt(null, 'fix')], 'left' === this.align ? 'llap' : 'rlap' ); } decomposeRule(t) { const e = t.mathstyle, - i = $t('', 'rule'); + i = Nt('', 'rule'); let s = this.shift && !isNaN(this.shift) ? this.shift : 0; s /= e.sizeMultiplier; const a = this.width / e.sizeMultiplier, @@ -7594,7 +7602,7 @@ var global, factory; o = 0; if (this.symbol) { const n = s ? 'Size2-Regular' : 'Size1-Regular'; - (i = $.makeSymbol( + (i = N.makeSymbol( n, this.body, 'op-symbol ' + (s ? 'large-op' : 'small-op') @@ -7607,7 +7615,7 @@ var global, factory; this.bind(t, i); } else Array.isArray(this.body) - ? ((i = $.makeOp(Qt(t, this.body))), this.bind(t, i)) + ? ((i = N.makeOp(Qt(t, this.body))), this.bind(t, i)) : (i = this.makeSpan(t, this.body)); if (this.superscript || this.subscript) { const s = this.limits || 'auto'; @@ -7620,8 +7628,8 @@ var global, factory; return this.symbol && i.setTop(a), i; } decomposeBox(t) { - const e = $t(Qt(t, this.body)), - i = Nt(); + const e = Nt(Qt(t, this.body)), + i = Kt(); i.setStyle('position', 'absolute'); const s = 'number' == typeof this.padding ? this.padding : h.fboxsep; @@ -7643,7 +7651,7 @@ var global, factory; e.setStyle('display', 'inline-block'), e.setStyle('height', e.height + e.depth, 'em'), e.setStyle('vertical-align', -e.depth + s, 'em'); - const a = Nt([i, e]); + const a = Kt([i, e]); return ( a.setStyle('position', 'relative'), a.setStyle('vertical-align', -s + e.depth, 'em'), @@ -7655,7 +7663,7 @@ var global, factory; ); } decomposeEnclose(t) { - const e = $t(Qt(t, this.body)), + const e = Nt(Qt(t, this.body)), i = 'auto' === this.padding ? 0.2 : this.padding; e.setStyle('padding', i, 'em'), e.setStyle('display', 'inline-block'), @@ -7677,7 +7685,7 @@ var global, factory; this.notation.roundedbox && (e.setStyle( 'border-radius', - ($.height(e) + $.depth(e)) / 2, + (N.height(e) + N.depth(e)) / 2, 'em' ), e.setStyle('border', this.borderStyle)), @@ -7731,7 +7739,7 @@ var global, factory; : 'filter: drop-shadow(' + this.shadow + ')'), - $.makeSVG(e, s, t) + N.makeSVG(e, s, t) ); } return e; @@ -7758,11 +7766,11 @@ var global, factory; else if ('leftright' === this.type) i = this.decomposeLeftright(t); else if ('delim' === this.type) - (i = Nt(null, '')), (i.delim = this.delim); + (i = Kt(null, '')), (i.delim = this.delim); else if ('sizeddelim' === this.type) i = this.bind( t, - Kt.makeSizedDelim(this.cls, this.delim, this.size, t) + Rt.makeSizedDelim(this.cls, this.delim, this.size, t) ); else if ('line' === this.type) i = this.decomposeLine(t); else if ('overunder' === this.type) @@ -7771,7 +7779,7 @@ var global, factory; else if ('rule' === this.type) i = this.decomposeRule(t); else if ('styling' === this.type); else if ('msubsup' === this.type) - (i = $t('​')), + (i = Nt('​')), e && ((i.height = e[0].height), (i.depth = e[0].depth)); else if ('mop' === this.type) i = this.decomposeOp(t); else if ('space' === this.type) i = this.makeSpan(t, ' '); @@ -7783,7 +7791,7 @@ var global, factory; ? this.makeSpan(t, ' ') : this.makeSpan(t, ' '); else if (this.width) - (i = Nt('​', 'mspace ')), + (i = Kt('​', 'mspace ')), this.width > 0 ? i.setWidth(this.width) : i.setStyle('margin-left', this.width, 'em'); @@ -7798,7 +7806,7 @@ var global, factory; ',': 'thinspace', '!': 'negativethinspace', }[this.body] || 'quad'; - i = Nt('​', 'mspace ' + t); + i = Kt('​', 'mspace ' + t); } else 'mathstyle' === this.type @@ -7826,6 +7834,15 @@ var global, factory; (Array.isArray(i) ? (i[i.length - 1].caret = this.caret) : (i.caret = this.caret)), + this.containsCaret && + (Array.isArray(i) + ? ((i[0].classes = + (i[0].classes || '') + ' ML__contains-caret'), + (i[i.length - 1].classes = + (i[i.length - 1].classes || '') + + ' ML__contains-caret')) + : (i.classes = + (i.classes || '') + ' ML__contains-caret')), !this.limits && (this.superscript || this.subscript)) ) if (Array.isArray(i)) { @@ -7841,18 +7858,18 @@ var global, factory; o = null; if (this.superscript) { const e = Qt(t.sup(), this.superscript); - a = Nt(e, s.adjustTo(s.sup())); + a = Kt(e, s.adjustTo(s.sup())); } if (this.subscript) { const e = Qt(t.sub(), this.subscript); - o = Nt(e, s.adjustTo(s.sub())); + o = Kt(e, s.adjustTo(s.sub())); } let n, r = 0, l = 0; this.isCharacterBox() || - ((r = $.height(e) - s.metrics.supDrop), - (l = $.depth(e) + s.metrics.subDrop)), + ((r = N.height(e) - s.metrics.supDrop), + (l = N.depth(e) + s.metrics.subDrop)), (n = s === M.DISPLAY ? s.metrics.sup1 @@ -7866,24 +7883,24 @@ var global, factory; (r = Math.max(r, n, a.depth + 0.25 * s.metrics.xHeight)), (l = Math.max(l, s.metrics.sub2)); const i = h.defaultRuleThickness; - if (r - $.depth(a) - ($.height(o) - l) < 4 * i) { - l = 4 * i - (r - a.depth) + $.height(o); - const t = 0.8 * s.metrics.xHeight - (r - $.depth(a)); + if (r - N.depth(a) - (N.height(o) - l) < 4 * i) { + l = 4 * i - (r - a.depth) + N.height(o); + const t = 0.8 * s.metrics.xHeight - (r - N.depth(a)); t > 0 && ((r += t), (l -= t)); } (p = Vt(t, [o, l, a, -r], 'individualShift')), - this.symbol && p.children[0].setLeft(-$.italic(e)); + this.symbol && p.children[0].setLeft(-N.italic(e)); } else o && !a ? ((l = Math.max( l, s.metrics.sub1, - $.height(o) - 0.8 * s.metrics.xHeight + N.height(o) - 0.8 * s.metrics.xHeight )), (p = Vt(t, [o], 'shift', l)), p.children[0].setRight(d), this.isCharacterBox() && - p.children[0].setLeft(-$.italic(e))) + p.children[0].setLeft(-N.italic(e))) : !o && a && ((r = Math.max( @@ -7893,21 +7910,21 @@ var global, factory; )), (p = Vt(t, [a], 'shift', -r)), p.children[0].setRight(d)); - const m = Nt(p, 'msubsup'); + const m = Kt(p, 'msubsup'); return ( this.caret && (m.caret = this.caret), - $.makeSpanOfType(i, [e, m]) + N.makeSpanOfType(i, [e, m]) ); } attachLimits(t, e, i, s) { const a = this.superscript - ? Nt( + ? Kt( Qt(t.sup(), this.superscript), t.mathstyle.adjustTo(t.mathstyle.sup()) ) : null, o = this.subscript - ? Nt( + ? Kt( Qt(t.sub(), this.subscript), t.mathstyle.adjustTo(t.mathstyle.sub()) ) @@ -7945,7 +7962,7 @@ var global, factory; } makeSpan(t, e) { const i = 'textord' === this.type ? 'mord' : this.type, - s = $.makeSpanOfType(i, e), + s = N.makeSpanOfType(i, e), a = this.getStyle(); s.applyStyle(a); const o = a && a.fontSize ? a.fontSize : 'size5'; @@ -7977,13 +7994,13 @@ var global, factory; } } function Xt(t) { - const e = Nt('​', 'arraycolsep'); + const e = Kt('​', 'arraycolsep'); return e.setWidth(t, 'em'), e; } function Jt(t, e, i, s) { const a = []; for (const o of e) { - const e = Nt(Qt(t, s)); + const e = Kt(Qt(t, s)); (e.depth = o.depth), (e.height = o.height), a.push(e), @@ -7993,7 +8010,7 @@ var global, factory; } function Yt(t, e, i, s, a, o, n) { if (!a && !o) return e; - e = Nt(e); + e = Kt(e); let r = 0, l = 0; a && (r = Math.max(h.bigOpSpacing1, h.bigOpSpacing3 - a.depth)), @@ -8003,10 +8020,10 @@ var global, factory; if (o && a) { const n = h.bigOpSpacing5 + - $.height(o) + - $.depth(o) + + N.height(o) + + N.depth(o) + l + - $.depth(e) + + N.depth(e) + i; (c = Vt( t, @@ -8017,15 +8034,15 @@ var global, factory; c.children[0].setLeft(-s), c.children[2].setLeft(s); } else if (o && !a) { - const a = $.height(e) - i; + const a = N.height(e) - i; (c = Vt(t, [h.bigOpSpacing5, o, l, e], 'top', a)), c.children[0].setLeft(-s); } else if (!o && a) { - const o = $.depth(e) + i; + const o = N.depth(e) + i; (c = Vt(t, [e, r, a, h.bigOpSpacing5], 'bottom', o)), c.children[1].setLeft(s); } - return $.makeSpanOfType(n, c, 'op-limits'); + return N.makeSpanOfType(n, c, 'op-limits'); } function Qt(t, e) { function i(t) { @@ -10100,7 +10117,7 @@ var global, factory; Array.isArray(t[e.row]) && (i = t[e.row][e.col] || null), !i || (0 !== i.length && 'first' === i[0].type) || - i.unshift(Be()), + i.unshift(Oe()), i ); } @@ -10216,28 +10233,28 @@ var global, factory; if ( (s || ('^' !== t[0] && '_' !== t[0]) || - ((i = Pe(t.substr(1), { ...e, noWrap: !0 })), + ((i = Ie(t.substr(1), { ...e, noWrap: !0 })), (t = t[0] + '{' + i.match + '}'), (t += qe(i.rest, e)), (s = !0)), s || ((i = t.match(/^(sqrt|\u221a)(.*)/)), i && - ((i = Pe(i[2], { ...e, noWrap: !0 })), + ((i = Ie(i[2], { ...e, noWrap: !0 })), (t = '\\sqrt{' + i.match + '}'), (t += qe(i.rest, e)), (s = !0))), s || ((i = t.match(/^(\\cbrt|\u221b)(.*)/)), i && - ((i = Pe(i[2], { ...e, noWrap: !0 })), + ((i = Ie(i[2], { ...e, noWrap: !0 })), (t = '\\sqrt[3]{' + i.match + '}'), (t += qe(i.rest, e)), (s = !0))), s || ((i = t.match(/^abs(.*)/)), i && - ((i = Pe(i[1], { ...e, noWrap: !0 })), + ((i = Ie(i[1], { ...e, noWrap: !0 })), (t = '\\left|' + i.match + '\\right|'), (t += qe(i.rest, e)), (s = !0))), @@ -10249,10 +10266,10 @@ var global, factory; (s = !0))), s || ((i = t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/)), - i && ((t = Ie(i[1], e)), (t += qe(i[2], e)), (s = !0))), + i && ((t = Pe(i[1], e)), (t += qe(i[2], e)), (s = !0))), !s && /^(f|g|h)[^a-zA-Z]/.test(t) && - ((i = Pe(t.substring(1), { ...e, noWrap: !0 })), + ((i = Ie(t.substring(1), { ...e, noWrap: !0 })), (t = '(' === t[1] ? t[0] + '\\mleft(' + i.match + '\\mright)' @@ -10261,14 +10278,14 @@ var global, factory; (s = !0)), s || ((i = t.match(/^([a-zA-Z]+)(.*)/)), - i && ((t = Ie(i[1], e)), (t += qe(i[2], e)), (s = !0))), + i && ((t = Pe(i[1], e)), (t += qe(i[2], e)), (s = !0))), !s) ) if ( - ((i = Pe(t, { ...e, noWrap: !0 })), + ((i = Ie(t, { ...e, noWrap: !0 })), i.match && '/' === i.rest[0]) ) { - const a = Pe(i.rest.substr(1), { ...e, noWrap: !0 }); + const a = Ie(i.rest.substr(1), { ...e, noWrap: !0 }); a.match && (t = '\\frac{' + @@ -10295,7 +10312,7 @@ var global, factory; t ); } - function Pe(t, e) { + function Ie(t, e) { let i = '', s = (t = t.trim()), a = t.charAt(0), @@ -10340,7 +10357,7 @@ var global, factory; } return { match: i, rest: s }; } - function Ie(t, e) { + function Pe(t, e) { let i = ve.forString('math', null, t, e); return ( i @@ -10351,7 +10368,7 @@ var global, factory; i ); } - function Be() { + function Oe() { return new te.MathAtom('', 'first'); } (we.prototype._announce = function(t, e, i) { @@ -10453,7 +10470,8 @@ var global, factory; (this.path = i), 0 === e && 'placeholder' === this.anchor().type && - ((i[i.length - 1].offset = 0), (e = 1)), + ((i[i.length - 1].offset = this.anchorOffset() - 1), + (e = 1)), (t = { path: i, extent: e || 0 }), (this.path = s); } @@ -10595,7 +10613,7 @@ var global, factory; { (0 !== e[t.relation].length && 'first' === e[t.relation][0].type) || - e[t.relation].unshift(Be()); + e[t.relation].unshift(Oe()); const i = Math.min( t.offset, e[t.relation].length - 1 @@ -10650,7 +10668,7 @@ var global, factory; : ((t = this.parent()[this.relation()] || []), 'string' == typeof t && (t = [])), (0 !== t.length && 'first' === t[0].type) || - t.unshift(Be()), + t.unshift(Oe()), t ); }), @@ -11997,14 +12015,14 @@ var global, factory; (we.prototype.moveToSuperscript_ = function() { if ((this.collapseForward(), !this.anchor().superscript)) if (this.anchor().subscript) - this.anchor().superscript = [Be()]; + this.anchor().superscript = [Oe()]; else { const t = this.sibling(1); t && t.superscript ? (this.path[this.path.length - 1].offset += 1) : t && t.subscript ? ((this.path[this.path.length - 1].offset += 1), - (this.anchor().superscript = [Be()])) + (this.anchor().superscript = [Oe()])) : ('limits' !== this.anchor().limits && (this.siblings().splice( this.anchorOffset() + 1, @@ -12019,7 +12037,7 @@ var global, factory; (this.path[ this.path.length - 1 ].offset += 1)), - (this.anchor().superscript = [Be()])); + (this.anchor().superscript = [Oe()])); } this.path.push({ relation: 'superscript', offset: 0 }), this.selectGroup_(); @@ -12027,14 +12045,14 @@ var global, factory; (we.prototype.moveToSubscript_ = function() { if ((this.collapseForward(), !this.anchor().subscript)) if (this.anchor().superscript) - this.anchor().subscript = [Be()]; + this.anchor().subscript = [Oe()]; else { const t = this.sibling(1); t && t.subscript ? (this.path[this.path.length - 1].offset += 1) : t && t.superscript ? ((this.path[this.path.length - 1].offset += 1), - (this.anchor().subscript = [Be()])) + (this.anchor().subscript = [Oe()])) : ('limits' !== this.anchor().limits && (this.siblings().splice( this.anchorOffset() + 1, @@ -12049,7 +12067,7 @@ var global, factory; (this.path[ this.path.length - 1 ].offset += 1)), - (this.anchor().subscript = [Be()])); + (this.anchor().subscript = [Oe()])); } this.path.push({ relation: 'subscript', offset: 0 }), this.selectGroup_(); @@ -12062,7 +12080,7 @@ var global, factory; numer: 'denom', }[this.relation()]; t || this.moveToSuperscript_(), - this.parent()[t] || (this.parent()[t] = [Be()]), + this.parent()[t] || (this.parent()[t] = [Oe()]), this.setSelection(0, 'end', t); }), (we.prototype.moveBeforeParent_ = function() { @@ -12188,8 +12206,8 @@ var global, factory; }), this.contentDidChange(); }); - var Oe = { EditableMathlist: we, parseMathString: Ee }; - const Re = { + var Be = { EditableMathlist: we, parseMathString: Ee }; + const $e = { '#': '#', '|': '|', '[': 'BracketLeft', @@ -12200,7 +12218,7 @@ var global, factory; '/': 'Slash', '\\': 'Backslash', }, - Ke = { + Re = { Space: 'Spacebar', ' ': 'Spacebar', Escape: 'Esc', @@ -12210,7 +12228,7 @@ var global, factory; ArrowDown: 'Down', Delete: 'Del', }, - Ne = { + Ke = { q: 'KeyQ', w: 'KeyW', e: 'KeyE', @@ -12265,16 +12283,16 @@ var global, factory; '?': 'Shift-Slash', ' ': 'Spacebar', }; - function $e(t) { + function Ne(t) { let e, i = !0; 'Unidentified' === t.key && t.target && - (e = Ne[t.target.value] || t.target.value), + (e = Ke[t.target.value] || t.target.value), e || - (Re[t.key] ? ((e = Re[t.key]), (i = !1)) : (e = Ke[t.key]), - e || (e = Ne[t.key.toLowerCase()])), - !e && t.code && (e = Ke[t.code] || t.code); + ($e[t.key] ? ((e = $e[t.key]), (i = !1)) : (e = Re[t.key]), + e || (e = Ke[t.key.toLowerCase()])), + !e && t.code && (e = Re[t.code] || t.code); const s = []; return ( t.ctrlKey && s.push('Ctrl'), @@ -12334,7 +12352,7 @@ var global, factory; !o && 'CapsLock' !== i.code && !/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code) - ) || ((s = i), (a = null), e.keystroke($e(i), i)) + ) || ((s = i), (a = null), e.keystroke(Ne(i), i)) ); }, !0 @@ -12342,7 +12360,7 @@ var global, factory; c.addEventListener( 'keypress', function(t) { - o || (s && a && e.keystroke($e(s), s), (a = t), r(l)); + o || (s && a && e.keystroke(Ne(s), s), (a = t), r(l)); }, !0 ), @@ -12423,7 +12441,7 @@ var global, factory; var He = { delegateKeyboardEvents: We, select: We.select, - keyboardEventToString: $e, + keyboardEventToString: Ne, eventToChar: function(t) { if (!t) return ''; let e; @@ -12844,14 +12862,14 @@ var global, factory; }, i ), - a = $.makeSpan(s, 'ML__base'), - o = $.makeSpan('', 'ML__strut'); + a = N.makeSpan(s, 'ML__base'), + o = N.makeSpan('', 'ML__strut'); o.setStyle('height', a.height, 'em'); - const r = $.makeSpan('', 'ML__strut--bottom'); + const r = N.makeSpan('', 'ML__strut--bottom'); return ( r.setStyle('height', a.height + a.depth, 'em'), r.setStyle('vertical-align', -a.depth, 'em'), - $.makeSpan([o, r, a], 'ML__mathlive').toMarkup() + N.makeSpan([o, r, a], 'ML__mathlive').toMarkup() ); })(Ve[s] || e, t), o = je(s), @@ -14092,13 +14110,13 @@ var global, factory; let si = {}; const ai = { math: - "\n
      \n
        \n
      • x
      • \n
      • n
      • \n
      • \n \n
      • \n
      • e
      • \n
      • i
      • \n
      • \n
      \n
        \n
      • <
      • \n
      • >
      • \n
      • \n \n
      • \n
      • x ²
      • \n
      • x
      • \n
      • \n
      \n
        \n
      • (
      • \n
      • )
      • \n
      • \n \n
      • \n
      • \n
      • \n
      \n
    \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ", + "\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ", 'lower-roman': "\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ", 'upper-roman': "\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ", symbols: - "\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ", + "\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ", 'lower-greek': "\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ", 'upper-greek': @@ -14110,9 +14128,9 @@ var global, factory; 'symbols-command': "\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ", functions: - "\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ", + "\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ", style: - "\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    ", + "\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    ", }; function oi(t, e, i) { t = t.replace(/(^|[^\\])#@/g, '$1#?'); @@ -14121,14 +14139,14 @@ var global, factory; { mathstyle: 'displaystyle', macros: i.config.macros }, s ), - o = $.makeSpan(a, 'ML__base'), - r = $.makeSpan('', 'ML__strut'); + o = N.makeSpan(a, 'ML__base'), + r = N.makeSpan('', 'ML__strut'); r.setStyle('height', o.height, 'em'); - const l = $.makeSpan('', 'ML__strut--bottom'); + const l = N.makeSpan('', 'ML__strut--bottom'); return ( l.setStyle('height', o.height + o.depth, 'em'), l.setStyle('vertical-align', -o.depth, 'em'), - $.makeSpan([r, l, o], 'ML__mathlive').toMarkup() + N.makeSpan([r, l, o], 'ML__mathlive').toMarkup() ); } function ni(t, e, i) { @@ -15762,16 +15780,16 @@ var global, factory; } else e = t; return e; } - function Pi(t) { + function Ii(t) { if (!t) return null; - const e = qi(Ni(t)), + const e = qi(Ki(t)), i = [Di(e), zi(e)]; return i[0] <= 0 ? null : i; } - function Ii(t) { - return null !== Pi(t); + function Pi(t) { + return null !== Ii(t); } - const Bi = { + const Oi = { '\\lfloor\\rfloor': 'floor', '\\lceil\\rceil': 'ceil', '\\vert\\vert': 'abs', @@ -15786,7 +15804,7 @@ var global, factory; '\\lmoustache\\rmoustache': 'moustache', '\\lbrace\\rbrace': 'brace', }, - Oi = { + Bi = { '!': 'factorial', '\\dag': 'dagger', '\\dagger': 'dagger', @@ -15801,7 +15819,7 @@ var global, factory; '\\_': '_', '\\degree': 'degree', }, - Ri = { + $i = { '+': 'add', '-': 'add', '*': 'multiply', @@ -15817,12 +15835,12 @@ var global, factory; shortEquivalent: 'equivalent', equivalent: 'equivalent', }, - Ki = { ',': 'list', ';': 'list2' }; - function Ni(t) { + Ri = { ',': 'list', ';': 'list2' }; + function Ki(t) { if ('string' == typeof t) return t; if (Array.isArray(t)) { let e = ''; - for (const i of t) e += Ni(i); + for (const i of t) e += Ki(i); return e; } if ( @@ -15834,12 +15852,12 @@ var global, factory; if ('string' == typeof t.body) return t.body; if (Array.isArray(t.body)) { let e = ''; - for (const i of t.body) e += Ni(i); + for (const i of t.body) e += Ki(i); return e; } return ''; } - function $i(t) { + function Ni(t) { return 'string' == typeof t.sym ? (function(t) { let e = Ti[t]; @@ -15897,7 +15915,7 @@ var global, factory; function Zi(t, e, i) { let s = !1; const a = t.atoms[t.index]; - return a && a.type === e && (s = void 0 === i || Ni(a) === i), s; + return a && a.type === e && (s = void 0 === i || Ki(a) === i), s; } function Xi(t, ...e) { const i = { fn: t }; @@ -15951,17 +15969,17 @@ var global, factory; (t.ast.sub = rs(i.subscript, e)), void 0 !== i.superscript && ('msubsup' === i.type - ? /['\u2032]|\\prime/.test(Ni(i.superscript)) + ? /['\u2032]|\\prime/.test(Ki(i.superscript)) ? ((t.index += 1), (i = t.atoms[t.index + 1]), i && 'msubsup' === i.type && - /['\u2032]|\\prime/.test(Ni(i.superscript)) + /['\u2032]|\\prime/.test(Ki(i.superscript)) ? (t.ast.sup = { sym: '″' }) : ((t.ast.sup = { sym: '′' }), (t.index -= 1))) : /['\u2033]|\\doubleprime/.test( - Ni(i.superscript) + Ki(i.superscript) ) ? (t.ast.sup = { sym: '″' }) : t.ast && (t.ast.sup = rs(i.superscript, e)) @@ -15994,8 +16012,8 @@ var global, factory; return ( s && s.latex && - Oi[s.latex.trim()] && - ((t.ast = Xi(Oi[s.latex.trim()], i)), + Bi[s.latex.trim()] && + ((t.ast = Xi(Bi[s.latex.trim()], i)), (t = es((t = ts(t, e)), e))), t ); @@ -16010,20 +16028,20 @@ var global, factory; t.minPrec = 0; let o = t.atoms[t.index]; if (e) { - if ('mopen' === o.type && Ni(o) === e) + if ('mopen' === o.type && Ki(o) === e) (t.index += 1), (o = (t = os(t, s)).atoms[t.index]), o && 'mclose' === o.type && - Ni(o) === i && + Ki(o) === i && (Qi(t) && (t.ast = { group: t.ast }), (t = es((t = ts(t, s)), s))); - else if ('textord' === o.type && Ni(o) === e) + else if ('textord' === o.type && Ki(o) === e) (t.index += 1), (o = (t = os(t, s)).atoms[t.index]), o && 'textord' === o.type && - Ni(o) === i && + Ki(o) === i && ((t.index += 1), (t = es((t = ts(t, s)), s))); else if ( '\\lVert' === e && @@ -16089,7 +16107,7 @@ var global, factory; if ((t = is(t, e, i))) return ( s && (t.index += 1), - (t.ast = { fn: Bi[e + i] || e + i, arg: [t.ast] }), + (t.ast = { fn: Oi[e + i] || e + i, arg: [t.ast] }), (t.minPrec = a), t ); @@ -16100,7 +16118,7 @@ var global, factory; return ( (t.index = t.index || 0), !(t.atoms.length <= 1 || t.index >= t.atoms.length - 1) && - e === Ni(t.atoms[t.index]) + Ni(t.atoms[t.index + 1]) + e === Ki(t.atoms[t.index]) + Ki(t.atoms[t.index + 1]) ); } function as(t) { @@ -16151,7 +16169,7 @@ var global, factory; (t += e.atoms[e.index].body), (e.index += 1); return (e.ast = { text: t }), e; } - const a = qi(Ni(s)); + const a = qi(Ki(s)); if (as(e)) e.ast = Xi(e.ast, t(e, i).ast); else { if ('root' === s.type) @@ -16222,7 +16240,7 @@ var global, factory; } else if ('genfrac' === s.type || 'surd' === s.type) (e.ast = s.toAST(i)), (e = es((e = ts(e, i)), i)); else if ('mord' === s.type || 'mbin' === s.type) { - if (Ei(a) && !Ii(s)) { + if (Ei(a) && !Pi(s)) { e.ast = { fn: a }; const s = (e = ts(e, i)).ast, o = t(e, i).ast; @@ -16238,7 +16256,7 @@ var global, factory; e = es(e, i); } else if ('textord' === s.type) { if ( - !Ii(s) && + !Pi(s) && !At.RIGHT_DELIM[ s.latex ? s.latex.trim() : s.body ] @@ -16261,14 +16279,14 @@ var global, factory; s.latex ) || Ei(a)) && - !Ii(s) + !Pi(s) ) if ( ((e.ast = { fn: /^\\(mathop|operatorname|operatorname\*)/.test( s.latex ) - ? Ni(s.body) + ? Ki(s.body) : a, }), ji((e = ts(e, i)).ast)) @@ -16319,7 +16337,7 @@ var global, factory; const t = is(e, '(', ')', i) || is(e, null, null, i); t ? (e = t) - : Ii(s) || + : Pi(s) || ('placeholder' === s.type ? (e.ast = Ji(0)) : ((e.ast = { text: '?' }), @@ -16350,7 +16368,7 @@ var global, factory; ('mord' === s.type || 'textord' === s.type || 'mop' === s.type) && - Ii(s) + Pi(s) ) return e; const a = e.ast; @@ -16381,11 +16399,11 @@ var global, factory; n = as(t); let r, l; if ( - ((s = !o || 'text' === o.mode || (!n && !Ii(o))), - s || (([r, l] = n ? [Di(n), zi(n)] : Pi(o)), (s = r < a)), + ((s = !o || 'text' === o.mode || (!n && !Pi(o))), + s || (([r, l] = n ? [Di(n), zi(n)] : Ii(o)), (s = r < a)), !s) ) { - const a = n || qi(Ni(o)); + const a = n || qi(Ki(o)); if ( ((t.minPrec = 'left' === l ? r + 1 : r), (t.index += 1), @@ -16421,7 +16439,7 @@ var global, factory; } else s = !0; else { const s = os(t, e).ast; - let o = Ki[a]; + let o = Ri[a]; o && i && i.fn !== o && (i = Xi(o, i)), '-' === a ? i && i.arg && 'add' === i.fn @@ -16450,7 +16468,7 @@ var global, factory; )).toString(), }, }) - : ((o = Ri[a]), + : ((o = $i[a]), 'add' === o && i && 'subtract' === i.fn ? (i = Xi( 'add', @@ -16811,7 +16829,7 @@ var global, factory; : void 0), e ? (r = String.fromCodePoint(parseInt(e[1], 16))) - : ((r = qi(Ni(this))), + : ((r = qi(Ki(this))), r.length > 0 && '\\' === r.charAt(0) && 'string' == typeof this.body && @@ -16932,7 +16950,7 @@ var global, factory; Gi(e) && (a += '_{' + t(e.sub, s) + '}'); } else if (e.group) (a = t(e.group, s)), - Hi(e.group) || $i(e.group) + Hi(e.group) || Ni(e.group) ? 0 !== Ui(e.group) && (a = ls(e.fence || '(),', a)) : (a = ls(e.fence || '(),', a)), ji(e) && (a += '^{' + t(e.sup, s) + '}'), @@ -16976,7 +16994,7 @@ var global, factory; ) (a = t(Fi(e, 0), s)), Hi(Fi(e, 0)) || - $i(Fi(e, 0)) || + Ni(Fi(e, 0)) || (a = ls(e.fence || '(),', a)), (a += '^{' + t(Fi(e, 1), s) + '}'); else if ('equal' === e.fn && e.arg && e.arg.length > 2) @@ -17062,7 +17080,7 @@ var global, factory; } } else if ('string' == typeof e.sym) { - a = $i(e); + a = Ni(e); let i = a.match(/^&#x([0-9a-f]+);$/i); i && i[1] ? (a = String.fromCodePoint(parseInt(i[1], 16))) @@ -17830,7 +17848,7 @@ var global, factory; (o.onAnnounce = this.config.onAnnounce), (o.macros = this.config.macros), (o.removeExtraneousParentheses = this.config.removeExtraneousParentheses), - (this.mathlist = new Oe.EditableMathlist(o, this)), + (this.mathlist = new Be.EditableMathlist(o, this)), (this.undoManager = new (class { constructor(t) { (this.mathlist = t), @@ -18359,14 +18377,15 @@ var global, factory; this.config.onAnnounce(this, t, e, i); } _onFocus() { - this.blurred && - ((this.blurred = !1), - this.textarea.focus && this.textarea.focus(), - 'onfocus' === this.config.virtualKeyboardMode && - this.showVirtualKeyboard_(), - Je.updatePopoverPosition(this), - this.config.onFocus && this.config.onFocus(this), - this._requestUpdate()); + this.config.readOnly || + (this.blurred && + ((this.blurred = !1), + this.textarea.focus && this.textarea.focus(), + 'onfocus' === this.config.virtualKeyboardMode && + this.showVirtualKeyboard_(), + Je.updatePopoverPosition(this), + this.config.onFocus && this.config.onFocus(this), + this._requestUpdate())); } _onBlur() { this.blurred || @@ -18714,7 +18733,7 @@ var global, factory; for (; !i && a < e.length; ) { let t; if (this.keystrokeBufferStates[a]) { - const e = new Oe.EditableMathlist(); + const e = new Be.EditableMathlist(); (e.root = te.makeRoot( 'math', he.parseTokens( @@ -18775,6 +18794,7 @@ var global, factory; !i && !a) ) return !0; + if (this.config.readOnly && 'insert' === a[0]) return !0; this.mathlist.decorateCommandStringAroundInsertionPoint(!1); const r = this.mathlist.parent(); if ( @@ -18852,6 +18872,7 @@ var global, factory; ); } _onTypedText(t, e) { + if (this.config.readOnly) return void this._announce('plonk'); if ( ((e = e || {}).focus && this.$focus(), e.feedback && @@ -18980,14 +19001,29 @@ var global, factory; { relation: 'body', offset: 0 }, ]), this.mathlist.forEach(t => { - (t.caret = ''), (t.isSelected = !1); + (t.caret = ''), + (t.isSelected = !1), + (t.containsCaret = !1); }); const e = this.$hasFocus(); - this.mathlist.isCollapsed() - ? (this.mathlist.anchor().caret = e ? this.mode : '') - : this.mathlist.forEachSelected(t => { - t.isSelected = !0; - }); + if ( + (this.mathlist.isCollapsed() + ? (this.mathlist.anchor().caret = + e && !this.config.readOnly ? this.mode : '') + : this.mathlist.forEachSelected(t => { + t.isSelected = !0; + }), + e && !this.config.readOnly) + ) { + let t = this.mathlist.ancestor(1), + e = 1, + i = !1; + for (; t && !i; ) + ('surd' !== t.type && 'leftright' !== t.type) || + ((t.containsCaret = !0), (i = !0)), + (e += 1), + (t = this.mathlist.ancestor(e)); + } const i = te.decompose( { mathstyle: 'displaystyle', @@ -18999,24 +19035,27 @@ var global, factory; }, this.mathlist.root ), - s = $.makeSpan(i, 'ML__base'); + s = N.makeSpan(i, 'ML__base'); s.attributes = { translate: 'no', 'aria-hidden': 'true' }; - const a = $.makeSpan('', 'ML__strut'); + const a = N.makeSpan('', 'ML__strut'); a.setStyle('height', s.height, 'em'); const o = [a]; if (0 !== s.depth) { - const t = $.makeSpan('', 'ML__strut--bottom'); + const t = N.makeSpan('', 'ML__strut--bottom'); t.setStyle('height', s.height + s.depth, 'em'), t.setStyle('vertical-align', -s.depth, 'em'), o.push(t); } o.push(s); - const n = $.makeSpan(o, 'ML__mathlive'); + const n = N.makeSpan(o, 'ML__mathlive'); (this.field.innerHTML = n.toMarkup( 0, this.config.horizontalSpacingScale )), - this.field.classList.toggle('ML__focused', e), + this.field.classList.toggle( + 'ML__focused', + e && !this.config.readOnly + ), (this.accessibleNode.innerHTML = "" + te.toMathML(this.mathlist.root, this.config) + @@ -20155,14 +20194,15 @@ var global, factory; if ( (this.config || (this.config = { + namespace: '', + overrideDefaultInlineShortcuts: !1, + readOnly: !1, + removeExtraneousParentheses: !0, + scriptDepth: [1 / 0, 1 / 0], smartFence: !0, smartSuperscript: !0, - scriptDepth: [1 / 0, 1 / 0], - removeExtraneousParentheses: !0, - overrideDefaultInlineShortcuts: !1, virtualKeyboard: '', virtualKeyboardLayout: 'qwerty', - namespace: '', }), (this.config = { ...this.config, ...t }), void 0 !== this.config.scriptDepth && @@ -20242,7 +20282,9 @@ var global, factory; ((this.plonkSound = new Audio()), (this.plonkSound.preload = 'none'), (this.plonkSound.src = this.config.plonkSound), - (this.plonkSound.volume = 0.5)); + (this.plonkSound.volume = 0.5)), + this.readOnly && this._onBlur(), + this._requestUpdate(); } speak_(t, e) { e = e || { withHighlighting: !1 }; @@ -20665,34 +20707,34 @@ var global, factory; o = he.parseTokens(a, 'math', null, s); if ('mathlist' === i) return o; let r = te.decompose({ mathstyle: e }, o); - if (((r = $.coalesce(r)), 'span' === i)) return r; - const l = $.makeSpan(r, 'ML__base'), - c = $.makeSpan('', 'ML__strut'); + if (((r = N.coalesce(r)), 'span' === i)) return r; + const l = N.makeSpan(r, 'ML__base'), + c = N.makeSpan('', 'ML__strut'); c.setStyle('height', l.height, 'em'); const h = [c]; if (0 !== l.depth) { - const t = $.makeSpan('', 'ML__strut--bottom'); + const t = N.makeSpan('', 'ML__strut--bottom'); t.setStyle('height', l.height + l.depth, 'em'), t.setStyle('vertical-align', -l.depth, 'em'), h.push(t); } - return h.push(l), $.makeSpan(h, 'ML__mathlive').toMarkup(); + return h.push(l), N.makeSpan(h, 'ML__mathlive').toMarkup(); } - function Ps(t, e) { + function Is(t, e) { if (!te.toMathML) return ''; ((e = e || {}).macros = e.macros || {}), Object.assign(e.macros, At.MACROS); const i = he.parseTokens(n(t), 'math', null, e.macros); return te.toMathML(i, e); } - function Is(t, e) { + function Ps(t, e) { if (!te.toSpeakableText) return ''; ((e = e || {}).macros = e.macros || {}), Object.assign(e.macros, At.MACROS); const i = he.parseTokens(n(t), 'math', null, e.macros); return te.toSpeakableText(i, e); } - function Bs(t, e) { + function Os(t, e) { if ( (!e && window && @@ -20729,7 +20771,7 @@ var global, factory; window && window.speechSynthesis.speak(e); } } - function Os(t, e, i) { + function Bs(t, e, i) { if (!window) return; if ( (!i && window.mathlive && (i = window.mathlive.config), @@ -20892,21 +20934,21 @@ var global, factory; } }); } - function Rs(t) { + function $s(t) { let e = t; if ('string' == typeof t && ((e = document.getElementById(t)), !e)) throw Error(`The element with ID "${t}" could not be found.`); return e; } - function Ks(t, e) { + function Rs(t, e) { Es && (((e = e || {}).renderToMarkup = e.renderToMarkup || qs), - (e.renderToMathML = e.renderToMathML || Ps), - (e.renderToSpeakableText = e.renderToSpeakableText || Is), + (e.renderToMathML = e.renderToMathML || Is), + (e.renderToSpeakableText = e.renderToSpeakableText || Ps), (e.macros = e.macros || At.MACROS), - Es.renderMathInElement(Rs(t), e)); + Es.renderMathInElement($s(t), e)); } - function Ns(t) { + function Ks(t) { if (t.namespace) { if (!/^[a-z]+[-]?$/.test(t.namespace)) throw Error( @@ -20917,8 +20959,8 @@ var global, factory; } return { latexToMarkup: qs, - latexToMathML: Ps, - latexToSpeakableText: Is, + latexToMathML: Is, + latexToSpeakableText: Ps, latexToAST: function(t, e) { if (!te.toAST) return {}; ((e = e || {}).macros = e.macros || {}), @@ -20932,32 +20974,32 @@ var global, factory; makeMathField: function(t, e) { if (!Cs) throw Error('The MathField module is not loaded.'); return ( - ((e = e || {}).handleSpeak = e.handleSpeak || Bs), - (e.handleReadAloud = e.handleReadAloud || Os), - new Cs.MathField(Rs(t), e) + ((e = e || {}).handleSpeak = e.handleSpeak || Os), + (e.handleReadAloud = e.handleReadAloud || Bs), + new Cs.MathField($s(t), e) ); }, renderMathInDocument: function(t) { - Ks(document.body, t); + Rs(document.body, t); }, - renderMathInElement: Ks, + renderMathInElement: Rs, revertToOriginalContent: function(t, e) { - (t = (t = Rs(t)).children[1]) instanceof Cs.MathField + (t = (t = $s(t)).children[1]) instanceof Cs.MathField ? t.revertToOriginalContent() - : (Ns((e = e || {})), + : (Ks((e = e || {})), (t.innerHTML = t.getAttribute( 'data-' + (e.namespace || '') + 'original-content' ))); }, getOriginalContent: function(t, e) { - return (t = (t = Rs(t)).children[1]) instanceof Cs.MathField + return (t = (t = $s(t)).children[1]) instanceof Cs.MathField ? t.originalContent - : (Ns((e = e || {})), + : (Ks((e = e || {})), t.getAttribute( 'data-' + (e.namespace || '') + 'original-content' )); }, - readAloud: Os, + readAloud: Bs, readAloudStatus: function() { return window ? ((window.mathlive = window.mathlive || {}), diff --git a/dist/mathlive.mjs b/dist/mathlive.mjs index 213a78cc1..a72a13b4b 100644 --- a/dist/mathlive.mjs +++ b/dist/mathlive.mjs @@ -1 +1 @@ -function t(t,e){e=e||0;const i=t.charCodeAt(e);if(55296<=i&&i<=56319&&e=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return K[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return K[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(N[e]?this.classes+=" "+N[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function I(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return B(i[0],e)}return new L(t,e)}function O(t,e,i){const s=B(e,i);return s.type=t,s}function R(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const K={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},N={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var $={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,I(c)||0),c.height=Math.max(-o,P(c)||0),c},makeHlist:R,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=R(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:P,depth:I,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=$.makeSymbol,Ct=$.makeSpan,_t=$.makeVlist;function Tt(t,e,i,s,a,o){const n=Mt("Size"+i+"-Regular",At.getValue("math",e)),r=$.makeStyleWrap(t,Ct(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+i)}function Ft(t,e,i,s,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Bt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Ot(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return Rt(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?Pt:Dt.includes(e)?Bt:It;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(At.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=$.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Tt(t,e,r.size,s,a,o):Ft(t,e,i,s,a,o)}function Rt(t,e,i){return $.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Kt={makeSizedDelim:function(t,e,i,s,a){return"."===e?Rt(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,i,!1,s,a):zt.includes(e)?Ft(t,e,qt[i],!1,s,a):null)},makeCustomSizedDelim:Ot,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return Rt(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Ot(t,e,h,!0,a,o)}};const Nt=$.makeSpan,$t=$.makeOrd,Wt=$.makeInner,Ht=$.makeHlist,Vt=$.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=$t(Qt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);t$.height(i)+$.depth(i)+o&&(o=(o+l-($.height(i)+$.depth(i)))/2),r.setTop(r.height-$.height(i)-(o+s));const c=Nt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Vt(t,[i,o,c,s]);if(!this.index)return this.bind(t,$t([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Nt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,$t([Nt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,$t(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=$.skew(i));const a=Math.min($.height(i),e.metrics.xHeight),o=$.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Nt(Nt(o),"accent-body"+n);return r=Vt(t,[i,-a,r]),r.children[1].setLeft(2*s),$t(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Qt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=Nt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[i,3*s,a,s]);else{const e=Nt(i);o=Vt(t,[s,a,3*s,e],"top",$.height(e))}return $t(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?Nt(Qt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?Nt(Qt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Yt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Nt(Qt(t,this.body),"inner");return $t([e,Nt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=$t("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=$.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=$.makeOp(Qt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=$t(Qt(t,this.body)),i=Nt();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=Nt([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=$t(Qt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",($.height(e)+$.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=Nt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Nt(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Nt(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=$.height(e)-s.metrics.supDrop,l=$.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-$.depth(a)-($.height(o)-l)<4*i){l=4*i-(r-a.depth)+$.height(o);const t=.8*s.metrics.xHeight-(r-$.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-$.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,$.height(o)-.8*s.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-$.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Nt(p,"msubsup");return this.caret&&(m.caret=this.caret),$.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?Nt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Nt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=$.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Xt(t){const e=Nt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,i,s){const a=[];for(const o of e){const e=Nt(Qt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Vt(t,a,"individualShift")}function Yt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=Nt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+$.height(o)+$.depth(o)+l+$.depth(e)+i;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=$.height(e)-i;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=$.depth(e)+i;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return $.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const i=new Zt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Zt("","first")),i},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},ie={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var se=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in ie)if(ie[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return se(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new re("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=At.getInfo("\\"+i.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new re(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=At.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=se(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=At.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new re(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=At.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new re(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[i])return ue[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=fe[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=xe(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(i.test(xe(ue[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ce(t,e){let i;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Be()),i}function _e(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Te(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new te.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function Le(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ce(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(De(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||De(t[i],e)})))return!0;if(t.array)for(let i=_e(t.array);i>=0;i--)if(De(Ce(t.array,i),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Pe(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=qe(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Pe(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Pe(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Pe(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=qe(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=Ie(i[1],e),t+=qe(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Pe(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=qe(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=Ie(i[1],e),t+=qe(i[2],e),s=!0)),!s)if(i=Pe(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Pe(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+qe(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+qe(i.rest,e):i.match+qe(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+qe(i[2],e),s=!0)),t}function Pe(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=ve.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function Ie(t,e){let i=ve.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Be(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},we.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new we;s.path=me.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},we.prototype.setRange=function(t,e,i){i=i||{};const s=me.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),s)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Be()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&At.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=_e(e.array);i>=0;i--)t(Ce(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},we.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=_e(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=Se(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},we.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},we.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},we.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=At.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new te.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Be()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Be()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Be()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Be()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Be()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Me(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=Ae(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=At.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Oe={EditableMathlist:we,parseMathString:Ee};const Re={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Ke={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ne={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function $e(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=Ne[t.target.value]||t.target.value),e||(Re[t.key]?(e=Re[t.key],i=!1):e=Ke[t.key],e||(e=Ne[t.key.toLowerCase()])),!e&&t.code&&(e=Ke[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function We(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke($e(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke($e(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:$e,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&Ze(t,i),t.popover.classList.add("is-visible")}function Ze(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Xe(t);const s=e,a=function(t,e){const i=he.parseTokens(n(t),"math",null,e.config.macros),s=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=$.makeSpan(s,"ML__base"),o=$.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=$.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),$.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[s]||e,t),o=je(s),r=ve.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Ye(this,this.array[s][e],t);s1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Ye(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Ye(this,this.shift,t)}em]`),i+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Ye(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ae(this.backgroundcolor)}}`),i+=`{${Ye(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Qe.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Qe.locale.substring(0,2),a="ordinal"===i.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[s]&&(o=Qe.strings[s][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const i=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ti={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ei={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ii={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let si={};const ai={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function oi(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=he.parseTokens(n(t),"math",e,i.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=$.makeSpan(a,"ML__base"),r=$.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=$.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),$.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ni(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ti,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function ri(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ei[n]&&(a.setAttribute("data-shifted",ei[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ei[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=si[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function li(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ci={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ii["foreground-color"]=[];for(const t of ne)ii["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ii["background-color"]=[];for(const t of oe)ii["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});si={...ii},Object.keys(si).forEach(t=>{si[t]=si[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),si[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),si[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),si[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ai,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ti,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ni(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=li(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,ri(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:ri};const hi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},di={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},pi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function mi(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ui(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,gi(t)&&(n=t.index,t.index+=1),yi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=Si(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,gi(t)){const e=Si(t.atoms[n].superscript,0,0,i).mathML,s=Si(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=Si(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function gi(t){return t.index"+t,a+=Si(o.subscript,0,0,i).mathML,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=Si(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function xi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&gi(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Si(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function vi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Ai(t.atoms[l],i),a+=Si(t.atoms,l+1,c,i).mathML,a+=Ai(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function wi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Mi(e.body)+"":Ai(e,i);a+=r,t.index+=1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function Si(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Ai(t,e){let i="";const s=Mi(t.body);return s&&(i=""+s+""),i}function Mi(t){if(!t)return"";if("string"==typeof t)return mi(t);if(!Array.isArray(t)&&"string"==typeof t.body)return mi(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return mi(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Si(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(pi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+Si(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(pi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Si(this.numer,0,0,t).mathML||" ",c+=Si(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Si(this.numer,0,0,t).mathML+"",c+=""+Si(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Si(this.body,0,0,t).mathML,c+=Si(this.index,0,0,t).mathML,c+=""):(c+="",c+=Si(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Si(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(pi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Si(this.body,0,0,t).mathML,c+=""+(pi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):r?(c+=""+Si(l,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):n&&(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+ui(this.id,t)+">"+mi(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&pi[p]?""+pi[p]+"":Ai(this,t);break;case"mpunct":c='"+(pi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Si(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Si(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Si(t,0,0,e).mathML};const Ci={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_i={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ti={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Li={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fi(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Di(t){return t&&Li[t]||-1}function zi(t){return/=|=>/.test(t)?"right":"left"}function Ei(t){if("f"===t||"g"===t)return!0;const e=Ti[t];return!!e&&!!/%[^01_^]?/.test(e)}function qi(t){t=(t||"").trim();let e=Ci[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=At.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Pi(t){if(!t)return null;const e=qi(Ni(t)),i=[Di(e),zi(e)];return i[0]<=0?null:i}function Ii(t){return null!==Pi(t)}const Bi={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Oi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Ri={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Ki={",":"list",";":"list2"};function Ni(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const i of t)e+=Ni(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=Ni(i);return e}return""}function $i(t){return"string"==typeof t.sym?function(t){let e=Ti[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=At.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Wi(t){return parseFloat(t.num)}function Hi(t){return"object"==typeof t&&void 0!==t.num}function Vi(t){let e=0;return Hi(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hs(t.num.re):0:parseFloat(t.num)),e}function Ui(t){let e=0;return Hi(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hs(t.num.im):0),e}function ji(t){return t&&void 0!==t.sup}function Gi(t){return t&&void 0!==t.sub}function Zi(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||Ni(a)===i),s}function Xi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Ji(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Yi(t){if(Hi(t)){const e=Vi(t),i=Ui(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Xi("negate",t)}function Qi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ts(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=rs(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test(Ni(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test(Ni(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ni(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=rs(i.superscript,e)):t.ast.sup=rs(i.superscript,e))):t.index+=1,t}function es(t,e){const i=t.ast;if(ss(t,"!!"))return t.index+=1,t.ast=Xi("factorial2",i),es(t=ts(t,e),e);if(ss(t,"++"))return t.index+=1,t.ast=Xi("increment",i),es(t=ts(t,e),e);if(ss(t,"--"))return t.index+=1,t.ast=Xi("decrement",i),es(t=ts(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Oi[s.latex.trim()]&&(t.ast=Xi(Oi[s.latex.trim()],i),t=es(t=ts(t,e),e)),t}function is(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ni(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"mclose"===o.type&&Ni(o)===i&&(Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s));else if("textord"===o.type&&Ni(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"textord"===o.type&&Ni(o)===i&&(t.index+=1,t=es(t=ts(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=os(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=es(t=ts(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=es(t=ts(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=rs(o.body,s),Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=At.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=At.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=is(t,e,i))return s&&(t.index+=1),t.ast={fn:Bi[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function ss(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ni(t.atoms[t.index])+Ni(t.atoms[t.index+1])}function as(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zi(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,Zi(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zi(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function os(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qi(Ni(s));if(as(e))e.ast=Xi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Yi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Xi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ns(t)))),e=[t])}return e}function rs(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=os(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Xi("text",...i):i[0]||void 0}({atoms:ns(t)},e)}function ls(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function cs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hs(t){return parseFloat(parseFloat(t).toPrecision(15))}function ds(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=cs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=cs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=cs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=hs(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=cs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=cs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}te.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=he.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=he.parseTokens(n(s),"math",null,t.macros),o=Xi("divide",rs(i,t),rs(s,t))):o.fn="divide"):o.group=rs(this.body,t);break;case"genfrac":o=Xi("divide",rs(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Ji(1):rs(this.denom,t));break;case"surd":o=this.index?Xi("pow",rs(this.body,t),Xi("divide",Ji(1),rs(this.index,t))):Xi("sqrt",rs(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qi(Ni(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=rs(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xi("card",rs(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>rs(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(rs(e[0],t));let s=rs(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return rs(t,e)};var ps=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hi(e)){const i=Wi(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":ds(e.num,s);else{const t=Vi(e),i=Ui(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ds(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?ds(i,s):"")+"\\imaginaryI "))}ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Hi(e.group)||$i(e.group)?0!==Ui(e.group)&&(a=ls(e.fence||"(),",a)):a=ls(e.fence||"(),",a),ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fi(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Fi(e,1));else{let i="";for(let s=1;s=2)a=t(Fi(e,0),s),Hi(Fi(e,0))||$i(Fi(e,0))||(a=ls(e.fence||"(),",a)),a+="^{"+t(Fi(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ti[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ls(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fi(e,0),s),r=t(Fi(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ls(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ls(e.fence||"(),","");a=ji(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Gi(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ls("() ",t(a,s))):0!==Vi(o=a)&&0!==Ui(o)?i.push(ls("() ",t(a,s))):ji(e)&&0!==Ui(a)&&1!==Ui(a)?i.push(ls("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hi(e.arg[0])&&"divide"!==e.arg[0].fn||Hi(e.arg[1])&&(0!==Vi(e.arg[1])||1!==Ui(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hi(e.arg[0])&&Wi(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function us(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function fs(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function gs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function ys(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function bs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function xs(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ks(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let i=te.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else us(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ms[t.leftDelim]||t.leftDelim,s+=te.toSpeakableFragment(t.body,e),s+=ms[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ms[a]||(o?ms[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ms[t.body]||ms[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),us(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(us(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),us(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},te.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=te.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=te.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class vs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gs(this.element,"focus",this),gs(this.element,"blur",this),gs(this.textarea,"cut",this),gs(this.textarea,"copy",this),gs(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gs(this.field,"pointerdown",this):gs(this.field,"touchstart:active mousedown",this),gs(window,"resize",this);const o={...e};o.onSelectionDidChange=vs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Oe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ks(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ys(this.textarea,"cut",this),ys(this.textarea,"copy",this),ys(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xs(this.popover),xs(this.keystrokeCaption),xs(this.virtualKeyboard),xs(document.getElementById("mathlive-alternate-keys-panel")),ys(this.element,"pointerdown",this),ys(this.element,"touchstart:active mousedown",this),ys(this.element,"focus",this),ys(this.element,"blur",this),ys(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=me.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){if(this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,i=this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=me.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||Ss>2?(n(t),3!==t.detail&&3!==Ss||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(gs(e.field,"pointermove",h),gs(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gs(window,"blur",n),t.touches?(gs(t.target,"touchmove",h),gs(t.target,"touchend",n)):(gs(window,"mousemove",h),gs(window,"mouseup",n))),2!==t.detail&&2!==Ss||(a=!0,this.mathlist.selectGroup_()))}}else ws=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return As(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=As(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=ve.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=At.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;iks(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1});const e=this.$hasFocus();this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0});const i=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=$.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=$.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=$.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=$.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=hi[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&hi[a]?hi[a]:a&&di[a]?di[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=di[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=te.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const i=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=he.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Je.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gs(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),gs(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gs(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ci.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xs(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=te.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ws,Ss=0;function As(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(i,s)}function Ms(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=As(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=As(t,"",t.mathlist.sibling(0)):"line"===e?(a=As(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?As(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vs.prototype.undo_=vs.prototype.undo,vs.prototype.redo_=vs.prototype.redo,vs.prototype.scrollIntoView_=vs.prototype.scrollIntoView,vs.prototype.scrollToStart_=vs.prototype.scrollToStart,vs.prototype.scrollToEnd_=vs.prototype.scrollToEnd,vs.prototype.insert_=vs.prototype.$insert;var Cs={isValidMathfield:ks,MathField:vs};function _s(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_s(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ds(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Fs(t,void 0,e,!0));else{const s=Ls(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Os(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function Rs(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Ks(t,e){Es&&((e=e||{}).renderToMarkup=e.renderToMarkup||qs,e.renderToMathML=e.renderToMathML||Ps,e.renderToSpeakableText=e.renderToSpeakableText||Is,e.macros=e.macros||At.MACROS,Es.renderMathInElement(Rs(t),e))}function Ns(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const $s={latexToMarkup:qs,latexToMathML:Ps,latexToSpeakableText:Is,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const i=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(i,e)},astToLatex:function(t,e){return ps(t,e)},makeMathField:function(t,e){if(!Cs)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Bs,e.handleReadAloud=e.handleReadAloud||Os,new Cs.MathField(Rs(t),e)},renderMathInDocument:function(t){Ks(document.body,t)},renderMathInElement:Ks,revertToOriginalContent:function(t,e){(t=(t=Rs(t)).children[1])instanceof Cs.MathField?t.revertToOriginalContent():(Ns(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Rs(t)).children[1])instanceof Cs.MathField?t.originalContent:(Ns(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Os,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s=1){const i=t.charCodeAt(e-1),a=s;return 55296<=i&&i<=56319?1024*(i-55296)+(a-56320)+65536:a}return s}function e(e,i){if((i=i||0)<0)return 0;if(i>=e.length-1)return e.length;let a=s(t(e,i));for(let r=i+1;r=this.s.length}get(){return this.pos="0"&&s<="9"?parseInt(s):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],s=t.toString().split(/\r?\n/);let i="",a="";for(const t of s){i+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(i+=e[0])}const n=new o(i);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,s){if("string"==typeof t){const s=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);s?(t=parseFloat(s[1]),e=s[2].toLowerCase()):t=parseFloat(t)}const i={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(s)){const e=Math.pow(10,s);return Math.round(t/h.ptPerEm*i*e)/e}return t/h.ptPerEm*i}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const s={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let i=t.charCodeAt(0);t[0]in d?i=d[t[0]].charCodeAt(0):l.test(t[0])&&(i=77);const a=r[s][i];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,s,i){this.id=t,this.size=e,this.cramped=i,this.sizeMultiplier=s,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const s of t)e+=T(s);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,s=1;this.children&&this.children.forEach(i=>{i.height>t&&(t=i.height),i.depth>e&&(e=i.depth),i.maxFontSize>s&&(s=i.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=s}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let s="Main-Regular";if(e&&(s=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&s){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=s)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let s="",i=this.body||"";if(this.children){let t="none";for(const s of this.children){let a=0;if(t){let i=s.type;i&&("textord"===i&&(i="mord"),"first"===i&&(i="none"),a=s.isTight?E[t+"+"+i]||0:F[t+"+"+i]||0,a=Math.floor(e*a))}i+=s.toMarkup(a,e),t=q(s)}}if("​"!==i&&i||this.classes&&"ML__selected"!==this.classes){if(s="1?e.filter((function(t,e,s){return t.length>0&&s.indexOf(t)===e})).join(" "):e[0],a.length>0&&(s+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?i=z[-t]+i:D[t]?i=D[t]+i:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const s in this.style)Object.prototype.hasOwnProperty.call(this.style,s)&&("background-color"===s&&e||(t+=s+":"+this.style[s]+";"));t.length>0&&(s+=' style="'+t+'"')}s+=">",this.svgOverlay?(s+='",s+=""):s+=i,s+=""}else s="";return this.caret&&"command"!==this.type&&("text"===this.caret?s+='':s+=''),s}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,s=t.children&&t.children.length>0;if(e||s)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==a.length)return!1;i.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function O(t,e){if(Array.isArray(t)){const s=[];for(const e of t)e&&s.push(e);if(1===s.length)return O(s[0],e)}return new L(t,e)}function B(t,e,s){const i=O(e,s);return i.type=t,i}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const s=new L(t,e);let i=1;return i=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),s.height*=i,s.depth*=i,s}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const s=[e[0]];for(let i=1;i0?"em":""),i.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(i,"fontsize-ensurer reset-"+t.size+" size5"):0!==s?i:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=O([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=O(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,s,i,a){a=a||"";const o=$(e,(a+=" style-wrap ")+s.adjustTo(i));o.type=t;const n=i.sizeMultiplier/s.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=i.sizeMultiplier,o},makeSVG:function(t,e,s){return t.svgOverlay=e,t.svgStyle=s,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const s of t)e+=s.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const s="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=s),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=s)}function Y(t,e,s,i,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:s===rt?lt:s,baseFontFamily:e,value:i,category:W,frequency:a}}function Q(t,e){for(let s=t;s<=e;s++){const t=String.fromCodePoint(s);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const s=String.fromCodePoint(e);if("math"===t&&tt[s])return tt[s];if(e>32&&e<127)return s;let i="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===s){i=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===s){i=t;break}return i||s}const st={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},it=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in st)if(Object.prototype.hasOwnProperty.call(st,t)&&st[t]===e){e=t;break}for(let t=0;t=it[t].start&&et.body).join("")}function yt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a=ft(e),o={category:W,params:a,parser:i,mathstyle:"displaystyle",tabular:s.tabular||!0,colFormat:s.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a={category:W,baseFontFamily:s.fontFamily,params:ft(e),allowedInText:!!s.allowedInText,infix:!!s.infix,parse:i};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,s){let i=0;for(const t of s)i=Math.max(i,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let s=e[0]||[];const i={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)i.strokeWidth=m.toPx(t[1],"px"),isFinite(i.strokeWidth)||(i.strokeWidth=1),i.strokeStyle=t[2],i.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?i.backgroundcolor=t[2]:"mathcolor"===t[1]?i.strokeColor=t[2]:"padding"===t[1]?i.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(i.shadow=t[2]))}}"dashed"===i.strokeStyle?i.svgStrokeStyle="5,5":"dotted"===i.strokeStyle&&(i.svgStrokeStyle="1,5")}i.borderStyle=i.strokeWidth+"px "+i.strokeStyle+" "+i.strokeColor,s=s.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),i.notation={};for(const t of s)i.notation[t]=!0;return i.notation.updiagonalarrow&&(i.notation.updiagonalstrike=!1),i.notation.box&&(i.notation.left=!1,i.notation.right=!1,i.notation.bottom=!1,i.notation.top=!1),i})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const s={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":s.hasBarLine=!0;break;case"\\\\atopfrac":s.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s.hasBarLine=!1,s.leftDelim="(",s.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":s.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":s.mathstyle="textstyle"}return"\\cfrac"===t&&(s.continuousFraction=!0),s})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const s=e[0],i=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:s,denom:i,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let s=parseInt(e[0]);return isFinite(s)||(s=10067),{type:"mord",body:String.fromCodePoint(s)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",s=!0;for(const i of t)"string"==typeof i.body?e+=i.body:s=!1;return s?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const s={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(s.limits="nolimits",s.isFunction=!0),s})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const s={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return s.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?s.limits="nolimits":"\\operatorname*"===t&&(s.limits="limits"),s})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,s){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!s)return t;const i=t.codePointAt(0);for(let t=0;t=it[t].offset&&i=1;)i.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?i=H[t]:vt[t]&&(i={value:vt[t]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const s in V)Object.prototype.hasOwnProperty.call(V,s)&&s.startsWith(t)&&!V[s].infix&&e.push({match:s,frequency:V[s].frequency});for(const s in H)Object.prototype.hasOwnProperty.call(H,s)&&s.startsWith(t)&&e.push({match:s,frequency:H[s].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=N.makeSymbol,Ct=N.makeSpan,_t=N.makeVlist;function Tt(t,e,s,i,a,o){const n=Mt("Size"+s+"-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,Ct(n,"delimsizing size"+s),a.mathstyle,M.TEXT,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let s="";return"Size1-Regular"===e?s=" delim-size1":"Size4-Regular"===e&&(s=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+s)}function Ft(t,e,s,i,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((s-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;i&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Ot=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Bt(t,e,s,i,a,o){if(!e||0===e.length||"."===e)return $t(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?It:Dt.includes(e)?Ot:Pt;const r=function(t,e,s,i){for(let o=Math.min(2,3-i.mathstyle.size);oe)return s[o]}var a;return s[s.length-1]}(At.getValue("math",e),s,n,a);return"small"===r.type?function(t,e,s,i,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,s,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier/s.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,i,a,o):"large"===r.type?Tt(t,e,r.size,i,a,o):Ft(t,e,s,i,a,o)}function $t(t,e,s){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(s||""))}var Rt={makeSizedDelim:function(t,e,s,i,a){return"."===e?$t(t,i,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,s,!1,i,a):zt.includes(e)?Ft(t,e,qt[s],!1,i,a):null)},makeCustomSizedDelim:Bt,makeLeftRightDelim:function(t,e,s,i,a,o){if("."===e)return $t(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=i+n,c=s-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Bt(t,e,h,!0,a,o)}};const Kt=N.makeSpan,Nt=N.makeOrd,Wt=N.makeInner,Ht=N.makeHlist,Vt=N.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,s,i){this.mode=t,this.type=e,this.body=s,this.applyStyle(i)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const s of e)for(const e of s)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const s of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[s]))for(const i of this[s])i&&(e=e.concat(i.filter(t)));if(Array.isArray(this.array))for(const s of this.array)for(const i of s)i&&(e=e.concat(i.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),s=Nt(Qt(e,this.body));return this.cssId&&(s.cssId=this.cssId),s.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),s}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const s=[];let i=0;for(const t of e)t.align&&i++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,s,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const s of e){if(s.align&&b>=u.length)break;if(s.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(s)+N.depth(s)+o&&(o=(o+l-(N.height(s)+N.depth(s)))/2),r.setTop(r.height-N.height(s)-(o+i));const c=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=i;const d=Vt(t,[s,o,c,i]);if(!this.index)return this.bind(t,Nt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Kt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,Nt([Kt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let s=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(s=this.attachSupsub(t,Nt(s),"mord"));let i=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(i=N.skew(s));const a=Math.min(N.height(s),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Kt(Kt(o),"accent-body"+n);return r=Vt(t,[s,-a,r]),r.children[1].setLeft(2*i),Nt(r,"accent")}decomposeLine(t){const e=t.mathstyle,s=Qt(t.cramp(),this.body),i=h.defaultRuleThickness/e.sizeMultiplier,a=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=i,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[s,3*i,a,i]);else{const e=Kt(s);o=Vt(t,[i,a,3*i,e],"top",N.height(e))}return Nt(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),s=t.clone({mathstyle:"scriptstyle"}),i=this.overscript?Kt(Qt(s,this.overscript),t.mathstyle.adjustTo(s.mathstyle)):null,a=this.underscript?Kt(Qt(s,this.underscript),t.mathstyle.adjustTo(s.mathstyle)):null;return Yt(t,e,0,0,i,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Kt(Qt(t,this.body),"inner");return Nt([e,Kt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,s=Nt("","rule");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return s.setStyle("border-right-width",a,"em"),s.setStyle("border-top-width",o,"em"),s.setStyle("margin-top",-(o-i),"em"),s.setStyle("border-color",t.color),s.width=a,s.height=o+i,s.depth=-i,s}decomposeOp(t){const e=t.mathstyle;let s,i=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(i=!0);let a=0,o=0;if(this.symbol){const n=i?"Size2-Regular":"Size1-Regular";s=N.makeSymbol(n,this.body,"op-symbol "+(i?"large-op":"small-op")),s.type="mop",a=(s.height-s.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=s.italic,this.bind(t,s)}else Array.isArray(this.body)?(s=N.makeOp(Qt(t,this.body)),this.bind(t,s)):s=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const i=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===i||"auto"===i&&e.size===M.DISPLAY.size?this.attachLimits(t,s,a,o):this.attachSupsub(t,s,"mop")}return this.symbol&&s.setTop(a),s}decomposeBox(t){const e=Nt(Qt(t,this.body)),s=Kt();s.setStyle("position","absolute");const i="number"==typeof this.padding?this.padding:h.fboxsep;s.setStyle("height",e.height+e.depth+2*i,"em"),0!==i?s.setStyle("width","calc(100% + "+2*i+"em)"):s.setStyle("width","100%"),s.setStyle("top",-i,"em"),s.setStyle("left",-i,"em"),s.setStyle("z-index","-1"),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.framecolor&&s.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&s.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+i,"em");const a=Kt([s,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-i+e.depth,"em"),a.height=e.height+i,a.depth=e.depth+i,a.setLeft(i),a.setRight(i),a}decomposeEnclose(t){const e=Nt(Qt(t,this.body)),s="auto"===this.padding?.2:this.padding;e.setStyle("padding",s,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-s,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let i="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(i+='0?s.setWidth(this.width):s.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";s=Kt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?s=this.decomposeBox(t):"enclose"===this.type?s=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(s=this.makeSpan(t,this.body),s.classes="",this.error&&(s.classes+=" ML__error"),this.suggestion&&(s.classes+=" ML__suggestion")):"placeholder"===this.type?s=this.makeSpan(t,"⬚"):"first"===this.type&&(s=this.makeSpan(t,"​"));if(!s)return s;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(s)?s[s.length-1].caret=this.caret:s.caret=this.caret),this.containsCaret&&(Array.isArray(s)?(s[0].classes=(s[0].classes||"")+" ML__contains-caret",s[s.length-1].classes=(s[s.length-1].classes||"")+" ML__contains-caret"):s.classes=(s.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(s)){const e=s[s.length-1];s[s.length-1]=this.attachSupsub(t,e,e.type)}else s=[this.attachSupsub(t,s,s.type)];return Array.isArray(s)?s:[s]}attachSupsub(t,e,s){if(!this.superscript&&!this.subscript)return e;const i=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Kt(e,i.adjustTo(i.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Kt(e,i.adjustTo(i.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-i.metrics.supDrop,l=N.depth(e)+i.metrics.subDrop),n=i===M.DISPLAY?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const c=M.TEXT.sizeMultiplier*i.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const s=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*s){l=4*s-(r-a.depth)+N.height(o);const t=.8*i.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,i.metrics.sub1,N.height(o)-.8*i.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Kt(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(s,[e,m])}attachLimits(t,e,s,i){const a=this.superscript?Kt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Kt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,s,i,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const s="textord"===this.type?"mord":this.type,i=N.makeSpanOfType(s,e),a=this.getStyle();i.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+o):t.parentSize!==t.size&&(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+t.size),i.maxFontSize=Math.max(i.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(i.classes+=" ML__text"),t.mathstyle.isTight()&&(i.isTight=!0),"math"!==this.mode&&(i.italic=0),i.setRight(i.italic),"number"==typeof t.opacity&&i.setStyle("opacity",t.opacity),this.bind(t,i),this.caret&&(this.superscript||this.subscript||(i.caret=this.caret,t.mathstyle.isTight()&&(i.isTight=!0))),i}}function Xt(t){const e=Kt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,s,i){const a=[];for(const o of e){const e=Kt(Qt(t,i));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-s)}return Vt(t,a,"individualShift")}function Yt(t,e,s,i,a,o,n){if(!a&&!o)return e;e=Kt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+s;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-i),c.children[2].setLeft(i)}else if(o&&!a){const a=N.height(e)-s;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-i)}else if(!o&&a){const o=N.depth(e)+s;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(i)}return N.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function s(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function i(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const s=new Zt(t=t||"math","root",e||[]);return 0!==s.body.length&&"first"===s.body[0].type||s.body.unshift(new Zt("","first")),s},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},se={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ie=function(t){const e=t.toLowerCase().split("!");let s,i,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*s,n=(1-l)*n+l*i,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*s,n=l*n+(1-l)*i,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in se)if(se[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,s){this.tokens=t,this.index=0,this.args=e,this.macros=s,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===i.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ie(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let s=10,i=/[0-9]/;this.parseLiteral("'")?(s=8,i=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(s=16,i=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(i);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(i);)a+=this.get().value;const o=t?parseInt(a,s):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),s=new re("math","group");return s.mathstyle=")"===t?"textstyle":"displaystyle",s.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),s.body&&0!==s.body.length?s:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const s=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(s),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),s=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else s.push(this.scanArg(t.type));const i=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,s,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let s=null,i=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!s?(s=this.get(),i=this.swapMathList([])):this.parseAtom();let o;if(s){const t=this.swapMathList(a),e=At.getInfo("\\"+s.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||s.value,e.parse?e.parse("\\"+s.value,[i,t]):null)]:[new re(this.parseMode,"mop",s.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let s=1;for(;!this.end()&&0!==s;)this.hasLiteral("(")&&(s+=1),this.hasLiteral(")")&&(s-=1),0!==s&&this.parseAtom();return 0===s&&this.parseLiteral(")"),t.rightDelim=0===s?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const s=At.getInfo(e,"math",this.macros);return s?"mopen"===s.type||"mclose"===s.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const s=this.scanDelim();if(!s)return null;const i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=s,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(i),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const s=this.scanArg();if(s){const i=this.lastMathAtom();i[e]=i[e]||[],i[e]=i[e].concat(s),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const s=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)i=this.scanString();else if("number"===t)i=this.scanNumber();else if("dimen"===t)i=this.scanDimen();else if("skip"===t)i=this.scanSkip();else if("colspec"===t)i=this.scanColspec();else if("color"===t)i=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ie(e);if(t)i=i||{},i.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)i=i||{},i.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(i=i||{},i.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(s);return i||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const s=this.scanToken();return this.parseMode=e,Array.isArray(s)?s:s?[s]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const s=this.parseMode;this.parseMode=t;const i=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=s;const a=this.swapMathList(i);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const s=this.scanSkip();isFinite(s)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=s),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const s=At.getInfo("\\"+t.value,this.parseMode,this.macros),i=[];let a="",o="";if(s&&s.params)for(const t of s.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)i.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,i.push([e])}else i.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(s&&!s.infix){if(s.parse){const a=s.parse("\\"+t.value,i);if(a.type)e=new re(this.parseMode,s.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new re(this.parseMode,s.type||"mop",s.value||t.value,i),s.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}s||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const s=At.getInfo(t.value,this.parseMode,this.macros);if(s){const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new re(this.parseMode,s.type,s.value||t.value,i),s.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),s&&s.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new re(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let s,i=0;"string"==typeof this.macros[t]?(s=this.macros[t],/(^|[^\\])#1/.test(s)&&(i=1),/(^|[^\\])#2/.test(s)&&(i=2),/(^|[^\\])#3/.test(s)&&(i=3),/(^|[^\\])#4/.test(s)&&(i=4),/(^|[^\\])#5/.test(s)&&(i=5),/(^|[^\\])#6/.test(s)&&(i=6),/(^|[^\\])#7/.test(s)&&(i=7),/(^|[^\\])#8/.test(s)&&(i=8),/(^|[^\\])#9/.test(s)&&(i=9)):(s=this.macros[t].def,i=this.macros[t].args||0);for(let t=1;t<=i;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(s),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=i;t++){if(o+="{",Array.isArray(e[t]))for(let s=0;s1&&(e.extent=parseInt(s[1]));const i=s[0].split("/");for(const t of i){const s=t.match(/([^:]*):(.*)/);s&&e.path.push({relation:s[1],offset:parseInt(s[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let s=0,i=-1,a=!1;for(;!a;)i+=1,a=i>=t.length||i>=e.length,a=a||!(t[i].relation===e[i].relation&&t[i].offset===e[i].offset);return s=i===t.length&&i===e.length?0:i+1===t.length&&i+1===e.length&&t[i].relation===e[i].relation?1:2,s},pathCommonAncestor:function(t,e){const s=[],i=Math.min(t.length-1,e.length-1);let a=0;for(;a<=i&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)s.push(t[a]),a+=1;return s},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,s){if(!s)return s;if("string"==typeof s)return s;if("string"==typeof s.mode&&s.mode!==t)return null;if(!e)return s?s.value:void 0;let i=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return i=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==s.after?/nothing/.test(s.after)&&i||/letter/.test(s.after)&&a||/digit/.test(s.after)&&o||/function/.test(s.after)&&n||/frac/.test(s.after)&&r||/surd/.test(s.after)&&l||/binop/.test(s.after)&&c||/relop/.test(s.after)&&h||/punct/.test(s.after)&&d||/array/.test(s.after)&&p||/openfence/.test(s.after)&&m||/closefence/.test(s.after)&&u||/text/.test(s.after)&&f||/space/.test(s.after)&&g?s.value:null:s.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let s="";Array.isArray(t)||(t=[t]);for(const i of t){let t;const a=i.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}if(t){const i="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!i&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:i?"⌘":"command",Shift:i?"⇧":"shift",Alt:i?"⌥":"alt",Ctrl:i?"⌃":"control","\n":i?"⏎":"return",Return:i?"⏎":"return",Enter:i?"⌤":"enter",Tab:i?"⇥":"tab",Esc:"esc",Backspace:i?"⌫":"backspace",Del:i?"⌦":"del",PageUp:i?"⇞":"page up",PageDown:i?"⇟":"page down",Home:i?"⤒":"home",End:i?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;s.length>0&&(s+=e||" or "),s+=o}}return s}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const s=[];for(let i=0;i<=t.length-1;i++){const a=t.substring(i);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!s.includes(t)&&s.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&s.push(t)})}return s},forString:function(t,e,s,i){let a="";i&&i.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[s]));const o=i&&i.inlineShortcuts?i.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[s])),n||a},selectorForKeystroke:function(t,e){for(const s of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[s])return ue[s];return""},forCommand:function(t){let e=[];if("string"==typeof t){const s=fe[t];Array.isArray(s)?e=s.slice():s&&e.push(s)}t=xe(t);const s=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(s.test(xe(ue[t]))){const s=t.match(/:([^:]*)$/);s&&e.push(s[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let s=0;for(let i=0;i0;)s.col+=1,(!t[s.row]||s.col>=t[s.row].length)&&(s.col=0,s.row+=1),e-=1;return s}function Ce(t,e){let s;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(s=t[e.row][e.col]||null),!s||0!==s.length&&"first"===s[0].type||s.unshift(Oe()),s}function _e(t){let e=0,s=0,i=1;for(const e of t)s+=1,e.length>i&&(i=e.length);return e=s*i,e}function Te(t,e,s){if(!t)return[];e||(e=",");let i,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?a.push(i):i=new te.MathAtom("math","mpunct",e,s),a=a.concat(o));return a}function Le(t,e,s){const i={...e};if(i.row+=s,i.row<0){if(i.col+=s,i.row=t.length-1,i.col<0)return null;for(;i.row>=0&&!Ce(t,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=t.length){for(i.col+=s,i.row=0;i.rowt.length-1)return null}return i}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const s of t)if(De(s,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(s){return s===e||De(t[s],e)})))return!0;if(t.array)for(let s=_e(t.array);s>=0;s--)if(De(Ce(t.array,s),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let s,i=!1;if(i||"^"!==t[0]&&"_"!==t[0]||(s=Ie(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+s.match+"}",t+=qe(s.rest,e),i=!0),i||(s=t.match(/^(sqrt|\u221a)(.*)/),s&&(s=Ie(s[2],{...e,noWrap:!0}),t="\\sqrt{"+s.match+"}",t+=qe(s.rest,e),i=!0)),i||(s=t.match(/^(\\cbrt|\u221b)(.*)/),s&&(s=Ie(s[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+s.match+"}",t+=qe(s.rest,e),i=!0)),i||(s=t.match(/^abs(.*)/),s&&(s=Ie(s[1],{...e,noWrap:!0}),t="\\left|"+s.match+"\\right|",t+=qe(s.rest,e),i=!0)),i||(s=t.match(/^["”“](.*?)["”“](.*)/),s&&(t="\\text{"+s[1]+"}",t+=qe(s[2],e),i=!0)),i||(s=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),s&&(t=Pe(s[1],e),t+=qe(s[2],e),i=!0)),!i&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(s=Ie(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+s.match+"\\mright)":t[0]+s.match,t+=qe(s.rest,e),i=!0),i||(s=t.match(/^([a-zA-Z]+)(.*)/),s&&(t=Pe(s[1],e),t+=qe(s[2],e),i=!0)),!i)if(s=Ie(t,{...e,noWrap:!0}),s.match&&"/"===s.rest[0]){const a=Ie(s.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+s.match+"}{"+a.match+"}"+qe(a.rest,e)),i=!0}else s.match&&(t="("===t[0]?"\\left("+s.match+"\\right)"+qe(s.rest,e):s.match+qe(s.rest,e),i=!0);return i||(s=t.match(/^(\s+)(.*)$/),s&&(t=" "+qe(s[2],e),i=!0)),t}function Ie(t,e){let s="",i=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?s=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),s="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),i=t.substring(r)):(s=t.substring(1,r),i="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let s=ve.forString("math",null,t,e);if(s)return s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),{match:s,rest:t.substring(s.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(i=t.substring(a[1].length),s=a[1]))}return{match:s,rest:i}}function Pe(t,e){let s=ve.forString("math",null,t,e);return s?(s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),s+=" "):s=t,s}function Oe(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,s)},we.prototype.filter=function(t,e){e=e<0?-1:1;const s=[],i=new we;i.path=me.clone(this.path),i.extent=this.extent,i.root=this.root,e>=0?i.collapseForward():(i.collapseBackward(),i.move(1));const a=i.anchor();do{t.bind(i)(i.path,i.anchor())&&s.push(i.toString()),e>=0?i.next({iterateAll:!0}):i.previous({iterateAll:!0})}while(a!==i.anchor());return s},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const s=this.siblings(),i=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=i;e0?0:1)},we.prototype.setRange=function(t,e,s){s=s||{};const i=me.pathDistance(t,e);if(0===i)return s.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===i){const i=e[e.length-1].offset-t[t.length-1].offset;return s.extendToWordBoundary?(t=this.wordBoundary(t,i<0?1:-1),e=this.wordBoundary(e,i<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),i)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let s=0;s0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Oe()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),s=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[s]&&"text"===t[s].mode&&At.LETTER_AND_DIGITS.test(t[s].body);)s+=1;if(s-=1,e>=s)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,s-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),s=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[s]);)s+=1;s-=1,this.setSelection(e,s-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),s=this.startOffset(),i=this.endOffset();for(let a=s;a0&&"command"===t[e].type;)e-=1;let s=this.startOffset()+1;for(;s<=t.length-1&&"command"===t[s].type;)s+=1;return s>e?{start:e+1,end:s}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const s=this.commandOffsets();if(s){const i=t?this.anchorOffset()+1:s.end,a=this.siblings();for(let t=s.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==s.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let s=e.length-1;s>=0;s--)"command"===e[s].type?e.splice(s,1):t(e[s]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let s=_e(e.array);s>=0;s--)t(Ce(e.array,s))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let s=this.startOffset();if("text"===t[s].mode)for(;s>=1&&"text"===t[s].mode;)e.unshift(t[s]),s--;else for(;s>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[s].type);)e.unshift(t[s]),s--;return e},we.prototype.setSelection=function(t,e,s){t=t||0,e=e||0;const i=this.path[this.path.length-1].relation;s||(s=i);const a=this.parent();if(!a&&"body"!==s)return!1;const o=s.startsWith("cell");if(!o&&!a[s]||o&&!a.array)return!1;const n=s!==i;this.path[this.path.length-1].relation=s;const r=this.siblings().length;this.path[this.path.length-1].relation=i;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=s,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let s=e[this.relation()];const i=this.parent();for(;s&&!i[s];)s=e[s];if(s)return void this.setSelection(0,0,s);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const s=this.anchor();if(!s.captureSelection){let t;if(s.array){t="";const e=_e(s.array);let i=e-1;for(;!t&&i0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const s=this.relation();if("denom"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,s);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const s=this.relation();if("numer"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,s);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,s=0;const i=Se(this);s=this.extent+t;const a=e+s;if(a<0&&0!==s){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",i);e=this.path[this.path.length-1].offset,s=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",i);this.isCollapsed()&&(e-=1),s-=1}this.setSelection(e,s),this._announce("move",i)},we.prototype.skip=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(s&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!s)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let s="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(s){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",i)}},we.prototype.jump=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,i.length-1));const o=t<0?0:i.length-1;s?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const i=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;s?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(i,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',s=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let i=s.indexOf(document.activeElement)+t;i<0&&(i=s.length-1),i>=s.length&&(i=0),s[i].focus()}return this.suppressChangeNotifications=s,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",i),this.selectionDidChange(),this.suppressChangeNotifications=s,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e=i.mode),s+=1,i=this.ancestor(s);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e={color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontShape:i.fontShape,fontSeries:i.fontSeries,fontSize:i.fontSize}),s+=1,i=this.ancestor(s);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let s=0,i=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(s++,i=o),"first"!==t[e].body[o].type&&a++;0===a&&1===s&&(t[e]=t[e].body[i])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const s=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const i=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,s){e&&s&&(Array.isArray(e)?e.forEach(e=>t(e,s)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(s),t(e.body,s),t(e.numer,s),t(e.denom,s),t(e.index,s),t(e.overscript,s),t(e.underscript,s),t(e.subscript,s),t(e.superscript,s))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=i,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=s},we.prototype._insertSmartFence=function(t,e){const s=this.parent();if("leftright"===s.type&&"|"!==s.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const i=At.RIGHT_DELIM[t];if(i&&("leftright"!==s.type||"|"!==s.leftDelim)){let s="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;s=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",s+=a?"?":i;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(s,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(s&&"leftright"===s.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),s.rightDelim=t,this.move(1),this.contentDidChange(),!0;const i=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==i[a].type||"?"!==i[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),i[a].rightDelim=t,i[a].body=i[a].body.concat(i.slice(a+1,this.endOffset()+1)),i.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(s&&"leftright"===s.type&&"?"===s.rightDelim){this.contentWillChange(),s.rightDelim=t;const e=i.slice(this.endOffset()+1);return i.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===i.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let s=e.start;for(;s=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const s=[],i=t.substr(e);for(const t of i){const e=new te.MathAtom("command","command",t);e.suggestion=!0,s.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(s))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(s+=1)}i.row+=1}return s}(t,e.col)){!function(t,e){let s=0;for(;s"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==s.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,s.slice(e+1,e+2)),s.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,s.slice(t,e)),s.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Oe()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Oe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Oe()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Oe()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Oe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Oe()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Oe()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const s=this.relation();if(e.array){const i=Me(e.array,s);"after row"===t||"before row"===t?(i.col=0,i.row=i.row+("after row"===t?1:0),e.array.splice(i.row,0,[[]])):(i.col+="after column"===t?1:0,e.array[i.row].splice(i.col,0,[]));const a=Ae(e.array,i);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",s=At.getEnvironmentInfo(e),i=[[t.body]];s.parser&&Object.assign(t,s.parser(e,[],i)),t.tabularMode=s.tabular,t.parseMode=this.anchorMode(),t.env={...s},t.env.name=e,t.array=i,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function s(t,s){let i=!0;return e.forEachSelected(e=>{i=i&&e[t]===s},{recursive:!0}),i}t.color&&s("color",t.color)&&(t.color="none"),t.backgroundColor&&s("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&s("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&s("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&s("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&s("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Be={EditableMathlist:we,parseMathString:Ee};const $e={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Re={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ke={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Ne(t){let e,s=!0;"Unidentified"===t.key&&t.target&&(e=Ke[t.target.value]||t.target.value),e||($e[t.key]?(e=$e[t.key],s=!1):e=Re[t.key],e||(e=Ke[t.key.toLowerCase()])),!e&&t.code&&(e=Re[t.code]||t.code);const i=[];return t.ctrlKey&&i.push("Ctrl"),t.metaKey&&i.push("Meta"),s&&t.altKey&&i.push("Alt"),s&&t.shiftKey&&i.push("Shift"),0===i.length?e:(i.push(e),i.join("-"))}function We(t,e){let s,i=null,a=null,o=!1,n=!1;function r(t){clearTimeout(s),s=setTimeout((function(){clearTimeout(s),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const s=t.value;t.value="",s.length>0&&e.typedText(s)}const c=t||e.container;c.addEventListener("keydown",(function(s){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==s.key&&"Unidentified"!==s.key&&229!==s.keyCode)n=!1;else{n=!0,o=!1;const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i}return!(!o&&"CapsLock"!==s.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(s.code))||(i=s,a=null,e.keystroke(Ne(s),s))}),!0),c.addEventListener("keypress",(function(t){o||(i&&a&&e.keystroke(Ne(i),i),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!i||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const s=t.value;t.value="",s.length>0&&e.paste(s)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){i=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:Ne,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const s=t._getCaretPosition();s&&Ze(t,s),t.popover.classList.add("is-visible")}function Ze(t,e){const s=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>i-a?t.popover.style.left=i-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>s-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,s){if(!e||0===e.length)return void Xe(t);const i=e,a=function(t,e){const s=he.parseTokens(n(t),"math",null,e.config.macros),i=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},s),a=N.makeSpan(i,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[i]||e,t),o=je(i),r=ve.forCommand(i);let l=s?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=s?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,s){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(s&&s.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,s){let i="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";i=function t(e,s,i,a){if(0===i.length)return"";if(0===s.length)return i.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=s[0];let c=i[0][l];"fontFamily"===l&&(c=i[0].fontFamily||i[0].baseFontFamily);const h=function(t,e,s){let i=0;if("fontFamily"===e)for(;t[i]&&("mop"===t[i].type||(t[i].fontFamily||t[i].baseFontFamily)===s);)i++;else for(;t[i]&&("mop"===t[i].type||t[i][e]===s);)i++;return i}(i,l,c);if("text"===i[0].mode){if("fontShape"===l&&i[0].fontShape)"it"===i[0].fontShape?(n="\\textit{",r="}"):"sl"===i[0].fontShape?(n="\\textsl{",r="}"):"sc"===i[0].fontShape?(n="\\textsc{",r="}"):"n"===i[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+i[0].fontShape+"}",r="}");else if("fontSeries"===l&&i[0].fontSeries)"b"===i[0].fontSeries?(n="\\textbf{",r="}"):"l"===i[0].fontSeries?(n="\\textlf{",r="}"):"m"===i[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+i[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(s+=" & "),s+=Ye(this,this.array[i][e],t);i1&&(s+=" "),s+=Ye(this,this.body,t),s+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?s+="("+Ye(this,this.body,t)+")":(s+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(s+=" "),s+=Ye(this,this.body,t),s+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" "));break;case"delim":case"sizeddelim":s+=n+"{"+this.delim+"}";break;case"rule":s+=n,this.shift&&(s+=`[${Ye(this,this.shift,t)}em]`),s+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":s+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":s+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?s+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?s+=this.latex+" ":"\\unicode"===n?(s+='\\unicode{"',s+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),s+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?s+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?s+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(s+="\\limits "),"nolimits"===this.limits&&(s+="\\nolimits "));break;case"box":if("\\bbox"===n){if(s+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),s+=`[${t.join(",")}]`}s+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?s+=`\\boxed{${Ye(this,this.body,t)}}`:(s+=n,this.framecolor&&(s+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(s+=`{${ae(this.backgroundcolor)}}`),s+=`{${Ye(this,this.body,t)}}`);break;case"spacing":s+=n,"\\hspace"===n||"\\hspace*"===n?(s+="{",this.width?s+=this.width+"em":s+="0em",s+="}"):(s+=" ",this.width&&(s+=this.width+"em "));break;case"enclose":if(s+=n,"\\enclose"===n){s+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(s+=t+e,t=" ");s+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(s+=`[${e}]`)}s+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":s+="\\"+this.mathstyle+" ";break;case"space":s+=this.latex;break;case"placeholder":s+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":s+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),s+="^"+e):s+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?s+="_"+e:s+="_{"+e+"}"}return s},Qe.plural=function(t,e,s){(s=s||{}).type=s.type||"cardinal";const i=Qe.locale.substring(0,2),a="ordinal"===s.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===s.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[i]&&(o=Qe.strings[i][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===s.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const s=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=s}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ts={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},es={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ss={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let is={};const as={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function os(t,e,s){t=t.replace(/(^|[^\\])#@/g,"$1#?");const i=he.parseTokens(n(t),"math",e,s.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:s.config.macros},i),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ns(t,e,s){let i="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ts,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;i+="
    "+e[t].label+"
    "}}return i+="
    ",i+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function rs(t,e,s){for(let i=0;i"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&es[n]&&(a.setAttribute("data-shifted",es[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",es[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],s&&(o=[s,o]),a.getAttribute("data-alt-keys")){const t=is[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function ls(t,e){const s={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=s[t.config.virtualKeyboardLayout]?s[t.config.virtualKeyboardLayout]:s.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const s of t){const t=s.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=i[e.name];if(r||(r=s.qwerty[e.name]),r)for(const t of r){let s=e.class||"";s&&(s=" "+s),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(s)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var cs={make:function(t,e){let s='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ss["foreground-color"]=[];for(const t of ne)ss["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ss["background-color"]=[];for(const t of oe)ss["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});is={...ss},Object.keys(is).forEach(t=>{is[t]=is[t].slice()});const i="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];is[e]||(is[e]=[]),is[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),is[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),is[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),is[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),is[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),is[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),is[e].unshift({latex:"\\mathbb{"+i[t]+"}",aside:"blackboard",insert:"\\mathbb{"+i[t]+"}"}),is[e].unshift({latex:"\\mathbf{"+i[t]+"}",aside:"bold",insert:"\\mathbf{"+i[t]+"}"}),is[e].unshift({latex:"\\mathsf{"+i[t]+"}",aside:"sans",insert:"\\mathsf{"+i[t]+"}"}),is[e].unshift({latex:"\\mathcal{"+i[t]+"}",aside:"script",insert:"\\mathcal{"+i[t]+"}"}),is[e].unshift({latex:"\\mathfrak{"+i[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+i[t]+"}"})}for(let t=0;t<=26;t++){const e=i[t];is[e]||(is[e]=[]),is[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),is[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),is[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),is[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];is[e]||(is[e]=[]),is[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),is[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),is[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),is[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),is[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},as,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ts,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let i=n[e].layers||[];n[e].layer&&i.push(n[e].layer),i=Array.from(new Set(i));for(const n of i){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const s of e)t+="${s.label?s.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}s+="
    ",s+=ns(t,a,e);const i="function"==typeof o[n]?o[n]():o[n];s+=ls(t,i),s+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=s,rs(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:rs};const hs={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},ds={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},ps={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function ms(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function us(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(i=!0,gs(t)&&(n=t.index,t.index+=1),ys(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Ss(t.atoms[r].subscript,0,0,s).mathML,a+=Ss(t.atoms[n].superscript,0,0,s).mathML,a+="";else if(n>=0){if(a=""+o,gs(t)){const e=Ss(t.atoms[n].superscript,0,0,s).mathML,i=Ss(t.atoms[n+1].superscript,0,0,s).mathML;a+=""!==e&&""!==e||""!==i&&""!==i?""===e||""===e?"":e:""}else a+=Ss(t.atoms[n].superscript,0,0,s).mathML;a+=""}else r>=0?(a=""+o,a+=Ss(t.atoms[r].subscript,0,0,s).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return i}function gs(t){return t.index"+t,a+=Ss(o.subscript,0,0,s).mathML,a+=Ss(o.superscript,0,0,s).mathML,a+=""):o.superscript?(a=""+t,a+=Ss(o.superscript,0,0,s).mathML,a+=""):o.subscript&&(a=""+t,a+=Ss(o.subscript,0,0,s).mathML,a+=""),a.length>0&&(i=!0,e.mathML+=a,e.lastType=""),i))}function xs(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(i=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),i}function ks(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,s=t.index,i=!1,a=!1;for(;s=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(i=!0,o=""+o+"",n<0&&gs(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Ss(t.atoms[n].superscript,0,0,s).mathML,o+=""),t.mathML+=o,t.lastType="mn"),i}function vs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=As(t.atoms[l],s),a+=Ss(t.atoms,l+1,c,s).mathML,a+=As(t.atoms[c],s),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bs(a,t,s)&&(i=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function ws(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Ss(n.subscript,0,0,s).mathML,a+=Ss(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Ss(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Ss(n.subscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Ms(e.body)+"":As(e,s);a+=r,t.index+=1,bs(a,t,s)&&(i=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function Ss(t,e,s,i){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(s=s||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(i);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function As(t,e){let s="";const i=Ms(t.body);return i&&(s=""+i+""),s}function Ms(t){if(!t)return"";if("string"==typeof t)return ms(t);if(!Array.isArray(t)&&"string"==typeof t.body)return ms(t.body);let e="";for(const s of t)"string"==typeof s.body&&(e+=s.body);return ms(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let i,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Ss(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(ps[this.lFence]||this.lFence)+"")),c+="",i=0;i"+Ss(this.array[a][i],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(ps[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(ps[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Ss(this.numer,0,0,t).mathML||" ",c+=Ss(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Ss(this.numer,0,0,t).mathML+"",c+=""+Ss(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(ps[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Ss(this.body,0,0,t).mathML,c+=Ss(this.index,0,0,t).mathML,c+=""):(c+="",c+=Ss(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(ps[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Ss(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(ps[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(ps[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Ss(this.body,0,0,t).mathML,c+=""+(ps[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Ss(l,0,0,t).mathML,c+=Ss(n,0,0,t).mathML,c+=Ss(r,0,0,t).mathML,c+=""):r?(c+=""+Ss(l,0,0,t).mathML,c+=Ss(r,0,0,t).mathML,c+=""):n&&(c+=""+Ss(l,0,0,t).mathML,c+=Ss(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const s=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;s?c="&#x"+s[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const i=/\d/.test(c)?"mn":"mi";c="<"+i+d+us(this.id,t)+">"+ms(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&ps[p]?""+ps[p]+"":As(this,t);break;case"mpunct":c='"+(ps[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Ss(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Ss(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Ss(t,0,0,e).mathML};const Cs={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_s={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ts={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Ls={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fs(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Ds(t){return t&&Ls[t]||-1}function zs(t){return/=|=>/.test(t)?"right":"left"}function Es(t){if("f"===t||"g"===t)return!0;const e=Ts[t];return!!e&&!!/%[^01_^]?/.test(e)}function qs(t){t=(t||"").trim();let e=Cs[t];if(!e)if(/^\\[^{}]+$/.test(t)){const s=At.getInfo(t,"math",{});e=s&&s.value||t.slice(1)}else e=t;return e}function Is(t){if(!t)return null;const e=qs(Ks(t)),s=[Ds(e),zs(e)];return s[0]<=0?null:s}function Ps(t){return null!==Is(t)}const Os={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Bs={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},$s={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Rs={",":"list",";":"list2"};function Ks(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const s of t)e+=Ks(s);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const s of t.body)e+=Ks(s);return e}return""}function Ns(t){return"string"==typeof t.sym?function(t){let e=Ts[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const s=At.getInfo("\\"+t,"math");!s||s.fontFamily&&"cmr"!==s.fontFamily&&"ams"!==s.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Ws(t){return parseFloat(t.num)}function Hs(t){return"object"==typeof t&&void 0!==t.num}function Vs(t){let e=0;return Hs(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hi(t.num.re):0:parseFloat(t.num)),e}function Us(t){let e=0;return Hs(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hi(t.num.im):0),e}function js(t){return t&&void 0!==t.sup}function Gs(t){return t&&void 0!==t.sub}function Zs(t,e,s){let i=!1;const a=t.atoms[t.index];return a&&a.type===e&&(i=void 0===s||Ks(a)===s),i}function Xs(t,...e){const s={fn:t};if(e){const t=[];for(const s of e)s&&t.push(s);t.length>0&&(s.arg=t)}return s}function Js(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Ys(t){if(Hs(t)){const e=Vs(t),s=Us(t);return 0!==s?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-s).toString()):t.num=(-e).toString(),t}return Xs("negate",t)}function Qs(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ti(t,e){let s=t.atoms[t.index];return!s||void 0===s.superscript&&void 0===s.subscript?s=null:t.index+=1,s||(s=t.atoms[t.index+1],s&&"msubsup"===s.type&&(s.superscript||s.subscript)?t.index+=2:s=null),s?(void 0!==s.subscript&&(t.ast.sub=ri(s.subscript,e)),void 0!==s.superscript&&("msubsup"===s.type?/['\u2032]|\\prime/.test(Ks(s.superscript))?(t.index+=1,s=t.atoms[t.index+1],s&&"msubsup"===s.type&&/['\u2032]|\\prime/.test(Ks(s.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ks(s.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=ri(s.superscript,e)):t.ast.sup=ri(s.superscript,e))):t.index+=1,t}function ei(t,e){const s=t.ast;if(ii(t,"!!"))return t.index+=1,t.ast=Xs("factorial2",s),ei(t=ti(t,e),e);if(ii(t,"++"))return t.index+=1,t.ast=Xs("increment",s),ei(t=ti(t,e),e);if(ii(t,"--"))return t.index+=1,t.ast=Xs("decrement",s),ei(t=ti(t,e),e);const i=t.atoms[t.index];return i&&i.latex&&Bs[i.latex.trim()]&&(t.ast=Xs(Bs[i.latex.trim()],s),t=ei(t=ti(t,e),e)),t}function si(t,e,s,i){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ks(o)===e)t.index+=1,o=(t=oi(t,i)).atoms[t.index],o&&"mclose"===o.type&&Ks(o)===s&&(Qs(t)&&(t.ast={group:t.ast}),t=ei(t=ti(t,i),i));else if("textord"===o.type&&Ks(o)===e)t.index+=1,o=(t=oi(t,i)).atoms[t.index],o&&"textord"===o.type&&Ks(o)===s&&(t.index+=1,t=ei(t=ti(t,i),i));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=oi(t,i)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=ei(t=ti(t,i),i))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=oi(t,i)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===s&&(t.index+=1,t=ei(t=ti(t,i),i));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==s)return;t.ast=ri(o.body,i),Qs(t)&&(t.ast={group:t.ast}),t=ei(t=ti(t,i),i)}return t.minPrec=a,t}{let i=!0;if("mopen"===o.type?(e=o.latex.trim(),s=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,s=At.RIGHT_DELIM[e]):"leftright"===o.type?(i=!1,e=o.leftDelim,"?"===(s=o.rightDelim)&&(s=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),s=At.RIGHT_DELIM[e]),e&&s){if("|"===e&&"|"===s){const i=t.atoms[t.index+1];i&&"textord"===i.type&&"|"===i.latex&&(e="\\lVert",s="\\rVert")}if(t=si(t,e,s))return i&&(t.index+=1),t.ast={fn:Os[e+s]||e+s,arg:[t.ast]},t.minPrec=a,t}}}function ii(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ks(t.atoms[t.index])+Ks(t.atoms[t.index+1])}function ai(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zs(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,s=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return s&&(t.index+=1),s}return t.index+=1,Zs(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zs(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function oi(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let s=function t(e,s){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let i=e.atoms[e.index];if("text"===i.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qs(Ks(i));if(ai(e))e.ast=Xs(e.ast,t(e,s).ast);else{if("root"===i.type)return e.index=0,e.atoms=i.body,t(e,s);if("mbin"===i.type&&"-"===a)e.index+=1,(e=t(e,s)).ast=Ys(e.ast);else if("mbin"===i.type&&"+"===a)e.index+=1,(e=t(e,s)).ast=Xs("add",e.ast);else if("mord"===i.type&&/^[0-9.]$/.test(i.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ni(t)))),e=[t])}return e}function ri(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const s=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;s.push(e)}else{const i=oi(t,e).ast;if(!i)return;s.push(i)}return s.length>1?Xs("text",...s):s[0]||void 0}({atoms:ni(t)},e)}function li(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let s="";if(e.length>0){"."!==t[0]&&(s+=t[0]);let i="";for(const a of e)s+=i+a,i=t[2];"."!==t[1]&&(s+=t[1])}return s}function ci(t,e){const s=t.length;t=t.substr(0,e.precision-2);for(let s=0;s1&&(i+o.repeat(n+1)).startsWith(t))return"0"===o?i.replace(/(\d{3})/g,"$1"+e.groupSeparator):i.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return s!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hi(t){return parseFloat(parseFloat(t).toPrecision(15))}function di(t,e){let s="";if("number"==typeof e.precision){if("number"!=typeof t){let s="",i="";if("-"===t[0]?(s="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(i=a[4]||"","0"===o){let i=0;for(;"0"===n[i]&&i=e.precision)a="0",s="";else{a=t[i];const s=ci(t.substr(i+1),e);s&&(a+=e.decimalMarker+s)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),i>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-i).toString():a+="10^{"+(1-i).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const s=ci(n,e);s&&(t+=e.decimalMarker+s)}}else if(t.length>e.precision){const s=t.length;let i=t[0];const a=ci(t.substr(2),e);a&&(i+=e.decimalMarker+a,"}"!==i[i.length-1]&&(i+="\\ldots")),"1"!==i?i+=e.exponentProduct:i="",e.exponentMarker?i+=e.exponentMarker+(s-2).toString():i+="10^{"+(s-2).toString()+"}",t=i}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return i&&(i=e.exponentMarker?e.exponentMarker+i:e.exponentProduct+" 10^{"+i+"}"),s+t+i}t=hi(t)}if("engineering"===e.scientificNotation)if(0===t)s="0";else{const i=Math.abs(t);let a=Math.round(Math.log10(i));a-=a%3,i<1e3&&(a=0);let o=i/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=ci(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",s=(t<0?"-":"")+o+a}else{const i="string"==typeof t?t:t.toString();let a,o,n,r=i.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=i,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=ci(n,e)),n&&(n=e.decimalMarker+n),s=a+n+(o||"")}return s}te.MathAtom.prototype.toAST=function(t){let e,s,i,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(s=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),s=he.parseTokens(n(s),"math",null,t.macros),i=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),i=he.parseTokens(n(i),"math",null,t.macros),o=Xs("divide",ri(s,t),ri(i,t))):o.fn="divide"):o.group=ri(this.body,t);break;case"genfrac":o=Xs("divide",ri(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Js(1):ri(this.denom,t));break;case"surd":o=this.index?Xs("pow",ri(this.body,t),Xs("divide",Js(1),ri(this.index,t))):Xs("sqrt",ri(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qs(Ks(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=ri(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xs("card",ri(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>ri(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const s=[];s.push(ri(e[0],t));let i=ri(e[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(t=>"string"!=typeof t)),s.push(i||{}),o.args.push(s)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return ri(t,e)};var pi=function t(e,s){const i=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},s);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hs(e)){const s=Ws(e);if(s===-1/0)a="-\\infty ";else if(s===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(s)?"\\text{NaN}":di(e.num,i);else{const t=Vs(e),s=Us(e);isNaN(t)||isNaN(s)?a="\\text{NaN}":Math.abs(s)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=di(t,i)),Math.abs(s)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=s>0?"+":""),a+=(1!==Math.abs(s)?di(s,i):"")+"\\imaginaryI "))}js(e)&&(a+="^{"+t(e.sup,i)+"}"),Gs(e)&&(a+="_{"+t(e.sub,i)+"}")}else if(e.group)a=t(e.group,i),Hs(e.group)||Ns(e.group)?0!==Us(e.group)&&(a=li(e.fence||"(),",a)):a=li(e.fence||"(),",a),js(e)&&(a+="^{"+t(e.sup,i)+"}"),Gs(e)&&(a+="_{"+t(e.sub,i)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fs(e,0),i)+"|_{",e.arg&&2===e.arg.length)a+=t(Fs(e,1));else{let s="";for(let i=1;i=2)a=t(Fs(e,0),i),Hs(Fs(e,0))||Ns(Fs(e,0))||(a=li(e.fence||"(),",a)),a+="^{"+t(Fs(e,1),i)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,i)).join(" = ");else{const s=function(t){let e=Ts[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=s;let o="";if(/%(?![01_^])/.test(s)&&Array.isArray(e.arg)&&e.arg.length>1)a+=li(e.fence||"(),",...e.arg.map(e=>t(e,i)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fs(e,0),i),r=t(Fs(e,1),i),l=[...e.arg];/%0/.test(s)&&(a=a.replace("%0",n),l.shift()),/%1/.test(s)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=li(e.fence||"(),",...l.map(e=>t(e,i))))}else o=li(e.fence||"(),","");a=js(e)?a.replace("%^","^{"+t(e.sup,i)+"}"):a.replace("%^",""),a=Gs(e)?a.replace("%_","_{"+t(e.sub,i)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const s=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?s.push(li("() ",t(a,i))):0!==Vs(o=a)&&0!==Us(o)?s.push(li("() ",t(a,i))):js(e)&&0!==Us(a)&&1!==Us(a)?s.push(li("() ",t(a,i))):s.push(t(a,i));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hs(e.arg[0])&&"divide"!==e.arg[0].fn||Hs(e.arg[1])&&(0!==Vs(e.arg[1])||1!==Us(e.arg[1]))?s.join(" \\times "):s[0]+s[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hs(e.arg[0])&&Ws(e.arg[0])<0?s[0]:"+"+s[0];else{a=s[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function ui(t){let e=0;if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&(e+=1);return 1===e}function fi(t){let e="";if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&"string"==typeof s.body&&(e+=s.body);return e}function gi(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],s,a)}else t.addEventListener(a,s,i)}}function yi(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],s,a)}else t.removeEventListener(a,s,i)}}function bi(t,e){let s=document.getElementById(t);return s?s.setAttribute("data-refcount",parseInt(s.getAttribute("data-refcount"))+1):(s=document.createElement("div"),s.setAttribute("aria-hidden","true"),s.setAttribute("data-refcount","1"),s.className=e,s.id=t,document.body.appendChild(s)),s}function xi(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ki(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function s(t){return""+t+""}if(!t)return"";let i="";if(t.id&&"math"===e.speechMode&&(i+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let s=te.toSpeakableFragment(t.index,e);s=s.trim();const a=s.replace(//g,"");i+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+s+', of '+n+'. End root'}else ui(t.body)?i+=" the square root of "+n+" , ":i+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":i+=mi[t.leftDelim]||t.leftDelim,i+=te.toSpeakableFragment(t.body,e),i+=mi[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":i+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=t.latex?t.latex.trim():"";if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){i=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)i+=a;else{if("mbin"===t.type&&(i+=''),a){const t=mi[a]||(o?mi[o.trim()]:"");if(t)i+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";i+=t||function(t){let s="";return e.textToSpeechMarkup?/[a-z]/.test(t)?s+=' '+t+"":/[A-Z]/.test(t)?s+="capital "+t.toLowerCase():s+=t:/[a-z]/.test(t)?s+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?s+=" 'capital "+t.toUpperCase()+"'":s+=t,s}(a)}}else i+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(i+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let s=te.toSpeakableFragment(t.superscript,e);s=s.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the summation from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=te.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the summation from '+s+' of ',r=!0}else i+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let s=te.toSpeakableFragment(t.superscript,e);s=s.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the product from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=te.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the product from '+s+' of ',r=!0}else i+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),i+=' the integral from '+s(o)+' to '+s(a)+' of ',r=!0}else i+=' the integral of ';else if("string"==typeof t.body){i+=mi[t.body]||mi[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?i+=" "+t.latex.substr(1):i+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),ui(t.body)?i+=" crossed out "+n+" , ":i+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let s=te.toSpeakableFragment(t.superscript,e);s=s.trim();const a=s.replace(/<[^>]*>/g,"");if(ui(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(i+='')}"′"===a?i+=" prime ":"2"===a?i+=" squared ":"3"===a?i+=" cubed ":isNaN(parseInt(a))?i+=" to the "+s+"; ":i+=' to the '+a+" power; "}else isNaN(parseInt(a))?i+=" raised to the "+s+"; ":i+=' raised to the '+a+" power; "}if(!r&&t.subscript){let s=te.toSpeakableFragment(t.subscript,e);s=s.trim(),ui(t.subscript)?i+=" sub "+s:i+=" subscript "+s+". End subscript. "}}return i},te.toSpeakableText=function(t,e){const s=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(s.speechMode="math",window.sre&&"sre"===s.textToSpeechRules){s.generateID=!0;const e=te.toMathML(t,s);return e?(s.textToSpeechMarkup&&(s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup=s.textToSpeechMarkup,"ssml"===s.textToSpeechRulesOptions.markup&&(s.textToSpeechRulesOptions.markup="ssml_step"),s.textToSpeechRulesOptions.rate=s.speechEngineRate),s.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(s.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let i=te.toSpeakableFragment(t,s);if("ssml"===s.textToSpeechMarkup){let t="";s.speechEngineRate&&(t=''),i=''+t+"

    "+i+"

    "+(t?"
    ":"")+""}else i="mac"===s.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?i.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):i.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return i};class vi{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let s=this.element.textContent;s&&(s=s.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?i+="\n \n \n ":i+='',i+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(i+=`"):i+="",i+="",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=i;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bi("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bi("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gi(this.element,"focus",this),gi(this.element,"blur",this),gi(this.textarea,"cut",this),gi(this.textarea,"copy",this),gi(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gi(this.field,"pointerdown",this):gi(this.field,"touchstart:active mousedown",this),gi(window,"resize",this);const o={...e};o.onSelectionDidChange=vi.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vi.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Be.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const s=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=s}}(this.mathlist),s.length>0&&this.$latex(s),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ki(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,yi(this.textarea,"cut",this),yi(this.textarea,"copy",this),yi(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xi(this.popover),xi(this.keystrokeCaption),xi(this.virtualKeyboard),xi(document.getElementById("mathlive-alternate-keys-panel")),yi(this.element,"pointerdown",this),yi(this.element,"touchstart:active mousedown",this),yi(this.element,"focus",this),yi(this.element,"blur",this),yi(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let s;return Array.from(e.children).forEach((function(e){s=s||t(e)})),s}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const s=t.getBoundingClientRect();s.lefte.right&&(e.right=s.right),s.bottom>e.bottom&&(e.bottom=s.bottom),s.top=t.left&&s<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,s,i);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(i=me.pathFromString(e[0]).path,0===s.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const i=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=i=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){if(this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,s=this._pathFromPoint(d,p,{bias:0}),s){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,s),s=me.clone(this.mathlist.path),s[s.length-1].offset-=1):this.mathlist.setPath(s,0),o=!0,this.style={},3===t.detail||Si>2?(n(t),3!==t.detail&&3!==Si||this.mathlist.selectAll_()):i||(i=!0,window.PointerEvent?(gi(e.field,"pointermove",h),gi(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gi(window,"blur",n),t.touches?(gi(t.target,"touchmove",h),gi(t.target,"touchend",n)):(gi(window,"mousemove",h),gi(window,"mouseup",n))),2!==t.detail&&2!==Si||(a=!0,this.mathlist.selectGroup_()))}}else wi=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const s=t?t.path:[],i=this.mathlist.path,a=i[i.length-1];let o="";for(;s.length>i.length;)o+="out of "+e(t.parent(),s[s.length-1])+"; ",s.pop();if(!this.mathlist.isCollapsed())return Ai(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=Ai(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,s)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const s=this.element.getBoundingClientRect();e.style.left=s.left+"px",e.style.top=s.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,s=!1,i=[],a=!1;if(Array.isArray(t)?(e=t[0],i=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...i),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,s=!0}else"function"==typeof this[e]&&(a=this[e](...i),s=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),s}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let s=0,i=!1;for(this.mathlist.contentWillChange();!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),i||(a.applyStyle({mode:"text"}),a.latex=a.body),s-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let s=0,i=!1;for(;!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),i||a.applyStyle({mode:"math",type:"mord"}),s-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,s=!1;for(;!s;){const i=this.mathlist.sibling(e);s=!(i&&("text"===i.mode&&!i.type||"math"===i.mode&&/mord|textord|mpunct/.test(i.type))),s||(t=i.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(s));const i=this.getTextBeforeAnchor_()+s;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(s))return!0;if(/[\^_]/.test(s))return/(^|\s)[a-zA-Z][^_]$/.test(i)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[s];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(i))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(s))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(i))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(i)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(i))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(s))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(i)&&!/(dxd|abc|xyz|uvw)$/.test(i))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(i))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(i)&&!/(αβγ)$/.test(i))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(s))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let s,i,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!s&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const i=this.mode;s?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==i&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(s||a||(a=ve.selectorForKeystroke(this.mode,t)),!s&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!s){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||s)&&s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const s=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[i],{...this.config,suppressChangeNotifications:!0}),this.mode=s}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(s,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),s.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),s=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(s),s))return}let s="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=i(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),i=At.suggest(e+t);a=i.length>1,0===i.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),i[0].match!==e+t&&this.mathlist.insertSuggestion(i[0].match,-i[0].match.length+e.length+1),s=i[0].match)}else if("math"===this.mode){const s={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(s){if("moveToSuperscript"===s){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===s&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(s)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,s,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let s=0;ski(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,s=!1;for(;t&&!s;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,s=!0),e+=1,t=this.mathlist.ancestor(e)}const s=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),i=N.makeSpan(s,"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",i.height,"em");const o=[a];if(0!==i.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",i.height+i.depth,"em"),t.setStyle("vertical-align",-i.depth,"em"),o.push(t)}o.push(i);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let s="";if("latex"===(e=e||"latex")||"latex-expanded"===e)s=t.toLatex("latex-expanded"===e);else if("mathML"===e)s=t.toMathML(this.config);else if("spoken"===e)s=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",s=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const i=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),s=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=i,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);s=JSON.stringify(e)}else"ASCIIMath"===e&&(s=function t(e,s){if(!e)return"";if(Array.isArray(e)){let s="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let i=0;for(s='"';e[i]&&"text"===e[i].mode;)s+=e[i].body,i++;s+='"'+t(e.slice(i))}else{let i=0;for(;e[i]&&"math"===e[i].mode;)s+=t(e[i]),i++;s+=t(e.slice(i))}return s.trim()}if("text"===e.mode)return'"'+e.body+'"';let i="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":i=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(i+="(",i+=t(e.numer),i+=")/(",i+=t(e.denom),i+=")"):(i+="("+t(e.numer)+"),",i+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?i+="root("+t(e.index)+")("+t(e.body)+")":i+="sqrt("+t(e.body)+")";break;case"leftright":i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",i+=t(e.body),i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":i=hs[a]||a||("string"==typeof e.body?e.body:""),"\\"===i[0]&&(i+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?i=String.fromCharCode(parseInt("0x"+o[1])):i.length>0&&"\\"===i.charAt(0)&&(i="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":i=a&&hs[a]?hs[a]:a&&ds[a]?ds[a]:e.body;break;case"mopen":case"mclose":i+=e.body;break;case"mpunct":i=ds[a]||a;break;case"mop":"​"!==e.body&&(i="",i+="\\operatorname"===a?t(e.body):e.body||a,i+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":i=" "}if(e.subscript){i+="_";const s=t(e.subscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}if(e.superscript){i+="^";const s=t(e.superscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}return i}(t,this.config));return s}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const s=te.makeRoot("math",e);return this.formatMathlist(s,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!0:s.subscript&&(i=!1),e+=1,s=this.mathlist.ancestor(e);return i?t:0}_subscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!1:s.subscript&&(i=!0),e+=1,s=this.mathlist.ancestor(e);return i?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const s=this._getSelectionBounds();s&&(t={x:s.right+e.left-this.field.scrollLeft,y:s.top+e.top-this.field.scrollTop})}if(t){const s=t.x-window.scrollX;se.right&&this.field.scroll({top:0,left:s-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const s=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=s)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,s){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,s&&this.$insert(s,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const s=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(s)}else{const s=he.parseTokens(n(e),t,null,this.config.macros);s?this.mathlist.spliceCommandStringAroundInsertionPoint(s):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const s=this.suggestionIndex%e.length,i=t.length-e[s].match.length;0!==i&&this.mathlist.insertSuggestion(e[s].match,i),Je.showPopoverWithLatex(this,e[s].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const s=this;let i,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gi(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),i=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+s.config.namespace+"command-pressed");n&&s.$perform(JSON.parse(n));const l=t.getAttribute("data-"+s.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&s.$perform(JSON.parse(l))}),300))}})),gi(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gi(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?s.style.width="286px":4===e.length||2===e.length?s.style.width="146px":1===e.length?s.style.width="86px":s.style.width="146px",s.style.height="auto";let i="";for(const t of e)i+="";i="
      "+i+"
    ",s.innerHTML=i,cs.makeKeycap(this,s.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-s.clientHeight<0&&(s.style.width="auto",e.length<=6?s.style.height="56px":e.length<=12?s.style.height="108px":s.style.height="205px");const t=(a.top-s.clientHeight+5).toString()+"px",i=Math.max(0,Math.min(window.innerWidth-s.offsetWidth,(a.left+a.right-s.offsetWidth)/2))+"px";s.style.transform="translate("+i+","+t+")",s.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xi(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let s=!1;for(let i=0;i=1){s=[];for(let t=1;t<=i;t++)s.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),i=t.mathlist.endOffset()+1;if(i<=e.length-1){s=[];for(let t=i;t<=e.length-1;t++)s.push(e[t])}break}case"start":case"end":break;case"group":s=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(s=t.mathlist.parent());break}}return s}(this,t);if(null===s)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const i={...this.config};(e.withHighlighting||"amazon"===i.speechEngine)&&(i.textToSpeechMarkup=window.sre&&"sre"===i.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(i.generateID=!0));const a=te.toSpeakableText(s,i);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,i),!1}}let wi,Si=0;function Ai(t,e,s){const i=Object.assign({},t.config);return i.textToSpeechMarkup="",i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(s,i)}function Mi(t,e,s,i){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=Ai(t,"deleted: ",i):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(s):"replacement"===e?a=Ai(t,"",t.mathlist.sibling(0)):"line"===e?(a=Ai(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=i?Ai(t,e+" ",i):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vi.prototype.undo_=vi.prototype.undo,vi.prototype.redo_=vi.prototype.redo,vi.prototype.scrollIntoView_=vi.prototype.scrollIntoView,vi.prototype.scrollToStart_=vi.prototype.scrollToStart,vi.prototype.scrollToEnd_=vi.prototype.scrollToEnd,vi.prototype.insert_=vi.prototype.$insert;var Ci={isValidMathfield:ki,MathField:vi};function _i(t,e,s){let i=s,a=0;const o=t.length;for(;i0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_i(s,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+s.length),mathstyle:i}),c=r+s.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){s.textContent=t}return s.className="sr-only",s}(t,s)),/\bspeakable-text\b/i.test(s.renderAccessibleContent)&&s.renderToSpeakableText){const i=document.createElement("span");i.innerHTML=s.renderToSpeakableText(t,s),i.className="sr-only",e.appendChild(i)}return e.appendChild(a),e}return a}function Di(t,e){let s=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))s=document.createDocumentFragment(),s.appendChild(Fi(t,void 0,e,!0));else{const i=Li(t,e.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;s=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Bi(t,e,s){if(!window)return;if(!s&&window.mathlive&&(s=window.mathlive.config),"amazon"!==(s=s||{}).speechEngine)return void(s.handleSpeak&&s.handleSpeak(e));if(!window.AWS)return;const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:s.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=s.onReadAloudStatus||window.mathlive.onReadAloudStatus;i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),s=new Blob([t.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(s);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const s of window.mathlive.readAloudMarks)s.time0&&Array.from(e.children).forEach(e=>{t(e,s)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=i,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function $i(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Ri(t,e){Ei&&((e=e||{}).renderToMarkup=e.renderToMarkup||qi,e.renderToMathML=e.renderToMathML||Ii,e.renderToSpeakableText=e.renderToSpeakableText||Pi,e.macros=e.macros||At.MACROS,Ei.renderMathInElement($i(t),e))}function Ki(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const Ni={latexToMarkup:qi,latexToMathML:Ii,latexToSpeakableText:Pi,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const s=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(s,e)},astToLatex:function(t,e){return pi(t,e)},makeMathField:function(t,e){if(!Ci)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Oi,e.handleReadAloud=e.handleReadAloud||Bi,new Ci.MathField($i(t),e)},renderMathInDocument:function(t){Ri(document.body,t)},renderMathInElement:Ri,revertToOriginalContent:function(t,e){(t=(t=$i(t)).children[1])instanceof Ci.MathField?t.revertToOriginalContent():(Ki(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=$i(t)).children[1])instanceof Ci.MathField?t.originalContent:(Ki(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Bi,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let s=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(s=e.time/1e3);let i=window.mathlive.readAloudTokens.indexOf(t);i>=0&&(i+=e,i { a.caret = ''; a.isSelected = false; + a.containsCaret = false; }); const hasFocus = this.$hasFocus(); if (this.mathlist.isCollapsed()) { - this.mathlist.anchor().caret = hasFocus ? this.mode : ''; + this.mathlist.anchor().caret = + hasFocus && !this.config.readOnly ? this.mode : ''; } else { this.mathlist.forEachSelected(a => { a.isSelected = true; }); } + + if (hasFocus && !this.config.readOnly) { + let ancestor = this.mathlist.ancestor(1); + let i = 1; + let done = false; + while (ancestor && !done) { + if (ancestor.type === 'surd' || ancestor.type === 'leftright') { + ancestor.containsCaret = true; + done = true; + } + i += 1; + ancestor = this.mathlist.ancestor(i); + } + } // // 4. Create spans corresponding to the updated mathlist // @@ -2226,7 +2251,10 @@ class MathField { 0, this.config.horizontalSpacingScale ); - this.field.classList.toggle('ML__focused', hasFocus); + this.field.classList.toggle( + 'ML__focused', + hasFocus && !this.config.readOnly + ); // Probably want to generate content on the fly depending on what to speak this.accessibleNode.innerHTML = "" + @@ -3722,14 +3750,15 @@ class MathField { $setConfig(conf) { if (!this.config) { this.config = { + namespace: '', + overrideDefaultInlineShortcuts: false, + readOnly: false, + removeExtraneousParentheses: true, + scriptDepth: [Infinity, Infinity], smartFence: true, smartSuperscript: true, - scriptDepth: [Infinity, Infinity], - removeExtraneousParentheses: true, - overrideDefaultInlineShortcuts: false, virtualKeyboard: '', virtualKeyboardLayout: 'qwerty', - namespace: '', }; } this.config = { ...this.config, ...conf }; @@ -3824,6 +3853,10 @@ class MathField { this.plonkSound.src = this.config.plonkSound; this.plonkSound.volume = AUDIO_FEEDBACK_VOLUME; } + if (this.readOnly) { + this._onBlur(); + } + this._requestUpdate(); } /** * diff --git a/dist/src/editor/editor-virtualKeyboard.js b/dist/src/editor/editor-virtualKeyboard.js index bc20c84d9..e84b2ec10 100644 --- a/dist/src/editor/editor-virtualKeyboard.js +++ b/dist/src/editor/editor-virtualKeyboard.js @@ -474,8 +474,8 @@ const LAYERS = {
  • -
  • e
  • -
  • i
  • +
  • e
  • +
  • i
    • @@ -484,9 +484,9 @@ const LAYERS = {
    • -
    • x ²
    • -
    • x
    • -
    • +
    • x ²
    • +
    • x
    • +
    • (
    • @@ -576,7 +576,7 @@ const LAYERS = {
    • !
    • -
    • o
    • +
    • o
    • o
    • @@ -589,9 +589,9 @@ const LAYERS = {
    • -
    • -
    • -
    • +
    • +
    • +
    • -
    • -
    • -
    • -
    • -
    • +
    • +
    • +
    • +
    • +
    • -
    • -
    • -
    • -
    • -
    • -
    • +
    • +
    • +
    • +
    • +
    • +
    • -
    • -
    • -
    • -
    • -
    • -
    • +
    • +
    • +
    • +
    • +
    • +
    • (
    • )
    • -
    • -
    • +
    • +
    •  
    @@ -827,7 +827,7 @@ const LAYERS = {
  • -
  • +
    • diff --git a/docs/global.html b/docs/global.html index 00583842d..239abde5c 100644 --- a/docs/global.html +++ b/docs/global.html @@ -1637,6 +1637,31 @@
      Properties
      + + + +
    + + + +
    + + readOnly? + + + + + : +boolean + + + + + + + + + diff --git a/docs/tutorial-CONFIG.html b/docs/tutorial-CONFIG.html index 9d14a932f..72dd99117 100644 --- a/docs/tutorial-CONFIG.html +++ b/docs/tutorial-CONFIG.html @@ -288,6 +288,9 @@

    Configuration options

    which will be played to provide feedback when a command has no effect, for example when pressing the spacebar at the root level.


    +

    config.readOnly='false':boolean

    +

    If true, the mathfield cannot be edited.

    +

    config.textToSpeechRules='mathlive':string

    Specify which set of text to speech rules to use.

    diff --git a/src/editor/editor-mathfield.js b/src/editor/editor-mathfield.js index 6a81ea8ec..9b1d39552 100644 --- a/src/editor/editor-mathfield.js +++ b/src/editor/editor-mathfield.js @@ -77,6 +77,7 @@ import '../addons/outputSpokenText.js'; @property {boolean} keypressVibration? @property {string} keypressSound? @property {string} plonkSound? + @property {boolean} readOnly? @property {"mathlive" | "sre"} textToSpeechRules? @property {"ssml" | "mac"} textToSpeechMarkup? @property {object} textToSpeechRulesOptions? @@ -1059,6 +1060,7 @@ class MathField { } } _onFocus() { + if (this.config.readOnly) return; if (this.blurred) { this.blurred = false; // The textarea may be a span (on mobile, for example), so check that @@ -1839,6 +1841,9 @@ class MathField { if (!shortcut && !selector) { return true; } + if (this.config.readOnly && selector[0] === 'insert') { + return true; + } // 5. Perform the action matching this shortcut // 5.1 Remove any error indicator (wavy underline) on the current command // sequence (if there are any) @@ -1961,6 +1966,10 @@ class MathField { * @private */ _onTypedText(text, options) { + if (this.config.readOnly) { + this._announce('plonk'); + return; + } options = options || {}; // Focus, then provide audio and haptic feedback if (options.focus) { @@ -2172,14 +2181,15 @@ class MathField { }); const hasFocus = this.$hasFocus(); if (this.mathlist.isCollapsed()) { - this.mathlist.anchor().caret = hasFocus ? this.mode : ''; + this.mathlist.anchor().caret = + hasFocus && !this.config.readOnly ? this.mode : ''; } else { this.mathlist.forEachSelected(a => { a.isSelected = true; }); } - if (hasFocus) { + if (hasFocus && !this.config.readOnly) { let ancestor = this.mathlist.ancestor(1); let i = 1; let done = false; @@ -2241,7 +2251,10 @@ class MathField { 0, this.config.horizontalSpacingScale ); - this.field.classList.toggle('ML__focused', hasFocus); + this.field.classList.toggle( + 'ML__focused', + hasFocus && !this.config.readOnly + ); // Probably want to generate content on the fly depending on what to speak this.accessibleNode.innerHTML = "" + @@ -3737,14 +3750,15 @@ class MathField { $setConfig(conf) { if (!this.config) { this.config = { + namespace: '', + overrideDefaultInlineShortcuts: false, + readOnly: false, + removeExtraneousParentheses: true, + scriptDepth: [Infinity, Infinity], smartFence: true, smartSuperscript: true, - scriptDepth: [Infinity, Infinity], - removeExtraneousParentheses: true, - overrideDefaultInlineShortcuts: false, virtualKeyboard: '', virtualKeyboardLayout: 'qwerty', - namespace: '', }; } this.config = { ...this.config, ...conf }; @@ -3839,6 +3853,10 @@ class MathField { this.plonkSound.src = this.config.plonkSound; this.plonkSound.volume = AUDIO_FEEDBACK_VOLUME; } + if (this.readOnly) { + this._onBlur(); + } + this._requestUpdate(); } /** * diff --git a/tutorials/CONFIG.md b/tutorials/CONFIG.md index a8b6c6537..2e985ef9e 100644 --- a/tutorials/CONFIG.md +++ b/tutorials/CONFIG.md @@ -340,6 +340,12 @@ for example when pressing the spacebar at the root level. --- +**`config.readOnly='false'`**:`boolean` + +If true, the mathfield cannot be edited. + +--- + **`config.textToSpeechRules='mathlive'`**:`string` Specify which From 4098f2027d09fef84b652169a2ded5438b8f706b Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Wed, 5 Feb 2020 17:10:58 -0800 Subject: [PATCH 12/28] bug: fix #243: incorrect alt-keys for '-' key on virtual keyboard --- src/editor/editor-virtualKeyboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor/editor-virtualKeyboard.js b/src/editor/editor-virtualKeyboard.js index e84b2ec10..823bb4fd8 100644 --- a/src/editor/editor-virtualKeyboard.js +++ b/src/editor/editor-virtualKeyboard.js @@ -1201,7 +1201,7 @@ function expandLayerMarkup(mf, layer) { row += "
  • "; + "' data-alt-keys='-' data-key='-' data-alt-keys='-'>−"; } else if (/tt/.test(cls)) { row += "
  • Date: Wed, 5 Feb 2020 17:36:26 -0800 Subject: [PATCH 14/28] dist --- CHANGELOG.md | 7 +++++ dist/mathlive.js | 4 ++- dist/mathlive.mjs | 2 +- dist/src/addons/outputLatex.js | 5 ++++ dist/src/editor/editor-virtualKeyboard.js | 2 +- docs/tutorial-CONFIG.html | 26 +++++++++++++++++++ tutorials/CONFIG.md | 31 +++++++++++++++++++++++ 7 files changed, 74 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63d615f27..47fad612e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Bug Fixes +- Fix #364: Some expressions containing placeholders, when inserted, would not have the placeholder selected. For example, when using the "differentialD" key in the virtual keyboard. - Fix #349: - 'latex-expanded' format no longer returns `\mleft` and `\mright`. This format is intended for inter-exchange with other TeX-compatible renderers @@ -11,10 +12,16 @@ - When pasting content that begins/ends with `$` or `$$`, assume LaTeX format - Fix keyboard shortcuts, e.g. "alt+(" or "alt+v" - Fix #354: The argument of `\operatorname` is of type 'math', not 'text'. This means that using the '\text' command inside the argument is valid and that spaces should be ignored by default (but the `~` character can be used to insert a space in that context). +- Fix #282: Some keys from the virtual keyboards ('e', 'i') produce an incorrect input. +- Fix #227: An operator (`\sin`) following some text is incorrectly considered + to be part of the text. ### Features / Improvements - Documented `suppressChangeNotifications` options for `$insert()` +- Document `config.smartMode` (#312) +- The 'surd' (root) and 'leftright' (fences) elements now change color when the caret is inside their body. This helps distinguish the case where the caret position may be ambiguous, for example when it is either after the last element of the body of a 'surd' or the first element after the 'surd'. +- #339: Read-only mode. Set the mode to read-only with `mf.$setConfig({readOnly: true})`. When this mode is activated, the formula can be selected (so it can be copied), but it cannot be modified by the user. Progammatic modification is still possible. ## 0.33 (December 16, 2019) diff --git a/dist/mathlive.js b/dist/mathlive.js index bbedb8866..0ea1409da 100644 --- a/dist/mathlive.js +++ b/dist/mathlive.js @@ -12960,6 +12960,8 @@ var global, factory; ) s++; + else if ('mode' === e) + for (; t[s] && t[s][e] === i; ) s++; else for ( ; @@ -14388,7 +14390,7 @@ var global, factory; ? (a += "
  • ") + "' data-alt-keys='-' data-key='-' data-alt-keys='-'>−") : /tt/.test(i) ? (a += "
  • 0&&s){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=s)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let s="",i=this.body||"";if(this.children){let t="none";for(const s of this.children){let a=0;if(t){let i=s.type;i&&("textord"===i&&(i="mord"),"first"===i&&(i="none"),a=s.isTight?E[t+"+"+i]||0:F[t+"+"+i]||0,a=Math.floor(e*a))}i+=s.toMarkup(a,e),t=q(s)}}if("​"!==i&&i||this.classes&&"ML__selected"!==this.classes){if(s="1?e.filter((function(t,e,s){return t.length>0&&s.indexOf(t)===e})).join(" "):e[0],a.length>0&&(s+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?i=z[-t]+i:D[t]?i=D[t]+i:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const s in this.style)Object.prototype.hasOwnProperty.call(this.style,s)&&("background-color"===s&&e||(t+=s+":"+this.style[s]+";"));t.length>0&&(s+=' style="'+t+'"')}s+=">",this.svgOverlay?(s+='",s+=""):s+=i,s+=""}else s="";return this.caret&&"command"!==this.type&&("text"===this.caret?s+='':s+=''),s}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,s=t.children&&t.children.length>0;if(e||s)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==a.length)return!1;i.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function O(t,e){if(Array.isArray(t)){const s=[];for(const e of t)e&&s.push(e);if(1===s.length)return O(s[0],e)}return new L(t,e)}function B(t,e,s){const i=O(e,s);return i.type=t,i}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const s=new L(t,e);let i=1;return i=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),s.height*=i,s.depth*=i,s}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const s=[e[0]];for(let i=1;i0?"em":""),i.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(i,"fontsize-ensurer reset-"+t.size+" size5"):0!==s?i:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=O([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=O(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,s,i,a){a=a||"";const o=$(e,(a+=" style-wrap ")+s.adjustTo(i));o.type=t;const n=i.sizeMultiplier/s.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=i.sizeMultiplier,o},makeSVG:function(t,e,s){return t.svgOverlay=e,t.svgStyle=s,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const s of t)e+=s.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const s="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=s),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=s)}function Y(t,e,s,i,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:s===rt?lt:s,baseFontFamily:e,value:i,category:W,frequency:a}}function Q(t,e){for(let s=t;s<=e;s++){const t=String.fromCodePoint(s);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const s=String.fromCodePoint(e);if("math"===t&&tt[s])return tt[s];if(e>32&&e<127)return s;let i="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===s){i=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===s){i=t;break}return i||s}const st={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},it=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in st)if(Object.prototype.hasOwnProperty.call(st,t)&&st[t]===e){e=t;break}for(let t=0;t=it[t].start&&et.body).join("")}function yt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a=ft(e),o={category:W,params:a,parser:i,mathstyle:"displaystyle",tabular:s.tabular||!0,colFormat:s.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a={category:W,baseFontFamily:s.fontFamily,params:ft(e),allowedInText:!!s.allowedInText,infix:!!s.infix,parse:i};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,s){let i=0;for(const t of s)i=Math.max(i,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let s=e[0]||[];const i={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)i.strokeWidth=m.toPx(t[1],"px"),isFinite(i.strokeWidth)||(i.strokeWidth=1),i.strokeStyle=t[2],i.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?i.backgroundcolor=t[2]:"mathcolor"===t[1]?i.strokeColor=t[2]:"padding"===t[1]?i.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(i.shadow=t[2]))}}"dashed"===i.strokeStyle?i.svgStrokeStyle="5,5":"dotted"===i.strokeStyle&&(i.svgStrokeStyle="1,5")}i.borderStyle=i.strokeWidth+"px "+i.strokeStyle+" "+i.strokeColor,s=s.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),i.notation={};for(const t of s)i.notation[t]=!0;return i.notation.updiagonalarrow&&(i.notation.updiagonalstrike=!1),i.notation.box&&(i.notation.left=!1,i.notation.right=!1,i.notation.bottom=!1,i.notation.top=!1),i})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const s={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":s.hasBarLine=!0;break;case"\\\\atopfrac":s.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s.hasBarLine=!1,s.leftDelim="(",s.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":s.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":s.mathstyle="textstyle"}return"\\cfrac"===t&&(s.continuousFraction=!0),s})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const s=e[0],i=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:s,denom:i,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let s=parseInt(e[0]);return isFinite(s)||(s=10067),{type:"mord",body:String.fromCodePoint(s)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",s=!0;for(const i of t)"string"==typeof i.body?e+=i.body:s=!1;return s?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const s={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(s.limits="nolimits",s.isFunction=!0),s})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const s={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return s.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?s.limits="nolimits":"\\operatorname*"===t&&(s.limits="limits"),s})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,s){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!s)return t;const i=t.codePointAt(0);for(let t=0;t=it[t].offset&&i=1;)i.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?i=H[t]:vt[t]&&(i={value:vt[t]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const s in V)Object.prototype.hasOwnProperty.call(V,s)&&s.startsWith(t)&&!V[s].infix&&e.push({match:s,frequency:V[s].frequency});for(const s in H)Object.prototype.hasOwnProperty.call(H,s)&&s.startsWith(t)&&e.push({match:s,frequency:H[s].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=N.makeSymbol,Ct=N.makeSpan,_t=N.makeVlist;function Tt(t,e,s,i,a,o){const n=Mt("Size"+s+"-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,Ct(n,"delimsizing size"+s),a.mathstyle,M.TEXT,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let s="";return"Size1-Regular"===e?s=" delim-size1":"Size4-Regular"===e&&(s=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+s)}function Ft(t,e,s,i,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((s-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;i&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Ot=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Bt(t,e,s,i,a,o){if(!e||0===e.length||"."===e)return $t(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?It:Dt.includes(e)?Ot:Pt;const r=function(t,e,s,i){for(let o=Math.min(2,3-i.mathstyle.size);oe)return s[o]}var a;return s[s.length-1]}(At.getValue("math",e),s,n,a);return"small"===r.type?function(t,e,s,i,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,s,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier/s.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,i,a,o):"large"===r.type?Tt(t,e,r.size,i,a,o):Ft(t,e,s,i,a,o)}function $t(t,e,s){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(s||""))}var Rt={makeSizedDelim:function(t,e,s,i,a){return"."===e?$t(t,i,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,s,!1,i,a):zt.includes(e)?Ft(t,e,qt[s],!1,i,a):null)},makeCustomSizedDelim:Bt,makeLeftRightDelim:function(t,e,s,i,a,o){if("."===e)return $t(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=i+n,c=s-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Bt(t,e,h,!0,a,o)}};const Kt=N.makeSpan,Nt=N.makeOrd,Wt=N.makeInner,Ht=N.makeHlist,Vt=N.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,s,i){this.mode=t,this.type=e,this.body=s,this.applyStyle(i)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const s of e)for(const e of s)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const s of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[s]))for(const i of this[s])i&&(e=e.concat(i.filter(t)));if(Array.isArray(this.array))for(const s of this.array)for(const i of s)i&&(e=e.concat(i.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),s=Nt(Qt(e,this.body));return this.cssId&&(s.cssId=this.cssId),s.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),s}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const s=[];let i=0;for(const t of e)t.align&&i++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,s,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const s of e){if(s.align&&b>=u.length)break;if(s.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(s)+N.depth(s)+o&&(o=(o+l-(N.height(s)+N.depth(s)))/2),r.setTop(r.height-N.height(s)-(o+i));const c=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=i;const d=Vt(t,[s,o,c,i]);if(!this.index)return this.bind(t,Nt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Kt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,Nt([Kt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let s=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(s=this.attachSupsub(t,Nt(s),"mord"));let i=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(i=N.skew(s));const a=Math.min(N.height(s),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Kt(Kt(o),"accent-body"+n);return r=Vt(t,[s,-a,r]),r.children[1].setLeft(2*i),Nt(r,"accent")}decomposeLine(t){const e=t.mathstyle,s=Qt(t.cramp(),this.body),i=h.defaultRuleThickness/e.sizeMultiplier,a=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=i,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[s,3*i,a,i]);else{const e=Kt(s);o=Vt(t,[i,a,3*i,e],"top",N.height(e))}return Nt(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),s=t.clone({mathstyle:"scriptstyle"}),i=this.overscript?Kt(Qt(s,this.overscript),t.mathstyle.adjustTo(s.mathstyle)):null,a=this.underscript?Kt(Qt(s,this.underscript),t.mathstyle.adjustTo(s.mathstyle)):null;return Yt(t,e,0,0,i,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Kt(Qt(t,this.body),"inner");return Nt([e,Kt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,s=Nt("","rule");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return s.setStyle("border-right-width",a,"em"),s.setStyle("border-top-width",o,"em"),s.setStyle("margin-top",-(o-i),"em"),s.setStyle("border-color",t.color),s.width=a,s.height=o+i,s.depth=-i,s}decomposeOp(t){const e=t.mathstyle;let s,i=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(i=!0);let a=0,o=0;if(this.symbol){const n=i?"Size2-Regular":"Size1-Regular";s=N.makeSymbol(n,this.body,"op-symbol "+(i?"large-op":"small-op")),s.type="mop",a=(s.height-s.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=s.italic,this.bind(t,s)}else Array.isArray(this.body)?(s=N.makeOp(Qt(t,this.body)),this.bind(t,s)):s=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const i=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===i||"auto"===i&&e.size===M.DISPLAY.size?this.attachLimits(t,s,a,o):this.attachSupsub(t,s,"mop")}return this.symbol&&s.setTop(a),s}decomposeBox(t){const e=Nt(Qt(t,this.body)),s=Kt();s.setStyle("position","absolute");const i="number"==typeof this.padding?this.padding:h.fboxsep;s.setStyle("height",e.height+e.depth+2*i,"em"),0!==i?s.setStyle("width","calc(100% + "+2*i+"em)"):s.setStyle("width","100%"),s.setStyle("top",-i,"em"),s.setStyle("left",-i,"em"),s.setStyle("z-index","-1"),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.framecolor&&s.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&s.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+i,"em");const a=Kt([s,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-i+e.depth,"em"),a.height=e.height+i,a.depth=e.depth+i,a.setLeft(i),a.setRight(i),a}decomposeEnclose(t){const e=Nt(Qt(t,this.body)),s="auto"===this.padding?.2:this.padding;e.setStyle("padding",s,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-s,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let i="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(i+='0?s.setWidth(this.width):s.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";s=Kt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?s=this.decomposeBox(t):"enclose"===this.type?s=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(s=this.makeSpan(t,this.body),s.classes="",this.error&&(s.classes+=" ML__error"),this.suggestion&&(s.classes+=" ML__suggestion")):"placeholder"===this.type?s=this.makeSpan(t,"⬚"):"first"===this.type&&(s=this.makeSpan(t,"​"));if(!s)return s;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(s)?s[s.length-1].caret=this.caret:s.caret=this.caret),this.containsCaret&&(Array.isArray(s)?(s[0].classes=(s[0].classes||"")+" ML__contains-caret",s[s.length-1].classes=(s[s.length-1].classes||"")+" ML__contains-caret"):s.classes=(s.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(s)){const e=s[s.length-1];s[s.length-1]=this.attachSupsub(t,e,e.type)}else s=[this.attachSupsub(t,s,s.type)];return Array.isArray(s)?s:[s]}attachSupsub(t,e,s){if(!this.superscript&&!this.subscript)return e;const i=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Kt(e,i.adjustTo(i.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Kt(e,i.adjustTo(i.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-i.metrics.supDrop,l=N.depth(e)+i.metrics.subDrop),n=i===M.DISPLAY?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const c=M.TEXT.sizeMultiplier*i.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const s=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*s){l=4*s-(r-a.depth)+N.height(o);const t=.8*i.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,i.metrics.sub1,N.height(o)-.8*i.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Kt(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(s,[e,m])}attachLimits(t,e,s,i){const a=this.superscript?Kt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Kt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,s,i,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const s="textord"===this.type?"mord":this.type,i=N.makeSpanOfType(s,e),a=this.getStyle();i.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+o):t.parentSize!==t.size&&(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+t.size),i.maxFontSize=Math.max(i.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(i.classes+=" ML__text"),t.mathstyle.isTight()&&(i.isTight=!0),"math"!==this.mode&&(i.italic=0),i.setRight(i.italic),"number"==typeof t.opacity&&i.setStyle("opacity",t.opacity),this.bind(t,i),this.caret&&(this.superscript||this.subscript||(i.caret=this.caret,t.mathstyle.isTight()&&(i.isTight=!0))),i}}function Xt(t){const e=Kt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,s,i){const a=[];for(const o of e){const e=Kt(Qt(t,i));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-s)}return Vt(t,a,"individualShift")}function Yt(t,e,s,i,a,o,n){if(!a&&!o)return e;e=Kt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+s;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-i),c.children[2].setLeft(i)}else if(o&&!a){const a=N.height(e)-s;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-i)}else if(!o&&a){const o=N.depth(e)+s;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(i)}return N.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function s(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function i(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const s=new Zt(t=t||"math","root",e||[]);return 0!==s.body.length&&"first"===s.body[0].type||s.body.unshift(new Zt("","first")),s},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},se={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ie=function(t){const e=t.toLowerCase().split("!");let s,i,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*s,n=(1-l)*n+l*i,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*s,n=l*n+(1-l)*i,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in se)if(se[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,s){this.tokens=t,this.index=0,this.args=e,this.macros=s,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===i.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ie(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let s=10,i=/[0-9]/;this.parseLiteral("'")?(s=8,i=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(s=16,i=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(i);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(i);)a+=this.get().value;const o=t?parseInt(a,s):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),s=new re("math","group");return s.mathstyle=")"===t?"textstyle":"displaystyle",s.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),s.body&&0!==s.body.length?s:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const s=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(s),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),s=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else s.push(this.scanArg(t.type));const i=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,s,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let s=null,i=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!s?(s=this.get(),i=this.swapMathList([])):this.parseAtom();let o;if(s){const t=this.swapMathList(a),e=At.getInfo("\\"+s.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||s.value,e.parse?e.parse("\\"+s.value,[i,t]):null)]:[new re(this.parseMode,"mop",s.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let s=1;for(;!this.end()&&0!==s;)this.hasLiteral("(")&&(s+=1),this.hasLiteral(")")&&(s-=1),0!==s&&this.parseAtom();return 0===s&&this.parseLiteral(")"),t.rightDelim=0===s?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const s=At.getInfo(e,"math",this.macros);return s?"mopen"===s.type||"mclose"===s.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const s=this.scanDelim();if(!s)return null;const i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=s,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(i),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const s=this.scanArg();if(s){const i=this.lastMathAtom();i[e]=i[e]||[],i[e]=i[e].concat(s),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const s=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)i=this.scanString();else if("number"===t)i=this.scanNumber();else if("dimen"===t)i=this.scanDimen();else if("skip"===t)i=this.scanSkip();else if("colspec"===t)i=this.scanColspec();else if("color"===t)i=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ie(e);if(t)i=i||{},i.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)i=i||{},i.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(i=i||{},i.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(s);return i||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const s=this.scanToken();return this.parseMode=e,Array.isArray(s)?s:s?[s]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const s=this.parseMode;this.parseMode=t;const i=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=s;const a=this.swapMathList(i);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const s=this.scanSkip();isFinite(s)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=s),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const s=At.getInfo("\\"+t.value,this.parseMode,this.macros),i=[];let a="",o="";if(s&&s.params)for(const t of s.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)i.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,i.push([e])}else i.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(s&&!s.infix){if(s.parse){const a=s.parse("\\"+t.value,i);if(a.type)e=new re(this.parseMode,s.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new re(this.parseMode,s.type||"mop",s.value||t.value,i),s.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}s||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const s=At.getInfo(t.value,this.parseMode,this.macros);if(s){const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new re(this.parseMode,s.type,s.value||t.value,i),s.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),s&&s.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new re(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let s,i=0;"string"==typeof this.macros[t]?(s=this.macros[t],/(^|[^\\])#1/.test(s)&&(i=1),/(^|[^\\])#2/.test(s)&&(i=2),/(^|[^\\])#3/.test(s)&&(i=3),/(^|[^\\])#4/.test(s)&&(i=4),/(^|[^\\])#5/.test(s)&&(i=5),/(^|[^\\])#6/.test(s)&&(i=6),/(^|[^\\])#7/.test(s)&&(i=7),/(^|[^\\])#8/.test(s)&&(i=8),/(^|[^\\])#9/.test(s)&&(i=9)):(s=this.macros[t].def,i=this.macros[t].args||0);for(let t=1;t<=i;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(s),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=i;t++){if(o+="{",Array.isArray(e[t]))for(let s=0;s1&&(e.extent=parseInt(s[1]));const i=s[0].split("/");for(const t of i){const s=t.match(/([^:]*):(.*)/);s&&e.path.push({relation:s[1],offset:parseInt(s[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let s=0,i=-1,a=!1;for(;!a;)i+=1,a=i>=t.length||i>=e.length,a=a||!(t[i].relation===e[i].relation&&t[i].offset===e[i].offset);return s=i===t.length&&i===e.length?0:i+1===t.length&&i+1===e.length&&t[i].relation===e[i].relation?1:2,s},pathCommonAncestor:function(t,e){const s=[],i=Math.min(t.length-1,e.length-1);let a=0;for(;a<=i&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)s.push(t[a]),a+=1;return s},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,s){if(!s)return s;if("string"==typeof s)return s;if("string"==typeof s.mode&&s.mode!==t)return null;if(!e)return s?s.value:void 0;let i=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return i=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==s.after?/nothing/.test(s.after)&&i||/letter/.test(s.after)&&a||/digit/.test(s.after)&&o||/function/.test(s.after)&&n||/frac/.test(s.after)&&r||/surd/.test(s.after)&&l||/binop/.test(s.after)&&c||/relop/.test(s.after)&&h||/punct/.test(s.after)&&d||/array/.test(s.after)&&p||/openfence/.test(s.after)&&m||/closefence/.test(s.after)&&u||/text/.test(s.after)&&f||/space/.test(s.after)&&g?s.value:null:s.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let s="";Array.isArray(t)||(t=[t]);for(const i of t){let t;const a=i.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}if(t){const i="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!i&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:i?"⌘":"command",Shift:i?"⇧":"shift",Alt:i?"⌥":"alt",Ctrl:i?"⌃":"control","\n":i?"⏎":"return",Return:i?"⏎":"return",Enter:i?"⌤":"enter",Tab:i?"⇥":"tab",Esc:"esc",Backspace:i?"⌫":"backspace",Del:i?"⌦":"del",PageUp:i?"⇞":"page up",PageDown:i?"⇟":"page down",Home:i?"⤒":"home",End:i?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;s.length>0&&(s+=e||" or "),s+=o}}return s}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const s=[];for(let i=0;i<=t.length-1;i++){const a=t.substring(i);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!s.includes(t)&&s.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&s.push(t)})}return s},forString:function(t,e,s,i){let a="";i&&i.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[s]));const o=i&&i.inlineShortcuts?i.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[s])),n||a},selectorForKeystroke:function(t,e){for(const s of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[s])return ue[s];return""},forCommand:function(t){let e=[];if("string"==typeof t){const s=fe[t];Array.isArray(s)?e=s.slice():s&&e.push(s)}t=xe(t);const s=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(s.test(xe(ue[t]))){const s=t.match(/:([^:]*)$/);s&&e.push(s[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let s=0;for(let i=0;i0;)s.col+=1,(!t[s.row]||s.col>=t[s.row].length)&&(s.col=0,s.row+=1),e-=1;return s}function Ce(t,e){let s;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(s=t[e.row][e.col]||null),!s||0!==s.length&&"first"===s[0].type||s.unshift(Oe()),s}function _e(t){let e=0,s=0,i=1;for(const e of t)s+=1,e.length>i&&(i=e.length);return e=s*i,e}function Te(t,e,s){if(!t)return[];e||(e=",");let i,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?a.push(i):i=new te.MathAtom("math","mpunct",e,s),a=a.concat(o));return a}function Le(t,e,s){const i={...e};if(i.row+=s,i.row<0){if(i.col+=s,i.row=t.length-1,i.col<0)return null;for(;i.row>=0&&!Ce(t,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=t.length){for(i.col+=s,i.row=0;i.rowt.length-1)return null}return i}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const s of t)if(De(s,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(s){return s===e||De(t[s],e)})))return!0;if(t.array)for(let s=_e(t.array);s>=0;s--)if(De(Ce(t.array,s),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let s,i=!1;if(i||"^"!==t[0]&&"_"!==t[0]||(s=Ie(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+s.match+"}",t+=qe(s.rest,e),i=!0),i||(s=t.match(/^(sqrt|\u221a)(.*)/),s&&(s=Ie(s[2],{...e,noWrap:!0}),t="\\sqrt{"+s.match+"}",t+=qe(s.rest,e),i=!0)),i||(s=t.match(/^(\\cbrt|\u221b)(.*)/),s&&(s=Ie(s[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+s.match+"}",t+=qe(s.rest,e),i=!0)),i||(s=t.match(/^abs(.*)/),s&&(s=Ie(s[1],{...e,noWrap:!0}),t="\\left|"+s.match+"\\right|",t+=qe(s.rest,e),i=!0)),i||(s=t.match(/^["”“](.*?)["”“](.*)/),s&&(t="\\text{"+s[1]+"}",t+=qe(s[2],e),i=!0)),i||(s=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),s&&(t=Pe(s[1],e),t+=qe(s[2],e),i=!0)),!i&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(s=Ie(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+s.match+"\\mright)":t[0]+s.match,t+=qe(s.rest,e),i=!0),i||(s=t.match(/^([a-zA-Z]+)(.*)/),s&&(t=Pe(s[1],e),t+=qe(s[2],e),i=!0)),!i)if(s=Ie(t,{...e,noWrap:!0}),s.match&&"/"===s.rest[0]){const a=Ie(s.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+s.match+"}{"+a.match+"}"+qe(a.rest,e)),i=!0}else s.match&&(t="("===t[0]?"\\left("+s.match+"\\right)"+qe(s.rest,e):s.match+qe(s.rest,e),i=!0);return i||(s=t.match(/^(\s+)(.*)$/),s&&(t=" "+qe(s[2],e),i=!0)),t}function Ie(t,e){let s="",i=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?s=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),s="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),i=t.substring(r)):(s=t.substring(1,r),i="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let s=ve.forString("math",null,t,e);if(s)return s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),{match:s,rest:t.substring(s.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(i=t.substring(a[1].length),s=a[1]))}return{match:s,rest:i}}function Pe(t,e){let s=ve.forString("math",null,t,e);return s?(s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),s+=" "):s=t,s}function Oe(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,s)},we.prototype.filter=function(t,e){e=e<0?-1:1;const s=[],i=new we;i.path=me.clone(this.path),i.extent=this.extent,i.root=this.root,e>=0?i.collapseForward():(i.collapseBackward(),i.move(1));const a=i.anchor();do{t.bind(i)(i.path,i.anchor())&&s.push(i.toString()),e>=0?i.next({iterateAll:!0}):i.previous({iterateAll:!0})}while(a!==i.anchor());return s},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const s=this.siblings(),i=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=i;e0?0:1)},we.prototype.setRange=function(t,e,s){s=s||{};const i=me.pathDistance(t,e);if(0===i)return s.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===i){const i=e[e.length-1].offset-t[t.length-1].offset;return s.extendToWordBoundary?(t=this.wordBoundary(t,i<0?1:-1),e=this.wordBoundary(e,i<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),i)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let s=0;s0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Oe()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),s=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[s]&&"text"===t[s].mode&&At.LETTER_AND_DIGITS.test(t[s].body);)s+=1;if(s-=1,e>=s)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,s-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),s=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[s]);)s+=1;s-=1,this.setSelection(e,s-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),s=this.startOffset(),i=this.endOffset();for(let a=s;a0&&"command"===t[e].type;)e-=1;let s=this.startOffset()+1;for(;s<=t.length-1&&"command"===t[s].type;)s+=1;return s>e?{start:e+1,end:s}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const s=this.commandOffsets();if(s){const i=t?this.anchorOffset()+1:s.end,a=this.siblings();for(let t=s.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==s.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let s=e.length-1;s>=0;s--)"command"===e[s].type?e.splice(s,1):t(e[s]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let s=_e(e.array);s>=0;s--)t(Ce(e.array,s))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let s=this.startOffset();if("text"===t[s].mode)for(;s>=1&&"text"===t[s].mode;)e.unshift(t[s]),s--;else for(;s>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[s].type);)e.unshift(t[s]),s--;return e},we.prototype.setSelection=function(t,e,s){t=t||0,e=e||0;const i=this.path[this.path.length-1].relation;s||(s=i);const a=this.parent();if(!a&&"body"!==s)return!1;const o=s.startsWith("cell");if(!o&&!a[s]||o&&!a.array)return!1;const n=s!==i;this.path[this.path.length-1].relation=s;const r=this.siblings().length;this.path[this.path.length-1].relation=i;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=s,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let s=e[this.relation()];const i=this.parent();for(;s&&!i[s];)s=e[s];if(s)return void this.setSelection(0,0,s);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const s=this.anchor();if(!s.captureSelection){let t;if(s.array){t="";const e=_e(s.array);let i=e-1;for(;!t&&i0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const s=this.relation();if("denom"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,s);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const s=this.relation();if("numer"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,s);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,s=0;const i=Se(this);s=this.extent+t;const a=e+s;if(a<0&&0!==s){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",i);e=this.path[this.path.length-1].offset,s=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",i);this.isCollapsed()&&(e-=1),s-=1}this.setSelection(e,s),this._announce("move",i)},we.prototype.skip=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(s&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!s)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let s="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(s){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",i)}},we.prototype.jump=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,i.length-1));const o=t<0?0:i.length-1;s?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const i=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;s?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(i,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',s=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let i=s.indexOf(document.activeElement)+t;i<0&&(i=s.length-1),i>=s.length&&(i=0),s[i].focus()}return this.suppressChangeNotifications=s,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",i),this.selectionDidChange(),this.suppressChangeNotifications=s,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e=i.mode),s+=1,i=this.ancestor(s);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e={color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontShape:i.fontShape,fontSeries:i.fontSeries,fontSize:i.fontSize}),s+=1,i=this.ancestor(s);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let s=0,i=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(s++,i=o),"first"!==t[e].body[o].type&&a++;0===a&&1===s&&(t[e]=t[e].body[i])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const s=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const i=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,s){e&&s&&(Array.isArray(e)?e.forEach(e=>t(e,s)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(s),t(e.body,s),t(e.numer,s),t(e.denom,s),t(e.index,s),t(e.overscript,s),t(e.underscript,s),t(e.subscript,s),t(e.superscript,s))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=i,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=s},we.prototype._insertSmartFence=function(t,e){const s=this.parent();if("leftright"===s.type&&"|"!==s.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const i=At.RIGHT_DELIM[t];if(i&&("leftright"!==s.type||"|"!==s.leftDelim)){let s="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;s=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",s+=a?"?":i;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(s,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(s&&"leftright"===s.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),s.rightDelim=t,this.move(1),this.contentDidChange(),!0;const i=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==i[a].type||"?"!==i[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),i[a].rightDelim=t,i[a].body=i[a].body.concat(i.slice(a+1,this.endOffset()+1)),i.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(s&&"leftright"===s.type&&"?"===s.rightDelim){this.contentWillChange(),s.rightDelim=t;const e=i.slice(this.endOffset()+1);return i.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===i.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let s=e.start;for(;s=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const s=[],i=t.substr(e);for(const t of i){const e=new te.MathAtom("command","command",t);e.suggestion=!0,s.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(s))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(s+=1)}i.row+=1}return s}(t,e.col)){!function(t,e){let s=0;for(;s"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==s.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,s.slice(e+1,e+2)),s.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,s.slice(t,e)),s.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Oe()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Oe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Oe()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Oe()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Oe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Oe()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Oe()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const s=this.relation();if(e.array){const i=Me(e.array,s);"after row"===t||"before row"===t?(i.col=0,i.row=i.row+("after row"===t?1:0),e.array.splice(i.row,0,[[]])):(i.col+="after column"===t?1:0,e.array[i.row].splice(i.col,0,[]));const a=Ae(e.array,i);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",s=At.getEnvironmentInfo(e),i=[[t.body]];s.parser&&Object.assign(t,s.parser(e,[],i)),t.tabularMode=s.tabular,t.parseMode=this.anchorMode(),t.env={...s},t.env.name=e,t.array=i,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function s(t,s){let i=!0;return e.forEachSelected(e=>{i=i&&e[t]===s},{recursive:!0}),i}t.color&&s("color",t.color)&&(t.color="none"),t.backgroundColor&&s("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&s("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&s("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&s("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&s("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Be={EditableMathlist:we,parseMathString:Ee};const $e={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Re={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ke={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Ne(t){let e,s=!0;"Unidentified"===t.key&&t.target&&(e=Ke[t.target.value]||t.target.value),e||($e[t.key]?(e=$e[t.key],s=!1):e=Re[t.key],e||(e=Ke[t.key.toLowerCase()])),!e&&t.code&&(e=Re[t.code]||t.code);const i=[];return t.ctrlKey&&i.push("Ctrl"),t.metaKey&&i.push("Meta"),s&&t.altKey&&i.push("Alt"),s&&t.shiftKey&&i.push("Shift"),0===i.length?e:(i.push(e),i.join("-"))}function We(t,e){let s,i=null,a=null,o=!1,n=!1;function r(t){clearTimeout(s),s=setTimeout((function(){clearTimeout(s),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const s=t.value;t.value="",s.length>0&&e.typedText(s)}const c=t||e.container;c.addEventListener("keydown",(function(s){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==s.key&&"Unidentified"!==s.key&&229!==s.keyCode)n=!1;else{n=!0,o=!1;const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i}return!(!o&&"CapsLock"!==s.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(s.code))||(i=s,a=null,e.keystroke(Ne(s),s))}),!0),c.addEventListener("keypress",(function(t){o||(i&&a&&e.keystroke(Ne(i),i),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!i||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const s=t.value;t.value="",s.length>0&&e.paste(s)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){i=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:Ne,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const s=t._getCaretPosition();s&&Ze(t,s),t.popover.classList.add("is-visible")}function Ze(t,e){const s=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>i-a?t.popover.style.left=i-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>s-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,s){if(!e||0===e.length)return void Xe(t);const i=e,a=function(t,e){const s=he.parseTokens(n(t),"math",null,e.config.macros),i=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},s),a=N.makeSpan(i,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[i]||e,t),o=je(i),r=ve.forCommand(i);let l=s?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=s?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,s){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(s&&s.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,s){let i="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";i=function t(e,s,i,a){if(0===i.length)return"";if(0===s.length)return i.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=s[0];let c=i[0][l];"fontFamily"===l&&(c=i[0].fontFamily||i[0].baseFontFamily);const h=function(t,e,s){let i=0;if("fontFamily"===e)for(;t[i]&&("mop"===t[i].type||(t[i].fontFamily||t[i].baseFontFamily)===s);)i++;else for(;t[i]&&("mop"===t[i].type||t[i][e]===s);)i++;return i}(i,l,c);if("text"===i[0].mode){if("fontShape"===l&&i[0].fontShape)"it"===i[0].fontShape?(n="\\textit{",r="}"):"sl"===i[0].fontShape?(n="\\textsl{",r="}"):"sc"===i[0].fontShape?(n="\\textsc{",r="}"):"n"===i[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+i[0].fontShape+"}",r="}");else if("fontSeries"===l&&i[0].fontSeries)"b"===i[0].fontSeries?(n="\\textbf{",r="}"):"l"===i[0].fontSeries?(n="\\textlf{",r="}"):"m"===i[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+i[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(s+=" & "),s+=Ye(this,this.array[i][e],t);i1&&(s+=" "),s+=Ye(this,this.body,t),s+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?s+="("+Ye(this,this.body,t)+")":(s+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(s+=" "),s+=Ye(this,this.body,t),s+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" "));break;case"delim":case"sizeddelim":s+=n+"{"+this.delim+"}";break;case"rule":s+=n,this.shift&&(s+=`[${Ye(this,this.shift,t)}em]`),s+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":s+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":s+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?s+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?s+=this.latex+" ":"\\unicode"===n?(s+='\\unicode{"',s+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),s+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?s+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?s+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(s+="\\limits "),"nolimits"===this.limits&&(s+="\\nolimits "));break;case"box":if("\\bbox"===n){if(s+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),s+=`[${t.join(",")}]`}s+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?s+=`\\boxed{${Ye(this,this.body,t)}}`:(s+=n,this.framecolor&&(s+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(s+=`{${ae(this.backgroundcolor)}}`),s+=`{${Ye(this,this.body,t)}}`);break;case"spacing":s+=n,"\\hspace"===n||"\\hspace*"===n?(s+="{",this.width?s+=this.width+"em":s+="0em",s+="}"):(s+=" ",this.width&&(s+=this.width+"em "));break;case"enclose":if(s+=n,"\\enclose"===n){s+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(s+=t+e,t=" ");s+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(s+=`[${e}]`)}s+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":s+="\\"+this.mathstyle+" ";break;case"space":s+=this.latex;break;case"placeholder":s+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":s+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),s+="^"+e):s+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?s+="_"+e:s+="_{"+e+"}"}return s},Qe.plural=function(t,e,s){(s=s||{}).type=s.type||"cardinal";const i=Qe.locale.substring(0,2),a="ordinal"===s.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===s.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[i]&&(o=Qe.strings[i][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===s.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const s=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=s}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ts={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},es={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ss={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let is={};const as={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function os(t,e,s){t=t.replace(/(^|[^\\])#@/g,"$1#?");const i=he.parseTokens(n(t),"math",e,s.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:s.config.macros},i),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ns(t,e,s){let i="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ts,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;i+="
    "+e[t].label+"
    "}}return i+="
    ",i+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function rs(t,e,s){for(let i=0;i"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&es[n]&&(a.setAttribute("data-shifted",es[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",es[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],s&&(o=[s,o]),a.getAttribute("data-alt-keys")){const t=is[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function ls(t,e){const s={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=s[t.config.virtualKeyboardLayout]?s[t.config.virtualKeyboardLayout]:s.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const s of t){const t=s.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=i[e.name];if(r||(r=s.qwerty[e.name]),r)for(const t of r){let s=e.class||"";s&&(s=" "+s),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(s)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var cs={make:function(t,e){let s='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ss["foreground-color"]=[];for(const t of ne)ss["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ss["background-color"]=[];for(const t of oe)ss["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});is={...ss},Object.keys(is).forEach(t=>{is[t]=is[t].slice()});const i="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];is[e]||(is[e]=[]),is[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),is[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),is[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),is[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),is[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),is[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),is[e].unshift({latex:"\\mathbb{"+i[t]+"}",aside:"blackboard",insert:"\\mathbb{"+i[t]+"}"}),is[e].unshift({latex:"\\mathbf{"+i[t]+"}",aside:"bold",insert:"\\mathbf{"+i[t]+"}"}),is[e].unshift({latex:"\\mathsf{"+i[t]+"}",aside:"sans",insert:"\\mathsf{"+i[t]+"}"}),is[e].unshift({latex:"\\mathcal{"+i[t]+"}",aside:"script",insert:"\\mathcal{"+i[t]+"}"}),is[e].unshift({latex:"\\mathfrak{"+i[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+i[t]+"}"})}for(let t=0;t<=26;t++){const e=i[t];is[e]||(is[e]=[]),is[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),is[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),is[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),is[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];is[e]||(is[e]=[]),is[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),is[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),is[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),is[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),is[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},as,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ts,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let i=n[e].layers||[];n[e].layer&&i.push(n[e].layer),i=Array.from(new Set(i));for(const n of i){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const s of e)t+="${s.label?s.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}s+="
    ",s+=ns(t,a,e);const i="function"==typeof o[n]?o[n]():o[n];s+=ls(t,i),s+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=s,rs(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:rs};const hs={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},ds={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},ps={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function ms(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function us(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(i=!0,gs(t)&&(n=t.index,t.index+=1),ys(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Ss(t.atoms[r].subscript,0,0,s).mathML,a+=Ss(t.atoms[n].superscript,0,0,s).mathML,a+="";else if(n>=0){if(a=""+o,gs(t)){const e=Ss(t.atoms[n].superscript,0,0,s).mathML,i=Ss(t.atoms[n+1].superscript,0,0,s).mathML;a+=""!==e&&""!==e||""!==i&&""!==i?""===e||""===e?"":e:""}else a+=Ss(t.atoms[n].superscript,0,0,s).mathML;a+=""}else r>=0?(a=""+o,a+=Ss(t.atoms[r].subscript,0,0,s).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return i}function gs(t){return t.index"+t,a+=Ss(o.subscript,0,0,s).mathML,a+=Ss(o.superscript,0,0,s).mathML,a+=""):o.superscript?(a=""+t,a+=Ss(o.superscript,0,0,s).mathML,a+=""):o.subscript&&(a=""+t,a+=Ss(o.subscript,0,0,s).mathML,a+=""),a.length>0&&(i=!0,e.mathML+=a,e.lastType=""),i))}function xs(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(i=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),i}function ks(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,s=t.index,i=!1,a=!1;for(;s=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(i=!0,o=""+o+"",n<0&&gs(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Ss(t.atoms[n].superscript,0,0,s).mathML,o+=""),t.mathML+=o,t.lastType="mn"),i}function vs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=As(t.atoms[l],s),a+=Ss(t.atoms,l+1,c,s).mathML,a+=As(t.atoms[c],s),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bs(a,t,s)&&(i=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function ws(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Ss(n.subscript,0,0,s).mathML,a+=Ss(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Ss(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Ss(n.subscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Ms(e.body)+"":As(e,s);a+=r,t.index+=1,bs(a,t,s)&&(i=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function Ss(t,e,s,i){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(s=s||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(i);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function As(t,e){let s="";const i=Ms(t.body);return i&&(s=""+i+""),s}function Ms(t){if(!t)return"";if("string"==typeof t)return ms(t);if(!Array.isArray(t)&&"string"==typeof t.body)return ms(t.body);let e="";for(const s of t)"string"==typeof s.body&&(e+=s.body);return ms(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let i,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Ss(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(ps[this.lFence]||this.lFence)+"")),c+="",i=0;i"+Ss(this.array[a][i],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(ps[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(ps[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Ss(this.numer,0,0,t).mathML||" ",c+=Ss(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Ss(this.numer,0,0,t).mathML+"",c+=""+Ss(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(ps[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Ss(this.body,0,0,t).mathML,c+=Ss(this.index,0,0,t).mathML,c+=""):(c+="",c+=Ss(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(ps[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Ss(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(ps[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(ps[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Ss(this.body,0,0,t).mathML,c+=""+(ps[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Ss(l,0,0,t).mathML,c+=Ss(n,0,0,t).mathML,c+=Ss(r,0,0,t).mathML,c+=""):r?(c+=""+Ss(l,0,0,t).mathML,c+=Ss(r,0,0,t).mathML,c+=""):n&&(c+=""+Ss(l,0,0,t).mathML,c+=Ss(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const s=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;s?c="&#x"+s[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const i=/\d/.test(c)?"mn":"mi";c="<"+i+d+us(this.id,t)+">"+ms(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&ps[p]?""+ps[p]+"":As(this,t);break;case"mpunct":c='"+(ps[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Ss(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Ss(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Ss(t,0,0,e).mathML};const Cs={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_s={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ts={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Ls={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fs(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Ds(t){return t&&Ls[t]||-1}function zs(t){return/=|=>/.test(t)?"right":"left"}function Es(t){if("f"===t||"g"===t)return!0;const e=Ts[t];return!!e&&!!/%[^01_^]?/.test(e)}function qs(t){t=(t||"").trim();let e=Cs[t];if(!e)if(/^\\[^{}]+$/.test(t)){const s=At.getInfo(t,"math",{});e=s&&s.value||t.slice(1)}else e=t;return e}function Is(t){if(!t)return null;const e=qs(Ks(t)),s=[Ds(e),zs(e)];return s[0]<=0?null:s}function Ps(t){return null!==Is(t)}const Os={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Bs={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},$s={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Rs={",":"list",";":"list2"};function Ks(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const s of t)e+=Ks(s);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const s of t.body)e+=Ks(s);return e}return""}function Ns(t){return"string"==typeof t.sym?function(t){let e=Ts[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const s=At.getInfo("\\"+t,"math");!s||s.fontFamily&&"cmr"!==s.fontFamily&&"ams"!==s.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Ws(t){return parseFloat(t.num)}function Hs(t){return"object"==typeof t&&void 0!==t.num}function Vs(t){let e=0;return Hs(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hi(t.num.re):0:parseFloat(t.num)),e}function Us(t){let e=0;return Hs(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hi(t.num.im):0),e}function js(t){return t&&void 0!==t.sup}function Gs(t){return t&&void 0!==t.sub}function Zs(t,e,s){let i=!1;const a=t.atoms[t.index];return a&&a.type===e&&(i=void 0===s||Ks(a)===s),i}function Xs(t,...e){const s={fn:t};if(e){const t=[];for(const s of e)s&&t.push(s);t.length>0&&(s.arg=t)}return s}function Js(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Ys(t){if(Hs(t)){const e=Vs(t),s=Us(t);return 0!==s?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-s).toString()):t.num=(-e).toString(),t}return Xs("negate",t)}function Qs(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ti(t,e){let s=t.atoms[t.index];return!s||void 0===s.superscript&&void 0===s.subscript?s=null:t.index+=1,s||(s=t.atoms[t.index+1],s&&"msubsup"===s.type&&(s.superscript||s.subscript)?t.index+=2:s=null),s?(void 0!==s.subscript&&(t.ast.sub=ri(s.subscript,e)),void 0!==s.superscript&&("msubsup"===s.type?/['\u2032]|\\prime/.test(Ks(s.superscript))?(t.index+=1,s=t.atoms[t.index+1],s&&"msubsup"===s.type&&/['\u2032]|\\prime/.test(Ks(s.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ks(s.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=ri(s.superscript,e)):t.ast.sup=ri(s.superscript,e))):t.index+=1,t}function ei(t,e){const s=t.ast;if(ii(t,"!!"))return t.index+=1,t.ast=Xs("factorial2",s),ei(t=ti(t,e),e);if(ii(t,"++"))return t.index+=1,t.ast=Xs("increment",s),ei(t=ti(t,e),e);if(ii(t,"--"))return t.index+=1,t.ast=Xs("decrement",s),ei(t=ti(t,e),e);const i=t.atoms[t.index];return i&&i.latex&&Bs[i.latex.trim()]&&(t.ast=Xs(Bs[i.latex.trim()],s),t=ei(t=ti(t,e),e)),t}function si(t,e,s,i){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ks(o)===e)t.index+=1,o=(t=oi(t,i)).atoms[t.index],o&&"mclose"===o.type&&Ks(o)===s&&(Qs(t)&&(t.ast={group:t.ast}),t=ei(t=ti(t,i),i));else if("textord"===o.type&&Ks(o)===e)t.index+=1,o=(t=oi(t,i)).atoms[t.index],o&&"textord"===o.type&&Ks(o)===s&&(t.index+=1,t=ei(t=ti(t,i),i));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=oi(t,i)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=ei(t=ti(t,i),i))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=oi(t,i)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===s&&(t.index+=1,t=ei(t=ti(t,i),i));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==s)return;t.ast=ri(o.body,i),Qs(t)&&(t.ast={group:t.ast}),t=ei(t=ti(t,i),i)}return t.minPrec=a,t}{let i=!0;if("mopen"===o.type?(e=o.latex.trim(),s=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,s=At.RIGHT_DELIM[e]):"leftright"===o.type?(i=!1,e=o.leftDelim,"?"===(s=o.rightDelim)&&(s=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),s=At.RIGHT_DELIM[e]),e&&s){if("|"===e&&"|"===s){const i=t.atoms[t.index+1];i&&"textord"===i.type&&"|"===i.latex&&(e="\\lVert",s="\\rVert")}if(t=si(t,e,s))return i&&(t.index+=1),t.ast={fn:Os[e+s]||e+s,arg:[t.ast]},t.minPrec=a,t}}}function ii(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ks(t.atoms[t.index])+Ks(t.atoms[t.index+1])}function ai(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zs(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,s=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return s&&(t.index+=1),s}return t.index+=1,Zs(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zs(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function oi(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let s=function t(e,s){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let i=e.atoms[e.index];if("text"===i.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qs(Ks(i));if(ai(e))e.ast=Xs(e.ast,t(e,s).ast);else{if("root"===i.type)return e.index=0,e.atoms=i.body,t(e,s);if("mbin"===i.type&&"-"===a)e.index+=1,(e=t(e,s)).ast=Ys(e.ast);else if("mbin"===i.type&&"+"===a)e.index+=1,(e=t(e,s)).ast=Xs("add",e.ast);else if("mord"===i.type&&/^[0-9.]$/.test(i.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ni(t)))),e=[t])}return e}function ri(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const s=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;s.push(e)}else{const i=oi(t,e).ast;if(!i)return;s.push(i)}return s.length>1?Xs("text",...s):s[0]||void 0}({atoms:ni(t)},e)}function li(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let s="";if(e.length>0){"."!==t[0]&&(s+=t[0]);let i="";for(const a of e)s+=i+a,i=t[2];"."!==t[1]&&(s+=t[1])}return s}function ci(t,e){const s=t.length;t=t.substr(0,e.precision-2);for(let s=0;s1&&(i+o.repeat(n+1)).startsWith(t))return"0"===o?i.replace(/(\d{3})/g,"$1"+e.groupSeparator):i.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return s!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hi(t){return parseFloat(parseFloat(t).toPrecision(15))}function di(t,e){let s="";if("number"==typeof e.precision){if("number"!=typeof t){let s="",i="";if("-"===t[0]?(s="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(i=a[4]||"","0"===o){let i=0;for(;"0"===n[i]&&i=e.precision)a="0",s="";else{a=t[i];const s=ci(t.substr(i+1),e);s&&(a+=e.decimalMarker+s)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),i>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-i).toString():a+="10^{"+(1-i).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const s=ci(n,e);s&&(t+=e.decimalMarker+s)}}else if(t.length>e.precision){const s=t.length;let i=t[0];const a=ci(t.substr(2),e);a&&(i+=e.decimalMarker+a,"}"!==i[i.length-1]&&(i+="\\ldots")),"1"!==i?i+=e.exponentProduct:i="",e.exponentMarker?i+=e.exponentMarker+(s-2).toString():i+="10^{"+(s-2).toString()+"}",t=i}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return i&&(i=e.exponentMarker?e.exponentMarker+i:e.exponentProduct+" 10^{"+i+"}"),s+t+i}t=hi(t)}if("engineering"===e.scientificNotation)if(0===t)s="0";else{const i=Math.abs(t);let a=Math.round(Math.log10(i));a-=a%3,i<1e3&&(a=0);let o=i/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=ci(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",s=(t<0?"-":"")+o+a}else{const i="string"==typeof t?t:t.toString();let a,o,n,r=i.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=i,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=ci(n,e)),n&&(n=e.decimalMarker+n),s=a+n+(o||"")}return s}te.MathAtom.prototype.toAST=function(t){let e,s,i,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(s=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),s=he.parseTokens(n(s),"math",null,t.macros),i=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),i=he.parseTokens(n(i),"math",null,t.macros),o=Xs("divide",ri(s,t),ri(i,t))):o.fn="divide"):o.group=ri(this.body,t);break;case"genfrac":o=Xs("divide",ri(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Js(1):ri(this.denom,t));break;case"surd":o=this.index?Xs("pow",ri(this.body,t),Xs("divide",Js(1),ri(this.index,t))):Xs("sqrt",ri(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qs(Ks(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=ri(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xs("card",ri(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>ri(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const s=[];s.push(ri(e[0],t));let i=ri(e[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(t=>"string"!=typeof t)),s.push(i||{}),o.args.push(s)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return ri(t,e)};var pi=function t(e,s){const i=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},s);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hs(e)){const s=Ws(e);if(s===-1/0)a="-\\infty ";else if(s===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(s)?"\\text{NaN}":di(e.num,i);else{const t=Vs(e),s=Us(e);isNaN(t)||isNaN(s)?a="\\text{NaN}":Math.abs(s)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=di(t,i)),Math.abs(s)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=s>0?"+":""),a+=(1!==Math.abs(s)?di(s,i):"")+"\\imaginaryI "))}js(e)&&(a+="^{"+t(e.sup,i)+"}"),Gs(e)&&(a+="_{"+t(e.sub,i)+"}")}else if(e.group)a=t(e.group,i),Hs(e.group)||Ns(e.group)?0!==Us(e.group)&&(a=li(e.fence||"(),",a)):a=li(e.fence||"(),",a),js(e)&&(a+="^{"+t(e.sup,i)+"}"),Gs(e)&&(a+="_{"+t(e.sub,i)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fs(e,0),i)+"|_{",e.arg&&2===e.arg.length)a+=t(Fs(e,1));else{let s="";for(let i=1;i=2)a=t(Fs(e,0),i),Hs(Fs(e,0))||Ns(Fs(e,0))||(a=li(e.fence||"(),",a)),a+="^{"+t(Fs(e,1),i)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,i)).join(" = ");else{const s=function(t){let e=Ts[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=s;let o="";if(/%(?![01_^])/.test(s)&&Array.isArray(e.arg)&&e.arg.length>1)a+=li(e.fence||"(),",...e.arg.map(e=>t(e,i)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fs(e,0),i),r=t(Fs(e,1),i),l=[...e.arg];/%0/.test(s)&&(a=a.replace("%0",n),l.shift()),/%1/.test(s)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=li(e.fence||"(),",...l.map(e=>t(e,i))))}else o=li(e.fence||"(),","");a=js(e)?a.replace("%^","^{"+t(e.sup,i)+"}"):a.replace("%^",""),a=Gs(e)?a.replace("%_","_{"+t(e.sub,i)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const s=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?s.push(li("() ",t(a,i))):0!==Vs(o=a)&&0!==Us(o)?s.push(li("() ",t(a,i))):js(e)&&0!==Us(a)&&1!==Us(a)?s.push(li("() ",t(a,i))):s.push(t(a,i));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hs(e.arg[0])&&"divide"!==e.arg[0].fn||Hs(e.arg[1])&&(0!==Vs(e.arg[1])||1!==Us(e.arg[1]))?s.join(" \\times "):s[0]+s[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hs(e.arg[0])&&Ws(e.arg[0])<0?s[0]:"+"+s[0];else{a=s[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function ui(t){let e=0;if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&(e+=1);return 1===e}function fi(t){let e="";if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&"string"==typeof s.body&&(e+=s.body);return e}function gi(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],s,a)}else t.addEventListener(a,s,i)}}function yi(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],s,a)}else t.removeEventListener(a,s,i)}}function bi(t,e){let s=document.getElementById(t);return s?s.setAttribute("data-refcount",parseInt(s.getAttribute("data-refcount"))+1):(s=document.createElement("div"),s.setAttribute("aria-hidden","true"),s.setAttribute("data-refcount","1"),s.className=e,s.id=t,document.body.appendChild(s)),s}function xi(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ki(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function s(t){return""+t+""}if(!t)return"";let i="";if(t.id&&"math"===e.speechMode&&(i+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let s=te.toSpeakableFragment(t.index,e);s=s.trim();const a=s.replace(//g,"");i+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+s+', of '+n+'. End root'}else ui(t.body)?i+=" the square root of "+n+" , ":i+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":i+=mi[t.leftDelim]||t.leftDelim,i+=te.toSpeakableFragment(t.body,e),i+=mi[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":i+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=t.latex?t.latex.trim():"";if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){i=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)i+=a;else{if("mbin"===t.type&&(i+=''),a){const t=mi[a]||(o?mi[o.trim()]:"");if(t)i+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";i+=t||function(t){let s="";return e.textToSpeechMarkup?/[a-z]/.test(t)?s+=' '+t+"":/[A-Z]/.test(t)?s+="capital "+t.toLowerCase():s+=t:/[a-z]/.test(t)?s+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?s+=" 'capital "+t.toUpperCase()+"'":s+=t,s}(a)}}else i+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(i+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let s=te.toSpeakableFragment(t.superscript,e);s=s.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the summation from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=te.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the summation from '+s+' of ',r=!0}else i+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let s=te.toSpeakableFragment(t.superscript,e);s=s.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the product from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=te.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the product from '+s+' of ',r=!0}else i+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),i+=' the integral from '+s(o)+' to '+s(a)+' of ',r=!0}else i+=' the integral of ';else if("string"==typeof t.body){i+=mi[t.body]||mi[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?i+=" "+t.latex.substr(1):i+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),ui(t.body)?i+=" crossed out "+n+" , ":i+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let s=te.toSpeakableFragment(t.superscript,e);s=s.trim();const a=s.replace(/<[^>]*>/g,"");if(ui(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(i+='')}"′"===a?i+=" prime ":"2"===a?i+=" squared ":"3"===a?i+=" cubed ":isNaN(parseInt(a))?i+=" to the "+s+"; ":i+=' to the '+a+" power; "}else isNaN(parseInt(a))?i+=" raised to the "+s+"; ":i+=' raised to the '+a+" power; "}if(!r&&t.subscript){let s=te.toSpeakableFragment(t.subscript,e);s=s.trim(),ui(t.subscript)?i+=" sub "+s:i+=" subscript "+s+". End subscript. "}}return i},te.toSpeakableText=function(t,e){const s=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(s.speechMode="math",window.sre&&"sre"===s.textToSpeechRules){s.generateID=!0;const e=te.toMathML(t,s);return e?(s.textToSpeechMarkup&&(s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup=s.textToSpeechMarkup,"ssml"===s.textToSpeechRulesOptions.markup&&(s.textToSpeechRulesOptions.markup="ssml_step"),s.textToSpeechRulesOptions.rate=s.speechEngineRate),s.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(s.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let i=te.toSpeakableFragment(t,s);if("ssml"===s.textToSpeechMarkup){let t="";s.speechEngineRate&&(t=''),i=''+t+"

    "+i+"

    "+(t?"
    ":"")+""}else i="mac"===s.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?i.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):i.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return i};class vi{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let s=this.element.textContent;s&&(s=s.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?i+="\n \n \n ":i+='',i+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(i+=`"):i+="",i+="",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=i;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bi("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bi("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gi(this.element,"focus",this),gi(this.element,"blur",this),gi(this.textarea,"cut",this),gi(this.textarea,"copy",this),gi(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gi(this.field,"pointerdown",this):gi(this.field,"touchstart:active mousedown",this),gi(window,"resize",this);const o={...e};o.onSelectionDidChange=vi.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vi.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Be.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const s=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=s}}(this.mathlist),s.length>0&&this.$latex(s),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ki(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,yi(this.textarea,"cut",this),yi(this.textarea,"copy",this),yi(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xi(this.popover),xi(this.keystrokeCaption),xi(this.virtualKeyboard),xi(document.getElementById("mathlive-alternate-keys-panel")),yi(this.element,"pointerdown",this),yi(this.element,"touchstart:active mousedown",this),yi(this.element,"focus",this),yi(this.element,"blur",this),yi(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let s;return Array.from(e.children).forEach((function(e){s=s||t(e)})),s}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const s=t.getBoundingClientRect();s.lefte.right&&(e.right=s.right),s.bottom>e.bottom&&(e.bottom=s.bottom),s.top=t.left&&s<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,s,i);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(i=me.pathFromString(e[0]).path,0===s.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const i=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=i=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){if(this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,s=this._pathFromPoint(d,p,{bias:0}),s){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,s),s=me.clone(this.mathlist.path),s[s.length-1].offset-=1):this.mathlist.setPath(s,0),o=!0,this.style={},3===t.detail||Si>2?(n(t),3!==t.detail&&3!==Si||this.mathlist.selectAll_()):i||(i=!0,window.PointerEvent?(gi(e.field,"pointermove",h),gi(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gi(window,"blur",n),t.touches?(gi(t.target,"touchmove",h),gi(t.target,"touchend",n)):(gi(window,"mousemove",h),gi(window,"mouseup",n))),2!==t.detail&&2!==Si||(a=!0,this.mathlist.selectGroup_()))}}else wi=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const s=t?t.path:[],i=this.mathlist.path,a=i[i.length-1];let o="";for(;s.length>i.length;)o+="out of "+e(t.parent(),s[s.length-1])+"; ",s.pop();if(!this.mathlist.isCollapsed())return Ai(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=Ai(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,s)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const s=this.element.getBoundingClientRect();e.style.left=s.left+"px",e.style.top=s.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,s=!1,i=[],a=!1;if(Array.isArray(t)?(e=t[0],i=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...i),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,s=!0}else"function"==typeof this[e]&&(a=this[e](...i),s=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),s}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let s=0,i=!1;for(this.mathlist.contentWillChange();!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),i||(a.applyStyle({mode:"text"}),a.latex=a.body),s-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let s=0,i=!1;for(;!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),i||a.applyStyle({mode:"math",type:"mord"}),s-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,s=!1;for(;!s;){const i=this.mathlist.sibling(e);s=!(i&&("text"===i.mode&&!i.type||"math"===i.mode&&/mord|textord|mpunct/.test(i.type))),s||(t=i.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(s));const i=this.getTextBeforeAnchor_()+s;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(s))return!0;if(/[\^_]/.test(s))return/(^|\s)[a-zA-Z][^_]$/.test(i)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[s];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(i))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(s))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(i))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(i)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(i))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(s))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(i)&&!/(dxd|abc|xyz|uvw)$/.test(i))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(i))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(i)&&!/(αβγ)$/.test(i))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(s))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let s,i,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!s&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const i=this.mode;s?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==i&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(s||a||(a=ve.selectorForKeystroke(this.mode,t)),!s&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!s){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||s)&&s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const s=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[i],{...this.config,suppressChangeNotifications:!0}),this.mode=s}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(s,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),s.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),s=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(s),s))return}let s="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=i(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),i=At.suggest(e+t);a=i.length>1,0===i.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),i[0].match!==e+t&&this.mathlist.insertSuggestion(i[0].match,-i[0].match.length+e.length+1),s=i[0].match)}else if("math"===this.mode){const s={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(s){if("moveToSuperscript"===s){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===s&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(s)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,s,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let s=0;ski(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,s=!1;for(;t&&!s;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,s=!0),e+=1,t=this.mathlist.ancestor(e)}const s=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),i=N.makeSpan(s,"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",i.height,"em");const o=[a];if(0!==i.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",i.height+i.depth,"em"),t.setStyle("vertical-align",-i.depth,"em"),o.push(t)}o.push(i);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let s="";if("latex"===(e=e||"latex")||"latex-expanded"===e)s=t.toLatex("latex-expanded"===e);else if("mathML"===e)s=t.toMathML(this.config);else if("spoken"===e)s=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",s=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const i=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),s=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=i,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);s=JSON.stringify(e)}else"ASCIIMath"===e&&(s=function t(e,s){if(!e)return"";if(Array.isArray(e)){let s="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let i=0;for(s='"';e[i]&&"text"===e[i].mode;)s+=e[i].body,i++;s+='"'+t(e.slice(i))}else{let i=0;for(;e[i]&&"math"===e[i].mode;)s+=t(e[i]),i++;s+=t(e.slice(i))}return s.trim()}if("text"===e.mode)return'"'+e.body+'"';let i="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":i=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(i+="(",i+=t(e.numer),i+=")/(",i+=t(e.denom),i+=")"):(i+="("+t(e.numer)+"),",i+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?i+="root("+t(e.index)+")("+t(e.body)+")":i+="sqrt("+t(e.body)+")";break;case"leftright":i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",i+=t(e.body),i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":i=hs[a]||a||("string"==typeof e.body?e.body:""),"\\"===i[0]&&(i+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?i=String.fromCharCode(parseInt("0x"+o[1])):i.length>0&&"\\"===i.charAt(0)&&(i="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":i=a&&hs[a]?hs[a]:a&&ds[a]?ds[a]:e.body;break;case"mopen":case"mclose":i+=e.body;break;case"mpunct":i=ds[a]||a;break;case"mop":"​"!==e.body&&(i="",i+="\\operatorname"===a?t(e.body):e.body||a,i+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":i=" "}if(e.subscript){i+="_";const s=t(e.subscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}if(e.superscript){i+="^";const s=t(e.superscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}return i}(t,this.config));return s}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const s=te.makeRoot("math",e);return this.formatMathlist(s,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!0:s.subscript&&(i=!1),e+=1,s=this.mathlist.ancestor(e);return i?t:0}_subscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!1:s.subscript&&(i=!0),e+=1,s=this.mathlist.ancestor(e);return i?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const s=this._getSelectionBounds();s&&(t={x:s.right+e.left-this.field.scrollLeft,y:s.top+e.top-this.field.scrollTop})}if(t){const s=t.x-window.scrollX;se.right&&this.field.scroll({top:0,left:s-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const s=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=s)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,s){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,s&&this.$insert(s,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const s=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(s)}else{const s=he.parseTokens(n(e),t,null,this.config.macros);s?this.mathlist.spliceCommandStringAroundInsertionPoint(s):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const s=this.suggestionIndex%e.length,i=t.length-e[s].match.length;0!==i&&this.mathlist.insertSuggestion(e[s].match,i),Je.showPopoverWithLatex(this,e[s].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const s=this;let i,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gi(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),i=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+s.config.namespace+"command-pressed");n&&s.$perform(JSON.parse(n));const l=t.getAttribute("data-"+s.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&s.$perform(JSON.parse(l))}),300))}})),gi(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gi(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?s.style.width="286px":4===e.length||2===e.length?s.style.width="146px":1===e.length?s.style.width="86px":s.style.width="146px",s.style.height="auto";let i="";for(const t of e)i+="";i="
      "+i+"
    ",s.innerHTML=i,cs.makeKeycap(this,s.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-s.clientHeight<0&&(s.style.width="auto",e.length<=6?s.style.height="56px":e.length<=12?s.style.height="108px":s.style.height="205px");const t=(a.top-s.clientHeight+5).toString()+"px",i=Math.max(0,Math.min(window.innerWidth-s.offsetWidth,(a.left+a.right-s.offsetWidth)/2))+"px";s.style.transform="translate("+i+","+t+")",s.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xi(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let s=!1;for(let i=0;i=1){s=[];for(let t=1;t<=i;t++)s.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),i=t.mathlist.endOffset()+1;if(i<=e.length-1){s=[];for(let t=i;t<=e.length-1;t++)s.push(e[t])}break}case"start":case"end":break;case"group":s=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(s=t.mathlist.parent());break}}return s}(this,t);if(null===s)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const i={...this.config};(e.withHighlighting||"amazon"===i.speechEngine)&&(i.textToSpeechMarkup=window.sre&&"sre"===i.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(i.generateID=!0));const a=te.toSpeakableText(s,i);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,i),!1}}let wi,Si=0;function Ai(t,e,s){const i=Object.assign({},t.config);return i.textToSpeechMarkup="",i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(s,i)}function Mi(t,e,s,i){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=Ai(t,"deleted: ",i):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(s):"replacement"===e?a=Ai(t,"",t.mathlist.sibling(0)):"line"===e?(a=Ai(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=i?Ai(t,e+" ",i):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vi.prototype.undo_=vi.prototype.undo,vi.prototype.redo_=vi.prototype.redo,vi.prototype.scrollIntoView_=vi.prototype.scrollIntoView,vi.prototype.scrollToStart_=vi.prototype.scrollToStart,vi.prototype.scrollToEnd_=vi.prototype.scrollToEnd,vi.prototype.insert_=vi.prototype.$insert;var Ci={isValidMathfield:ki,MathField:vi};function _i(t,e,s){let i=s,a=0;const o=t.length;for(;i0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_i(s,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+s.length),mathstyle:i}),c=r+s.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){s.textContent=t}return s.className="sr-only",s}(t,s)),/\bspeakable-text\b/i.test(s.renderAccessibleContent)&&s.renderToSpeakableText){const i=document.createElement("span");i.innerHTML=s.renderToSpeakableText(t,s),i.className="sr-only",e.appendChild(i)}return e.appendChild(a),e}return a}function Di(t,e){let s=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))s=document.createDocumentFragment(),s.appendChild(Fi(t,void 0,e,!0));else{const i=Li(t,e.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;s=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Bi(t,e,s){if(!window)return;if(!s&&window.mathlive&&(s=window.mathlive.config),"amazon"!==(s=s||{}).speechEngine)return void(s.handleSpeak&&s.handleSpeak(e));if(!window.AWS)return;const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:s.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=s.onReadAloudStatus||window.mathlive.onReadAloudStatus;i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),s=new Blob([t.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(s);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const s of window.mathlive.readAloudMarks)s.time0&&Array.from(e.children).forEach(e=>{t(e,s)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=i,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function $i(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Ri(t,e){Ei&&((e=e||{}).renderToMarkup=e.renderToMarkup||qi,e.renderToMathML=e.renderToMathML||Ii,e.renderToSpeakableText=e.renderToSpeakableText||Pi,e.macros=e.macros||At.MACROS,Ei.renderMathInElement($i(t),e))}function Ki(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const Ni={latexToMarkup:qi,latexToMathML:Ii,latexToSpeakableText:Pi,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const s=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(s,e)},astToLatex:function(t,e){return pi(t,e)},makeMathField:function(t,e){if(!Ci)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Oi,e.handleReadAloud=e.handleReadAloud||Bi,new Ci.MathField($i(t),e)},renderMathInDocument:function(t){Ri(document.body,t)},renderMathInElement:Ri,revertToOriginalContent:function(t,e){(t=(t=$i(t)).children[1])instanceof Ci.MathField?t.revertToOriginalContent():(Ki(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=$i(t)).children[1])instanceof Ci.MathField?t.originalContent:(Ki(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Bi,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let s=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(s=e.time/1e3);let i=window.mathlive.readAloudTokens.indexOf(t);i>=0&&(i+=e,i=1){const i=t.charCodeAt(e-1),a=s;return 55296<=i&&i<=56319?1024*(i-55296)+(a-56320)+65536:a}return s}function e(e,i){if((i=i||0)<0)return 0;if(i>=e.length-1)return e.length;let a=s(t(e,i));for(let r=i+1;r=this.s.length}get(){return this.pos="0"&&s<="9"?parseInt(s):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],s=t.toString().split(/\r?\n/);let i="",a="";for(const t of s){i+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(i+=e[0])}const n=new o(i);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,s){if("string"==typeof t){const s=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);s?(t=parseFloat(s[1]),e=s[2].toLowerCase()):t=parseFloat(t)}const i={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(s)){const e=Math.pow(10,s);return Math.round(t/h.ptPerEm*i*e)/e}return t/h.ptPerEm*i}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const s={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let i=t.charCodeAt(0);t[0]in d?i=d[t[0]].charCodeAt(0):l.test(t[0])&&(i=77);const a=r[s][i];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,s,i){this.id=t,this.size=e,this.cramped=i,this.sizeMultiplier=s,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const s of t)e+=T(s);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,s=1;this.children&&this.children.forEach(i=>{i.height>t&&(t=i.height),i.depth>e&&(e=i.depth),i.maxFontSize>s&&(s=i.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=s}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let s="Main-Regular";if(e&&(s=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&s){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=s)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let s="",i=this.body||"";if(this.children){let t="none";for(const s of this.children){let a=0;if(t){let i=s.type;i&&("textord"===i&&(i="mord"),"first"===i&&(i="none"),a=s.isTight?E[t+"+"+i]||0:F[t+"+"+i]||0,a=Math.floor(e*a))}i+=s.toMarkup(a,e),t=q(s)}}if("​"!==i&&i||this.classes&&"ML__selected"!==this.classes){if(s="1?e.filter((function(t,e,s){return t.length>0&&s.indexOf(t)===e})).join(" "):e[0],a.length>0&&(s+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?i=z[-t]+i:D[t]?i=D[t]+i:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const s in this.style)Object.prototype.hasOwnProperty.call(this.style,s)&&("background-color"===s&&e||(t+=s+":"+this.style[s]+";"));t.length>0&&(s+=' style="'+t+'"')}s+=">",this.svgOverlay?(s+='",s+=""):s+=i,s+=""}else s="";return this.caret&&"command"!==this.type&&("text"===this.caret?s+='':s+=''),s}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,s=t.children&&t.children.length>0;if(e||s)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==a.length)return!1;i.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function O(t,e){if(Array.isArray(t)){const s=[];for(const e of t)e&&s.push(e);if(1===s.length)return O(s[0],e)}return new L(t,e)}function B(t,e,s){const i=O(e,s);return i.type=t,i}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const s=new L(t,e);let i=1;return i=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),s.height*=i,s.depth*=i,s}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const s=[e[0]];for(let i=1;i0?"em":""),i.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(i,"fontsize-ensurer reset-"+t.size+" size5"):0!==s?i:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=O([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=O(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,s,i,a){a=a||"";const o=$(e,(a+=" style-wrap ")+s.adjustTo(i));o.type=t;const n=i.sizeMultiplier/s.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=i.sizeMultiplier,o},makeSVG:function(t,e,s){return t.svgOverlay=e,t.svgStyle=s,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const s of t)e+=s.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const s="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=s),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=s)}function Y(t,e,s,i,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:s===rt?lt:s,baseFontFamily:e,value:i,category:W,frequency:a}}function Q(t,e){for(let s=t;s<=e;s++){const t=String.fromCodePoint(s);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const s=String.fromCodePoint(e);if("math"===t&&tt[s])return tt[s];if(e>32&&e<127)return s;let i="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===s){i=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===s){i=t;break}return i||s}const st={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},it=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in st)if(Object.prototype.hasOwnProperty.call(st,t)&&st[t]===e){e=t;break}for(let t=0;t=it[t].start&&et.body).join("")}function yt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a=ft(e),o={category:W,params:a,parser:i,mathstyle:"displaystyle",tabular:s.tabular||!0,colFormat:s.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a={category:W,baseFontFamily:s.fontFamily,params:ft(e),allowedInText:!!s.allowedInText,infix:!!s.infix,parse:i};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,s){let i=0;for(const t of s)i=Math.max(i,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let s=e[0]||[];const i={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)i.strokeWidth=m.toPx(t[1],"px"),isFinite(i.strokeWidth)||(i.strokeWidth=1),i.strokeStyle=t[2],i.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?i.backgroundcolor=t[2]:"mathcolor"===t[1]?i.strokeColor=t[2]:"padding"===t[1]?i.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(i.shadow=t[2]))}}"dashed"===i.strokeStyle?i.svgStrokeStyle="5,5":"dotted"===i.strokeStyle&&(i.svgStrokeStyle="1,5")}i.borderStyle=i.strokeWidth+"px "+i.strokeStyle+" "+i.strokeColor,s=s.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),i.notation={};for(const t of s)i.notation[t]=!0;return i.notation.updiagonalarrow&&(i.notation.updiagonalstrike=!1),i.notation.box&&(i.notation.left=!1,i.notation.right=!1,i.notation.bottom=!1,i.notation.top=!1),i})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const s={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":s.hasBarLine=!0;break;case"\\\\atopfrac":s.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s.hasBarLine=!1,s.leftDelim="(",s.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":s.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":s.mathstyle="textstyle"}return"\\cfrac"===t&&(s.continuousFraction=!0),s})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const s=e[0],i=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:s,denom:i,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let s=parseInt(e[0]);return isFinite(s)||(s=10067),{type:"mord",body:String.fromCodePoint(s)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",s=!0;for(const i of t)"string"==typeof i.body?e+=i.body:s=!1;return s?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const s={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(s.limits="nolimits",s.isFunction=!0),s})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const s={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return s.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?s.limits="nolimits":"\\operatorname*"===t&&(s.limits="limits"),s})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,s){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!s)return t;const i=t.codePointAt(0);for(let t=0;t=it[t].offset&&i=1;)i.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?i=H[t]:vt[t]&&(i={value:vt[t]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const s in V)Object.prototype.hasOwnProperty.call(V,s)&&s.startsWith(t)&&!V[s].infix&&e.push({match:s,frequency:V[s].frequency});for(const s in H)Object.prototype.hasOwnProperty.call(H,s)&&s.startsWith(t)&&e.push({match:s,frequency:H[s].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=N.makeSymbol,Ct=N.makeSpan,_t=N.makeVlist;function Tt(t,e,s,i,a,o){const n=Mt("Size"+s+"-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,Ct(n,"delimsizing size"+s),a.mathstyle,M.TEXT,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let s="";return"Size1-Regular"===e?s=" delim-size1":"Size4-Regular"===e&&(s=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+s)}function Ft(t,e,s,i,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((s-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;i&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Ot=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Bt(t,e,s,i,a,o){if(!e||0===e.length||"."===e)return $t(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?It:Dt.includes(e)?Ot:Pt;const r=function(t,e,s,i){for(let o=Math.min(2,3-i.mathstyle.size);oe)return s[o]}var a;return s[s.length-1]}(At.getValue("math",e),s,n,a);return"small"===r.type?function(t,e,s,i,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,s,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier/s.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,i,a,o):"large"===r.type?Tt(t,e,r.size,i,a,o):Ft(t,e,s,i,a,o)}function $t(t,e,s){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(s||""))}var Rt={makeSizedDelim:function(t,e,s,i,a){return"."===e?$t(t,i,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,s,!1,i,a):zt.includes(e)?Ft(t,e,qt[s],!1,i,a):null)},makeCustomSizedDelim:Bt,makeLeftRightDelim:function(t,e,s,i,a,o){if("."===e)return $t(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=i+n,c=s-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Bt(t,e,h,!0,a,o)}};const Kt=N.makeSpan,Nt=N.makeOrd,Wt=N.makeInner,Ht=N.makeHlist,Vt=N.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,s,i){this.mode=t,this.type=e,this.body=s,this.applyStyle(i)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const s of e)for(const e of s)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const s of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[s]))for(const i of this[s])i&&(e=e.concat(i.filter(t)));if(Array.isArray(this.array))for(const s of this.array)for(const i of s)i&&(e=e.concat(i.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),s=Nt(Qt(e,this.body));return this.cssId&&(s.cssId=this.cssId),s.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),s}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const s=[];let i=0;for(const t of e)t.align&&i++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,s,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const s of e){if(s.align&&b>=u.length)break;if(s.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(s)+N.depth(s)+o&&(o=(o+l-(N.height(s)+N.depth(s)))/2),r.setTop(r.height-N.height(s)-(o+i));const c=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=i;const d=Vt(t,[s,o,c,i]);if(!this.index)return this.bind(t,Nt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Kt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,Nt([Kt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let s=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(s=this.attachSupsub(t,Nt(s),"mord"));let i=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(i=N.skew(s));const a=Math.min(N.height(s),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Kt(Kt(o),"accent-body"+n);return r=Vt(t,[s,-a,r]),r.children[1].setLeft(2*i),Nt(r,"accent")}decomposeLine(t){const e=t.mathstyle,s=Qt(t.cramp(),this.body),i=h.defaultRuleThickness/e.sizeMultiplier,a=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=i,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[s,3*i,a,i]);else{const e=Kt(s);o=Vt(t,[i,a,3*i,e],"top",N.height(e))}return Nt(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),s=t.clone({mathstyle:"scriptstyle"}),i=this.overscript?Kt(Qt(s,this.overscript),t.mathstyle.adjustTo(s.mathstyle)):null,a=this.underscript?Kt(Qt(s,this.underscript),t.mathstyle.adjustTo(s.mathstyle)):null;return Yt(t,e,0,0,i,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Kt(Qt(t,this.body),"inner");return Nt([e,Kt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,s=Nt("","rule");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return s.setStyle("border-right-width",a,"em"),s.setStyle("border-top-width",o,"em"),s.setStyle("margin-top",-(o-i),"em"),s.setStyle("border-color",t.color),s.width=a,s.height=o+i,s.depth=-i,s}decomposeOp(t){const e=t.mathstyle;let s,i=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(i=!0);let a=0,o=0;if(this.symbol){const n=i?"Size2-Regular":"Size1-Regular";s=N.makeSymbol(n,this.body,"op-symbol "+(i?"large-op":"small-op")),s.type="mop",a=(s.height-s.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=s.italic,this.bind(t,s)}else Array.isArray(this.body)?(s=N.makeOp(Qt(t,this.body)),this.bind(t,s)):s=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const i=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===i||"auto"===i&&e.size===M.DISPLAY.size?this.attachLimits(t,s,a,o):this.attachSupsub(t,s,"mop")}return this.symbol&&s.setTop(a),s}decomposeBox(t){const e=Nt(Qt(t,this.body)),s=Kt();s.setStyle("position","absolute");const i="number"==typeof this.padding?this.padding:h.fboxsep;s.setStyle("height",e.height+e.depth+2*i,"em"),0!==i?s.setStyle("width","calc(100% + "+2*i+"em)"):s.setStyle("width","100%"),s.setStyle("top",-i,"em"),s.setStyle("left",-i,"em"),s.setStyle("z-index","-1"),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.framecolor&&s.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&s.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+i,"em");const a=Kt([s,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-i+e.depth,"em"),a.height=e.height+i,a.depth=e.depth+i,a.setLeft(i),a.setRight(i),a}decomposeEnclose(t){const e=Nt(Qt(t,this.body)),s="auto"===this.padding?.2:this.padding;e.setStyle("padding",s,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-s,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let i="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(i+='0?s.setWidth(this.width):s.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";s=Kt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?s=this.decomposeBox(t):"enclose"===this.type?s=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(s=this.makeSpan(t,this.body),s.classes="",this.error&&(s.classes+=" ML__error"),this.suggestion&&(s.classes+=" ML__suggestion")):"placeholder"===this.type?s=this.makeSpan(t,"⬚"):"first"===this.type&&(s=this.makeSpan(t,"​"));if(!s)return s;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(s)?s[s.length-1].caret=this.caret:s.caret=this.caret),this.containsCaret&&(Array.isArray(s)?(s[0].classes=(s[0].classes||"")+" ML__contains-caret",s[s.length-1].classes=(s[s.length-1].classes||"")+" ML__contains-caret"):s.classes=(s.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(s)){const e=s[s.length-1];s[s.length-1]=this.attachSupsub(t,e,e.type)}else s=[this.attachSupsub(t,s,s.type)];return Array.isArray(s)?s:[s]}attachSupsub(t,e,s){if(!this.superscript&&!this.subscript)return e;const i=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Kt(e,i.adjustTo(i.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Kt(e,i.adjustTo(i.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-i.metrics.supDrop,l=N.depth(e)+i.metrics.subDrop),n=i===M.DISPLAY?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const c=M.TEXT.sizeMultiplier*i.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const s=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*s){l=4*s-(r-a.depth)+N.height(o);const t=.8*i.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,i.metrics.sub1,N.height(o)-.8*i.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Kt(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(s,[e,m])}attachLimits(t,e,s,i){const a=this.superscript?Kt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Kt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,s,i,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const s="textord"===this.type?"mord":this.type,i=N.makeSpanOfType(s,e),a=this.getStyle();i.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+o):t.parentSize!==t.size&&(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+t.size),i.maxFontSize=Math.max(i.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(i.classes+=" ML__text"),t.mathstyle.isTight()&&(i.isTight=!0),"math"!==this.mode&&(i.italic=0),i.setRight(i.italic),"number"==typeof t.opacity&&i.setStyle("opacity",t.opacity),this.bind(t,i),this.caret&&(this.superscript||this.subscript||(i.caret=this.caret,t.mathstyle.isTight()&&(i.isTight=!0))),i}}function Xt(t){const e=Kt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,s,i){const a=[];for(const o of e){const e=Kt(Qt(t,i));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-s)}return Vt(t,a,"individualShift")}function Yt(t,e,s,i,a,o,n){if(!a&&!o)return e;e=Kt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+s;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-i),c.children[2].setLeft(i)}else if(o&&!a){const a=N.height(e)-s;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-i)}else if(!o&&a){const o=N.depth(e)+s;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(i)}return N.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function s(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function i(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const s=new Zt(t=t||"math","root",e||[]);return 0!==s.body.length&&"first"===s.body[0].type||s.body.unshift(new Zt("","first")),s},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},se={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ie=function(t){const e=t.toLowerCase().split("!");let s,i,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*s,n=(1-l)*n+l*i,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*s,n=l*n+(1-l)*i,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in se)if(se[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,s){this.tokens=t,this.index=0,this.args=e,this.macros=s,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===i.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ie(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let s=10,i=/[0-9]/;this.parseLiteral("'")?(s=8,i=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(s=16,i=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(i);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(i);)a+=this.get().value;const o=t?parseInt(a,s):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),s=new re("math","group");return s.mathstyle=")"===t?"textstyle":"displaystyle",s.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),s.body&&0!==s.body.length?s:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const s=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(s),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),s=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else s.push(this.scanArg(t.type));const i=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,s,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let s=null,i=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!s?(s=this.get(),i=this.swapMathList([])):this.parseAtom();let o;if(s){const t=this.swapMathList(a),e=At.getInfo("\\"+s.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||s.value,e.parse?e.parse("\\"+s.value,[i,t]):null)]:[new re(this.parseMode,"mop",s.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let s=1;for(;!this.end()&&0!==s;)this.hasLiteral("(")&&(s+=1),this.hasLiteral(")")&&(s-=1),0!==s&&this.parseAtom();return 0===s&&this.parseLiteral(")"),t.rightDelim=0===s?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const s=At.getInfo(e,"math",this.macros);return s?"mopen"===s.type||"mclose"===s.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const s=this.scanDelim();if(!s)return null;const i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=s,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(i),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const s=this.scanArg();if(s){const i=this.lastMathAtom();i[e]=i[e]||[],i[e]=i[e].concat(s),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const s=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)i=this.scanString();else if("number"===t)i=this.scanNumber();else if("dimen"===t)i=this.scanDimen();else if("skip"===t)i=this.scanSkip();else if("colspec"===t)i=this.scanColspec();else if("color"===t)i=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ie(e);if(t)i=i||{},i.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)i=i||{},i.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(i=i||{},i.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(s);return i||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const s=this.scanToken();return this.parseMode=e,Array.isArray(s)?s:s?[s]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const s=this.parseMode;this.parseMode=t;const i=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=s;const a=this.swapMathList(i);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const s=this.scanSkip();isFinite(s)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=s),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const s=At.getInfo("\\"+t.value,this.parseMode,this.macros),i=[];let a="",o="";if(s&&s.params)for(const t of s.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)i.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,i.push([e])}else i.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(s&&!s.infix){if(s.parse){const a=s.parse("\\"+t.value,i);if(a.type)e=new re(this.parseMode,s.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new re(this.parseMode,s.type||"mop",s.value||t.value,i),s.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}s||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const s=At.getInfo(t.value,this.parseMode,this.macros);if(s){const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new re(this.parseMode,s.type,s.value||t.value,i),s.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),s&&s.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new re(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let s,i=0;"string"==typeof this.macros[t]?(s=this.macros[t],/(^|[^\\])#1/.test(s)&&(i=1),/(^|[^\\])#2/.test(s)&&(i=2),/(^|[^\\])#3/.test(s)&&(i=3),/(^|[^\\])#4/.test(s)&&(i=4),/(^|[^\\])#5/.test(s)&&(i=5),/(^|[^\\])#6/.test(s)&&(i=6),/(^|[^\\])#7/.test(s)&&(i=7),/(^|[^\\])#8/.test(s)&&(i=8),/(^|[^\\])#9/.test(s)&&(i=9)):(s=this.macros[t].def,i=this.macros[t].args||0);for(let t=1;t<=i;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(s),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=i;t++){if(o+="{",Array.isArray(e[t]))for(let s=0;s1&&(e.extent=parseInt(s[1]));const i=s[0].split("/");for(const t of i){const s=t.match(/([^:]*):(.*)/);s&&e.path.push({relation:s[1],offset:parseInt(s[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let s=0,i=-1,a=!1;for(;!a;)i+=1,a=i>=t.length||i>=e.length,a=a||!(t[i].relation===e[i].relation&&t[i].offset===e[i].offset);return s=i===t.length&&i===e.length?0:i+1===t.length&&i+1===e.length&&t[i].relation===e[i].relation?1:2,s},pathCommonAncestor:function(t,e){const s=[],i=Math.min(t.length-1,e.length-1);let a=0;for(;a<=i&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)s.push(t[a]),a+=1;return s},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,s){if(!s)return s;if("string"==typeof s)return s;if("string"==typeof s.mode&&s.mode!==t)return null;if(!e)return s?s.value:void 0;let i=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return i=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==s.after?/nothing/.test(s.after)&&i||/letter/.test(s.after)&&a||/digit/.test(s.after)&&o||/function/.test(s.after)&&n||/frac/.test(s.after)&&r||/surd/.test(s.after)&&l||/binop/.test(s.after)&&c||/relop/.test(s.after)&&h||/punct/.test(s.after)&&d||/array/.test(s.after)&&p||/openfence/.test(s.after)&&m||/closefence/.test(s.after)&&u||/text/.test(s.after)&&f||/space/.test(s.after)&&g?s.value:null:s.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let s="";Array.isArray(t)||(t=[t]);for(const i of t){let t;const a=i.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}if(t){const i="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!i&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:i?"⌘":"command",Shift:i?"⇧":"shift",Alt:i?"⌥":"alt",Ctrl:i?"⌃":"control","\n":i?"⏎":"return",Return:i?"⏎":"return",Enter:i?"⌤":"enter",Tab:i?"⇥":"tab",Esc:"esc",Backspace:i?"⌫":"backspace",Del:i?"⌦":"del",PageUp:i?"⇞":"page up",PageDown:i?"⇟":"page down",Home:i?"⤒":"home",End:i?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;s.length>0&&(s+=e||" or "),s+=o}}return s}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const s=[];for(let i=0;i<=t.length-1;i++){const a=t.substring(i);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!s.includes(t)&&s.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&s.push(t)})}return s},forString:function(t,e,s,i){let a="";i&&i.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[s]));const o=i&&i.inlineShortcuts?i.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[s])),n||a},selectorForKeystroke:function(t,e){for(const s of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[s])return ue[s];return""},forCommand:function(t){let e=[];if("string"==typeof t){const s=fe[t];Array.isArray(s)?e=s.slice():s&&e.push(s)}t=xe(t);const s=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(s.test(xe(ue[t]))){const s=t.match(/:([^:]*)$/);s&&e.push(s[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let s=0;for(let i=0;i0;)s.col+=1,(!t[s.row]||s.col>=t[s.row].length)&&(s.col=0,s.row+=1),e-=1;return s}function Ce(t,e){let s;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(s=t[e.row][e.col]||null),!s||0!==s.length&&"first"===s[0].type||s.unshift(Oe()),s}function _e(t){let e=0,s=0,i=1;for(const e of t)s+=1,e.length>i&&(i=e.length);return e=s*i,e}function Te(t,e,s){if(!t)return[];e||(e=",");let i,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?a.push(i):i=new te.MathAtom("math","mpunct",e,s),a=a.concat(o));return a}function Le(t,e,s){const i={...e};if(i.row+=s,i.row<0){if(i.col+=s,i.row=t.length-1,i.col<0)return null;for(;i.row>=0&&!Ce(t,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=t.length){for(i.col+=s,i.row=0;i.rowt.length-1)return null}return i}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const s of t)if(De(s,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(s){return s===e||De(t[s],e)})))return!0;if(t.array)for(let s=_e(t.array);s>=0;s--)if(De(Ce(t.array,s),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let s,i=!1;if(i||"^"!==t[0]&&"_"!==t[0]||(s=Ie(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+s.match+"}",t+=qe(s.rest,e),i=!0),i||(s=t.match(/^(sqrt|\u221a)(.*)/),s&&(s=Ie(s[2],{...e,noWrap:!0}),t="\\sqrt{"+s.match+"}",t+=qe(s.rest,e),i=!0)),i||(s=t.match(/^(\\cbrt|\u221b)(.*)/),s&&(s=Ie(s[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+s.match+"}",t+=qe(s.rest,e),i=!0)),i||(s=t.match(/^abs(.*)/),s&&(s=Ie(s[1],{...e,noWrap:!0}),t="\\left|"+s.match+"\\right|",t+=qe(s.rest,e),i=!0)),i||(s=t.match(/^["”“](.*?)["”“](.*)/),s&&(t="\\text{"+s[1]+"}",t+=qe(s[2],e),i=!0)),i||(s=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),s&&(t=Pe(s[1],e),t+=qe(s[2],e),i=!0)),!i&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(s=Ie(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+s.match+"\\mright)":t[0]+s.match,t+=qe(s.rest,e),i=!0),i||(s=t.match(/^([a-zA-Z]+)(.*)/),s&&(t=Pe(s[1],e),t+=qe(s[2],e),i=!0)),!i)if(s=Ie(t,{...e,noWrap:!0}),s.match&&"/"===s.rest[0]){const a=Ie(s.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+s.match+"}{"+a.match+"}"+qe(a.rest,e)),i=!0}else s.match&&(t="("===t[0]?"\\left("+s.match+"\\right)"+qe(s.rest,e):s.match+qe(s.rest,e),i=!0);return i||(s=t.match(/^(\s+)(.*)$/),s&&(t=" "+qe(s[2],e),i=!0)),t}function Ie(t,e){let s="",i=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?s=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),s="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),i=t.substring(r)):(s=t.substring(1,r),i="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let s=ve.forString("math",null,t,e);if(s)return s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),{match:s,rest:t.substring(s.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(i=t.substring(a[1].length),s=a[1]))}return{match:s,rest:i}}function Pe(t,e){let s=ve.forString("math",null,t,e);return s?(s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),s+=" "):s=t,s}function Oe(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,s)},we.prototype.filter=function(t,e){e=e<0?-1:1;const s=[],i=new we;i.path=me.clone(this.path),i.extent=this.extent,i.root=this.root,e>=0?i.collapseForward():(i.collapseBackward(),i.move(1));const a=i.anchor();do{t.bind(i)(i.path,i.anchor())&&s.push(i.toString()),e>=0?i.next({iterateAll:!0}):i.previous({iterateAll:!0})}while(a!==i.anchor());return s},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const s=this.siblings(),i=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=i;e0?0:1)},we.prototype.setRange=function(t,e,s){s=s||{};const i=me.pathDistance(t,e);if(0===i)return s.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===i){const i=e[e.length-1].offset-t[t.length-1].offset;return s.extendToWordBoundary?(t=this.wordBoundary(t,i<0?1:-1),e=this.wordBoundary(e,i<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),i)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let s=0;s0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Oe()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),s=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[s]&&"text"===t[s].mode&&At.LETTER_AND_DIGITS.test(t[s].body);)s+=1;if(s-=1,e>=s)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,s-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),s=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[s]);)s+=1;s-=1,this.setSelection(e,s-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),s=this.startOffset(),i=this.endOffset();for(let a=s;a0&&"command"===t[e].type;)e-=1;let s=this.startOffset()+1;for(;s<=t.length-1&&"command"===t[s].type;)s+=1;return s>e?{start:e+1,end:s}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const s=this.commandOffsets();if(s){const i=t?this.anchorOffset()+1:s.end,a=this.siblings();for(let t=s.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==s.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let s=e.length-1;s>=0;s--)"command"===e[s].type?e.splice(s,1):t(e[s]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let s=_e(e.array);s>=0;s--)t(Ce(e.array,s))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let s=this.startOffset();if("text"===t[s].mode)for(;s>=1&&"text"===t[s].mode;)e.unshift(t[s]),s--;else for(;s>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[s].type);)e.unshift(t[s]),s--;return e},we.prototype.setSelection=function(t,e,s){t=t||0,e=e||0;const i=this.path[this.path.length-1].relation;s||(s=i);const a=this.parent();if(!a&&"body"!==s)return!1;const o=s.startsWith("cell");if(!o&&!a[s]||o&&!a.array)return!1;const n=s!==i;this.path[this.path.length-1].relation=s;const r=this.siblings().length;this.path[this.path.length-1].relation=i;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=s,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let s=e[this.relation()];const i=this.parent();for(;s&&!i[s];)s=e[s];if(s)return void this.setSelection(0,0,s);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const s=this.anchor();if(!s.captureSelection){let t;if(s.array){t="";const e=_e(s.array);let i=e-1;for(;!t&&i0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const s=this.relation();if("denom"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,s);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const s=this.relation();if("numer"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,s);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,s=0;const i=Se(this);s=this.extent+t;const a=e+s;if(a<0&&0!==s){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",i);e=this.path[this.path.length-1].offset,s=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",i);this.isCollapsed()&&(e-=1),s-=1}this.setSelection(e,s),this._announce("move",i)},we.prototype.skip=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(s&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!s)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let s="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(s){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",i)}},we.prototype.jump=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,i.length-1));const o=t<0?0:i.length-1;s?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const i=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;s?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(i,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',s=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let i=s.indexOf(document.activeElement)+t;i<0&&(i=s.length-1),i>=s.length&&(i=0),s[i].focus()}return this.suppressChangeNotifications=s,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",i),this.selectionDidChange(),this.suppressChangeNotifications=s,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e=i.mode),s+=1,i=this.ancestor(s);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e={color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontShape:i.fontShape,fontSeries:i.fontSeries,fontSize:i.fontSize}),s+=1,i=this.ancestor(s);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let s=0,i=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(s++,i=o),"first"!==t[e].body[o].type&&a++;0===a&&1===s&&(t[e]=t[e].body[i])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const s=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const i=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,s){e&&s&&(Array.isArray(e)?e.forEach(e=>t(e,s)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(s),t(e.body,s),t(e.numer,s),t(e.denom,s),t(e.index,s),t(e.overscript,s),t(e.underscript,s),t(e.subscript,s),t(e.superscript,s))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=i,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=s},we.prototype._insertSmartFence=function(t,e){const s=this.parent();if("leftright"===s.type&&"|"!==s.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const i=At.RIGHT_DELIM[t];if(i&&("leftright"!==s.type||"|"!==s.leftDelim)){let s="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;s=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",s+=a?"?":i;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(s,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(s&&"leftright"===s.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),s.rightDelim=t,this.move(1),this.contentDidChange(),!0;const i=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==i[a].type||"?"!==i[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),i[a].rightDelim=t,i[a].body=i[a].body.concat(i.slice(a+1,this.endOffset()+1)),i.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(s&&"leftright"===s.type&&"?"===s.rightDelim){this.contentWillChange(),s.rightDelim=t;const e=i.slice(this.endOffset()+1);return i.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===i.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let s=e.start;for(;s=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const s=[],i=t.substr(e);for(const t of i){const e=new te.MathAtom("command","command",t);e.suggestion=!0,s.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(s))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(s+=1)}i.row+=1}return s}(t,e.col)){!function(t,e){let s=0;for(;s"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==s.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,s.slice(e+1,e+2)),s.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,s.slice(t,e)),s.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Oe()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Oe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Oe()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Oe()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Oe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Oe()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Oe()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const s=this.relation();if(e.array){const i=Me(e.array,s);"after row"===t||"before row"===t?(i.col=0,i.row=i.row+("after row"===t?1:0),e.array.splice(i.row,0,[[]])):(i.col+="after column"===t?1:0,e.array[i.row].splice(i.col,0,[]));const a=Ae(e.array,i);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",s=At.getEnvironmentInfo(e),i=[[t.body]];s.parser&&Object.assign(t,s.parser(e,[],i)),t.tabularMode=s.tabular,t.parseMode=this.anchorMode(),t.env={...s},t.env.name=e,t.array=i,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function s(t,s){let i=!0;return e.forEachSelected(e=>{i=i&&e[t]===s},{recursive:!0}),i}t.color&&s("color",t.color)&&(t.color="none"),t.backgroundColor&&s("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&s("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&s("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&s("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&s("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Be={EditableMathlist:we,parseMathString:Ee};const $e={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Re={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ke={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Ne(t){let e,s=!0;"Unidentified"===t.key&&t.target&&(e=Ke[t.target.value]||t.target.value),e||($e[t.key]?(e=$e[t.key],s=!1):e=Re[t.key],e||(e=Ke[t.key.toLowerCase()])),!e&&t.code&&(e=Re[t.code]||t.code);const i=[];return t.ctrlKey&&i.push("Ctrl"),t.metaKey&&i.push("Meta"),s&&t.altKey&&i.push("Alt"),s&&t.shiftKey&&i.push("Shift"),0===i.length?e:(i.push(e),i.join("-"))}function We(t,e){let s,i=null,a=null,o=!1,n=!1;function r(t){clearTimeout(s),s=setTimeout((function(){clearTimeout(s),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const s=t.value;t.value="",s.length>0&&e.typedText(s)}const c=t||e.container;c.addEventListener("keydown",(function(s){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==s.key&&"Unidentified"!==s.key&&229!==s.keyCode)n=!1;else{n=!0,o=!1;const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i}return!(!o&&"CapsLock"!==s.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(s.code))||(i=s,a=null,e.keystroke(Ne(s),s))}),!0),c.addEventListener("keypress",(function(t){o||(i&&a&&e.keystroke(Ne(i),i),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!i||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const s=t.value;t.value="",s.length>0&&e.paste(s)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){i=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:Ne,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const s=t._getCaretPosition();s&&Ze(t,s),t.popover.classList.add("is-visible")}function Ze(t,e){const s=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>i-a?t.popover.style.left=i-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>s-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,s){if(!e||0===e.length)return void Xe(t);const i=e,a=function(t,e){const s=he.parseTokens(n(t),"math",null,e.config.macros),i=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},s),a=N.makeSpan(i,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[i]||e,t),o=je(i),r=ve.forCommand(i);let l=s?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=s?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,s){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(s&&s.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,s){let i="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";i=function t(e,s,i,a){if(0===i.length)return"";if(0===s.length)return i.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=s[0];let c=i[0][l];"fontFamily"===l&&(c=i[0].fontFamily||i[0].baseFontFamily);const h=function(t,e,s){let i=0;if("fontFamily"===e)for(;t[i]&&("mop"===t[i].type||(t[i].fontFamily||t[i].baseFontFamily)===s);)i++;else if("mode"===e)for(;t[i]&&t[i][e]===s;)i++;else for(;t[i]&&("mop"===t[i].type||t[i][e]===s);)i++;return i}(i,l,c);if("text"===i[0].mode){if("fontShape"===l&&i[0].fontShape)"it"===i[0].fontShape?(n="\\textit{",r="}"):"sl"===i[0].fontShape?(n="\\textsl{",r="}"):"sc"===i[0].fontShape?(n="\\textsc{",r="}"):"n"===i[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+i[0].fontShape+"}",r="}");else if("fontSeries"===l&&i[0].fontSeries)"b"===i[0].fontSeries?(n="\\textbf{",r="}"):"l"===i[0].fontSeries?(n="\\textlf{",r="}"):"m"===i[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+i[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(s+=" & "),s+=Ye(this,this.array[i][e],t);i1&&(s+=" "),s+=Ye(this,this.body,t),s+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?s+="("+Ye(this,this.body,t)+")":(s+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(s+=" "),s+=Ye(this,this.body,t),s+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" "));break;case"delim":case"sizeddelim":s+=n+"{"+this.delim+"}";break;case"rule":s+=n,this.shift&&(s+=`[${Ye(this,this.shift,t)}em]`),s+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":s+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":s+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?s+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?s+=this.latex+" ":"\\unicode"===n?(s+='\\unicode{"',s+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),s+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?s+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?s+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(s+="\\limits "),"nolimits"===this.limits&&(s+="\\nolimits "));break;case"box":if("\\bbox"===n){if(s+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),s+=`[${t.join(",")}]`}s+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?s+=`\\boxed{${Ye(this,this.body,t)}}`:(s+=n,this.framecolor&&(s+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(s+=`{${ae(this.backgroundcolor)}}`),s+=`{${Ye(this,this.body,t)}}`);break;case"spacing":s+=n,"\\hspace"===n||"\\hspace*"===n?(s+="{",this.width?s+=this.width+"em":s+="0em",s+="}"):(s+=" ",this.width&&(s+=this.width+"em "));break;case"enclose":if(s+=n,"\\enclose"===n){s+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(s+=t+e,t=" ");s+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(s+=`[${e}]`)}s+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":s+="\\"+this.mathstyle+" ";break;case"space":s+=this.latex;break;case"placeholder":s+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":s+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),s+="^"+e):s+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?s+="_"+e:s+="_{"+e+"}"}return s},Qe.plural=function(t,e,s){(s=s||{}).type=s.type||"cardinal";const i=Qe.locale.substring(0,2),a="ordinal"===s.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===s.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[i]&&(o=Qe.strings[i][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===s.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const s=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=s}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ts={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},es={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ss={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let is={};const as={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function os(t,e,s){t=t.replace(/(^|[^\\])#@/g,"$1#?");const i=he.parseTokens(n(t),"math",e,s.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:s.config.macros},i),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ns(t,e,s){let i="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ts,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;i+="
    "+e[t].label+"
    "}}return i+="
    ",i+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function rs(t,e,s){for(let i=0;i"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&es[n]&&(a.setAttribute("data-shifted",es[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",es[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],s&&(o=[s,o]),a.getAttribute("data-alt-keys")){const t=is[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function ls(t,e){const s={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=s[t.config.virtualKeyboardLayout]?s[t.config.virtualKeyboardLayout]:s.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const s of t){const t=s.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=i[e.name];if(r||(r=s.qwerty[e.name]),r)for(const t of r){let s=e.class||"";s&&(s=" "+s),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(s)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var cs={make:function(t,e){let s='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ss["foreground-color"]=[];for(const t of ne)ss["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ss["background-color"]=[];for(const t of oe)ss["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});is={...ss},Object.keys(is).forEach(t=>{is[t]=is[t].slice()});const i="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];is[e]||(is[e]=[]),is[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),is[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),is[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),is[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),is[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),is[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),is[e].unshift({latex:"\\mathbb{"+i[t]+"}",aside:"blackboard",insert:"\\mathbb{"+i[t]+"}"}),is[e].unshift({latex:"\\mathbf{"+i[t]+"}",aside:"bold",insert:"\\mathbf{"+i[t]+"}"}),is[e].unshift({latex:"\\mathsf{"+i[t]+"}",aside:"sans",insert:"\\mathsf{"+i[t]+"}"}),is[e].unshift({latex:"\\mathcal{"+i[t]+"}",aside:"script",insert:"\\mathcal{"+i[t]+"}"}),is[e].unshift({latex:"\\mathfrak{"+i[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+i[t]+"}"})}for(let t=0;t<=26;t++){const e=i[t];is[e]||(is[e]=[]),is[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),is[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),is[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),is[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];is[e]||(is[e]=[]),is[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),is[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),is[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),is[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),is[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},as,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ts,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let i=n[e].layers||[];n[e].layer&&i.push(n[e].layer),i=Array.from(new Set(i));for(const n of i){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const s of e)t+="${s.label?s.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}s+="
    ",s+=ns(t,a,e);const i="function"==typeof o[n]?o[n]():o[n];s+=ls(t,i),s+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=s,rs(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:rs};const hs={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},ds={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},ps={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function ms(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function us(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(i=!0,gs(t)&&(n=t.index,t.index+=1),ys(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Ss(t.atoms[r].subscript,0,0,s).mathML,a+=Ss(t.atoms[n].superscript,0,0,s).mathML,a+="";else if(n>=0){if(a=""+o,gs(t)){const e=Ss(t.atoms[n].superscript,0,0,s).mathML,i=Ss(t.atoms[n+1].superscript,0,0,s).mathML;a+=""!==e&&""!==e||""!==i&&""!==i?""===e||""===e?"":e:""}else a+=Ss(t.atoms[n].superscript,0,0,s).mathML;a+=""}else r>=0?(a=""+o,a+=Ss(t.atoms[r].subscript,0,0,s).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return i}function gs(t){return t.index"+t,a+=Ss(o.subscript,0,0,s).mathML,a+=Ss(o.superscript,0,0,s).mathML,a+=""):o.superscript?(a=""+t,a+=Ss(o.superscript,0,0,s).mathML,a+=""):o.subscript&&(a=""+t,a+=Ss(o.subscript,0,0,s).mathML,a+=""),a.length>0&&(i=!0,e.mathML+=a,e.lastType=""),i))}function xs(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(i=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),i}function ks(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,s=t.index,i=!1,a=!1;for(;s=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(i=!0,o=""+o+"",n<0&&gs(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Ss(t.atoms[n].superscript,0,0,s).mathML,o+=""),t.mathML+=o,t.lastType="mn"),i}function vs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=As(t.atoms[l],s),a+=Ss(t.atoms,l+1,c,s).mathML,a+=As(t.atoms[c],s),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bs(a,t,s)&&(i=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function ws(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Ss(n.subscript,0,0,s).mathML,a+=Ss(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Ss(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Ss(n.subscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Ms(e.body)+"":As(e,s);a+=r,t.index+=1,bs(a,t,s)&&(i=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function Ss(t,e,s,i){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(s=s||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(i);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function As(t,e){let s="";const i=Ms(t.body);return i&&(s=""+i+""),s}function Ms(t){if(!t)return"";if("string"==typeof t)return ms(t);if(!Array.isArray(t)&&"string"==typeof t.body)return ms(t.body);let e="";for(const s of t)"string"==typeof s.body&&(e+=s.body);return ms(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let i,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Ss(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(ps[this.lFence]||this.lFence)+"")),c+="",i=0;i"+Ss(this.array[a][i],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(ps[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(ps[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Ss(this.numer,0,0,t).mathML||" ",c+=Ss(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Ss(this.numer,0,0,t).mathML+"",c+=""+Ss(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(ps[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Ss(this.body,0,0,t).mathML,c+=Ss(this.index,0,0,t).mathML,c+=""):(c+="",c+=Ss(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(ps[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Ss(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(ps[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(ps[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Ss(this.body,0,0,t).mathML,c+=""+(ps[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Ss(l,0,0,t).mathML,c+=Ss(n,0,0,t).mathML,c+=Ss(r,0,0,t).mathML,c+=""):r?(c+=""+Ss(l,0,0,t).mathML,c+=Ss(r,0,0,t).mathML,c+=""):n&&(c+=""+Ss(l,0,0,t).mathML,c+=Ss(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const s=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;s?c="&#x"+s[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const i=/\d/.test(c)?"mn":"mi";c="<"+i+d+us(this.id,t)+">"+ms(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&ps[p]?""+ps[p]+"":As(this,t);break;case"mpunct":c='"+(ps[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Ss(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Ss(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Ss(t,0,0,e).mathML};const Cs={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_s={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ts={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Ls={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fs(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Ds(t){return t&&Ls[t]||-1}function zs(t){return/=|=>/.test(t)?"right":"left"}function Es(t){if("f"===t||"g"===t)return!0;const e=Ts[t];return!!e&&!!/%[^01_^]?/.test(e)}function qs(t){t=(t||"").trim();let e=Cs[t];if(!e)if(/^\\[^{}]+$/.test(t)){const s=At.getInfo(t,"math",{});e=s&&s.value||t.slice(1)}else e=t;return e}function Is(t){if(!t)return null;const e=qs(Ks(t)),s=[Ds(e),zs(e)];return s[0]<=0?null:s}function Ps(t){return null!==Is(t)}const Os={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Bs={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},$s={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Rs={",":"list",";":"list2"};function Ks(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const s of t)e+=Ks(s);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const s of t.body)e+=Ks(s);return e}return""}function Ns(t){return"string"==typeof t.sym?function(t){let e=Ts[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const s=At.getInfo("\\"+t,"math");!s||s.fontFamily&&"cmr"!==s.fontFamily&&"ams"!==s.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Ws(t){return parseFloat(t.num)}function Hs(t){return"object"==typeof t&&void 0!==t.num}function Vs(t){let e=0;return Hs(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hi(t.num.re):0:parseFloat(t.num)),e}function Us(t){let e=0;return Hs(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hi(t.num.im):0),e}function js(t){return t&&void 0!==t.sup}function Gs(t){return t&&void 0!==t.sub}function Zs(t,e,s){let i=!1;const a=t.atoms[t.index];return a&&a.type===e&&(i=void 0===s||Ks(a)===s),i}function Xs(t,...e){const s={fn:t};if(e){const t=[];for(const s of e)s&&t.push(s);t.length>0&&(s.arg=t)}return s}function Js(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Ys(t){if(Hs(t)){const e=Vs(t),s=Us(t);return 0!==s?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-s).toString()):t.num=(-e).toString(),t}return Xs("negate",t)}function Qs(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ti(t,e){let s=t.atoms[t.index];return!s||void 0===s.superscript&&void 0===s.subscript?s=null:t.index+=1,s||(s=t.atoms[t.index+1],s&&"msubsup"===s.type&&(s.superscript||s.subscript)?t.index+=2:s=null),s?(void 0!==s.subscript&&(t.ast.sub=ri(s.subscript,e)),void 0!==s.superscript&&("msubsup"===s.type?/['\u2032]|\\prime/.test(Ks(s.superscript))?(t.index+=1,s=t.atoms[t.index+1],s&&"msubsup"===s.type&&/['\u2032]|\\prime/.test(Ks(s.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ks(s.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=ri(s.superscript,e)):t.ast.sup=ri(s.superscript,e))):t.index+=1,t}function ei(t,e){const s=t.ast;if(ii(t,"!!"))return t.index+=1,t.ast=Xs("factorial2",s),ei(t=ti(t,e),e);if(ii(t,"++"))return t.index+=1,t.ast=Xs("increment",s),ei(t=ti(t,e),e);if(ii(t,"--"))return t.index+=1,t.ast=Xs("decrement",s),ei(t=ti(t,e),e);const i=t.atoms[t.index];return i&&i.latex&&Bs[i.latex.trim()]&&(t.ast=Xs(Bs[i.latex.trim()],s),t=ei(t=ti(t,e),e)),t}function si(t,e,s,i){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ks(o)===e)t.index+=1,o=(t=oi(t,i)).atoms[t.index],o&&"mclose"===o.type&&Ks(o)===s&&(Qs(t)&&(t.ast={group:t.ast}),t=ei(t=ti(t,i),i));else if("textord"===o.type&&Ks(o)===e)t.index+=1,o=(t=oi(t,i)).atoms[t.index],o&&"textord"===o.type&&Ks(o)===s&&(t.index+=1,t=ei(t=ti(t,i),i));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=oi(t,i)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=ei(t=ti(t,i),i))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=oi(t,i)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===s&&(t.index+=1,t=ei(t=ti(t,i),i));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==s)return;t.ast=ri(o.body,i),Qs(t)&&(t.ast={group:t.ast}),t=ei(t=ti(t,i),i)}return t.minPrec=a,t}{let i=!0;if("mopen"===o.type?(e=o.latex.trim(),s=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,s=At.RIGHT_DELIM[e]):"leftright"===o.type?(i=!1,e=o.leftDelim,"?"===(s=o.rightDelim)&&(s=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),s=At.RIGHT_DELIM[e]),e&&s){if("|"===e&&"|"===s){const i=t.atoms[t.index+1];i&&"textord"===i.type&&"|"===i.latex&&(e="\\lVert",s="\\rVert")}if(t=si(t,e,s))return i&&(t.index+=1),t.ast={fn:Os[e+s]||e+s,arg:[t.ast]},t.minPrec=a,t}}}function ii(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ks(t.atoms[t.index])+Ks(t.atoms[t.index+1])}function ai(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zs(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,s=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return s&&(t.index+=1),s}return t.index+=1,Zs(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zs(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function oi(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let s=function t(e,s){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let i=e.atoms[e.index];if("text"===i.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qs(Ks(i));if(ai(e))e.ast=Xs(e.ast,t(e,s).ast);else{if("root"===i.type)return e.index=0,e.atoms=i.body,t(e,s);if("mbin"===i.type&&"-"===a)e.index+=1,(e=t(e,s)).ast=Ys(e.ast);else if("mbin"===i.type&&"+"===a)e.index+=1,(e=t(e,s)).ast=Xs("add",e.ast);else if("mord"===i.type&&/^[0-9.]$/.test(i.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ni(t)))),e=[t])}return e}function ri(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const s=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;s.push(e)}else{const i=oi(t,e).ast;if(!i)return;s.push(i)}return s.length>1?Xs("text",...s):s[0]||void 0}({atoms:ni(t)},e)}function li(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let s="";if(e.length>0){"."!==t[0]&&(s+=t[0]);let i="";for(const a of e)s+=i+a,i=t[2];"."!==t[1]&&(s+=t[1])}return s}function ci(t,e){const s=t.length;t=t.substr(0,e.precision-2);for(let s=0;s1&&(i+o.repeat(n+1)).startsWith(t))return"0"===o?i.replace(/(\d{3})/g,"$1"+e.groupSeparator):i.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return s!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hi(t){return parseFloat(parseFloat(t).toPrecision(15))}function di(t,e){let s="";if("number"==typeof e.precision){if("number"!=typeof t){let s="",i="";if("-"===t[0]?(s="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(i=a[4]||"","0"===o){let i=0;for(;"0"===n[i]&&i=e.precision)a="0",s="";else{a=t[i];const s=ci(t.substr(i+1),e);s&&(a+=e.decimalMarker+s)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),i>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-i).toString():a+="10^{"+(1-i).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const s=ci(n,e);s&&(t+=e.decimalMarker+s)}}else if(t.length>e.precision){const s=t.length;let i=t[0];const a=ci(t.substr(2),e);a&&(i+=e.decimalMarker+a,"}"!==i[i.length-1]&&(i+="\\ldots")),"1"!==i?i+=e.exponentProduct:i="",e.exponentMarker?i+=e.exponentMarker+(s-2).toString():i+="10^{"+(s-2).toString()+"}",t=i}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return i&&(i=e.exponentMarker?e.exponentMarker+i:e.exponentProduct+" 10^{"+i+"}"),s+t+i}t=hi(t)}if("engineering"===e.scientificNotation)if(0===t)s="0";else{const i=Math.abs(t);let a=Math.round(Math.log10(i));a-=a%3,i<1e3&&(a=0);let o=i/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=ci(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",s=(t<0?"-":"")+o+a}else{const i="string"==typeof t?t:t.toString();let a,o,n,r=i.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=i,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=ci(n,e)),n&&(n=e.decimalMarker+n),s=a+n+(o||"")}return s}te.MathAtom.prototype.toAST=function(t){let e,s,i,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(s=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),s=he.parseTokens(n(s),"math",null,t.macros),i=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),i=he.parseTokens(n(i),"math",null,t.macros),o=Xs("divide",ri(s,t),ri(i,t))):o.fn="divide"):o.group=ri(this.body,t);break;case"genfrac":o=Xs("divide",ri(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Js(1):ri(this.denom,t));break;case"surd":o=this.index?Xs("pow",ri(this.body,t),Xs("divide",Js(1),ri(this.index,t))):Xs("sqrt",ri(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qs(Ks(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=ri(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xs("card",ri(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>ri(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const s=[];s.push(ri(e[0],t));let i=ri(e[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(t=>"string"!=typeof t)),s.push(i||{}),o.args.push(s)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return ri(t,e)};var pi=function t(e,s){const i=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},s);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hs(e)){const s=Ws(e);if(s===-1/0)a="-\\infty ";else if(s===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(s)?"\\text{NaN}":di(e.num,i);else{const t=Vs(e),s=Us(e);isNaN(t)||isNaN(s)?a="\\text{NaN}":Math.abs(s)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=di(t,i)),Math.abs(s)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=s>0?"+":""),a+=(1!==Math.abs(s)?di(s,i):"")+"\\imaginaryI "))}js(e)&&(a+="^{"+t(e.sup,i)+"}"),Gs(e)&&(a+="_{"+t(e.sub,i)+"}")}else if(e.group)a=t(e.group,i),Hs(e.group)||Ns(e.group)?0!==Us(e.group)&&(a=li(e.fence||"(),",a)):a=li(e.fence||"(),",a),js(e)&&(a+="^{"+t(e.sup,i)+"}"),Gs(e)&&(a+="_{"+t(e.sub,i)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fs(e,0),i)+"|_{",e.arg&&2===e.arg.length)a+=t(Fs(e,1));else{let s="";for(let i=1;i=2)a=t(Fs(e,0),i),Hs(Fs(e,0))||Ns(Fs(e,0))||(a=li(e.fence||"(),",a)),a+="^{"+t(Fs(e,1),i)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,i)).join(" = ");else{const s=function(t){let e=Ts[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=s;let o="";if(/%(?![01_^])/.test(s)&&Array.isArray(e.arg)&&e.arg.length>1)a+=li(e.fence||"(),",...e.arg.map(e=>t(e,i)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fs(e,0),i),r=t(Fs(e,1),i),l=[...e.arg];/%0/.test(s)&&(a=a.replace("%0",n),l.shift()),/%1/.test(s)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=li(e.fence||"(),",...l.map(e=>t(e,i))))}else o=li(e.fence||"(),","");a=js(e)?a.replace("%^","^{"+t(e.sup,i)+"}"):a.replace("%^",""),a=Gs(e)?a.replace("%_","_{"+t(e.sub,i)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const s=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?s.push(li("() ",t(a,i))):0!==Vs(o=a)&&0!==Us(o)?s.push(li("() ",t(a,i))):js(e)&&0!==Us(a)&&1!==Us(a)?s.push(li("() ",t(a,i))):s.push(t(a,i));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hs(e.arg[0])&&"divide"!==e.arg[0].fn||Hs(e.arg[1])&&(0!==Vs(e.arg[1])||1!==Us(e.arg[1]))?s.join(" \\times "):s[0]+s[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hs(e.arg[0])&&Ws(e.arg[0])<0?s[0]:"+"+s[0];else{a=s[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function ui(t){let e=0;if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&(e+=1);return 1===e}function fi(t){let e="";if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&"string"==typeof s.body&&(e+=s.body);return e}function gi(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],s,a)}else t.addEventListener(a,s,i)}}function yi(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],s,a)}else t.removeEventListener(a,s,i)}}function bi(t,e){let s=document.getElementById(t);return s?s.setAttribute("data-refcount",parseInt(s.getAttribute("data-refcount"))+1):(s=document.createElement("div"),s.setAttribute("aria-hidden","true"),s.setAttribute("data-refcount","1"),s.className=e,s.id=t,document.body.appendChild(s)),s}function xi(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ki(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function s(t){return""+t+""}if(!t)return"";let i="";if(t.id&&"math"===e.speechMode&&(i+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let s=te.toSpeakableFragment(t.index,e);s=s.trim();const a=s.replace(//g,"");i+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+s+', of '+n+'. End root'}else ui(t.body)?i+=" the square root of "+n+" , ":i+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":i+=mi[t.leftDelim]||t.leftDelim,i+=te.toSpeakableFragment(t.body,e),i+=mi[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":i+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=t.latex?t.latex.trim():"";if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){i=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)i+=a;else{if("mbin"===t.type&&(i+=''),a){const t=mi[a]||(o?mi[o.trim()]:"");if(t)i+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";i+=t||function(t){let s="";return e.textToSpeechMarkup?/[a-z]/.test(t)?s+=' '+t+"":/[A-Z]/.test(t)?s+="capital "+t.toLowerCase():s+=t:/[a-z]/.test(t)?s+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?s+=" 'capital "+t.toUpperCase()+"'":s+=t,s}(a)}}else i+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(i+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let s=te.toSpeakableFragment(t.superscript,e);s=s.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the summation from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=te.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the summation from '+s+' of ',r=!0}else i+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let s=te.toSpeakableFragment(t.superscript,e);s=s.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the product from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=te.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the product from '+s+' of ',r=!0}else i+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),i+=' the integral from '+s(o)+' to '+s(a)+' of ',r=!0}else i+=' the integral of ';else if("string"==typeof t.body){i+=mi[t.body]||mi[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?i+=" "+t.latex.substr(1):i+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),ui(t.body)?i+=" crossed out "+n+" , ":i+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let s=te.toSpeakableFragment(t.superscript,e);s=s.trim();const a=s.replace(/<[^>]*>/g,"");if(ui(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(i+='')}"′"===a?i+=" prime ":"2"===a?i+=" squared ":"3"===a?i+=" cubed ":isNaN(parseInt(a))?i+=" to the "+s+"; ":i+=' to the '+a+" power; "}else isNaN(parseInt(a))?i+=" raised to the "+s+"; ":i+=' raised to the '+a+" power; "}if(!r&&t.subscript){let s=te.toSpeakableFragment(t.subscript,e);s=s.trim(),ui(t.subscript)?i+=" sub "+s:i+=" subscript "+s+". End subscript. "}}return i},te.toSpeakableText=function(t,e){const s=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(s.speechMode="math",window.sre&&"sre"===s.textToSpeechRules){s.generateID=!0;const e=te.toMathML(t,s);return e?(s.textToSpeechMarkup&&(s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup=s.textToSpeechMarkup,"ssml"===s.textToSpeechRulesOptions.markup&&(s.textToSpeechRulesOptions.markup="ssml_step"),s.textToSpeechRulesOptions.rate=s.speechEngineRate),s.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(s.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let i=te.toSpeakableFragment(t,s);if("ssml"===s.textToSpeechMarkup){let t="";s.speechEngineRate&&(t=''),i=''+t+"

    "+i+"

    "+(t?"
    ":"")+""}else i="mac"===s.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?i.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):i.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return i};class vi{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let s=this.element.textContent;s&&(s=s.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?i+="\n \n \n ":i+='',i+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(i+=`"):i+="",i+="",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=i;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bi("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bi("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gi(this.element,"focus",this),gi(this.element,"blur",this),gi(this.textarea,"cut",this),gi(this.textarea,"copy",this),gi(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gi(this.field,"pointerdown",this):gi(this.field,"touchstart:active mousedown",this),gi(window,"resize",this);const o={...e};o.onSelectionDidChange=vi.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vi.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Be.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const s=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=s}}(this.mathlist),s.length>0&&this.$latex(s),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ki(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,yi(this.textarea,"cut",this),yi(this.textarea,"copy",this),yi(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xi(this.popover),xi(this.keystrokeCaption),xi(this.virtualKeyboard),xi(document.getElementById("mathlive-alternate-keys-panel")),yi(this.element,"pointerdown",this),yi(this.element,"touchstart:active mousedown",this),yi(this.element,"focus",this),yi(this.element,"blur",this),yi(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let s;return Array.from(e.children).forEach((function(e){s=s||t(e)})),s}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const s=t.getBoundingClientRect();s.lefte.right&&(e.right=s.right),s.bottom>e.bottom&&(e.bottom=s.bottom),s.top=t.left&&s<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,s,i);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(i=me.pathFromString(e[0]).path,0===s.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const i=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=i=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){if(this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,s=this._pathFromPoint(d,p,{bias:0}),s){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,s),s=me.clone(this.mathlist.path),s[s.length-1].offset-=1):this.mathlist.setPath(s,0),o=!0,this.style={},3===t.detail||Si>2?(n(t),3!==t.detail&&3!==Si||this.mathlist.selectAll_()):i||(i=!0,window.PointerEvent?(gi(e.field,"pointermove",h),gi(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gi(window,"blur",n),t.touches?(gi(t.target,"touchmove",h),gi(t.target,"touchend",n)):(gi(window,"mousemove",h),gi(window,"mouseup",n))),2!==t.detail&&2!==Si||(a=!0,this.mathlist.selectGroup_()))}}else wi=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const s=t?t.path:[],i=this.mathlist.path,a=i[i.length-1];let o="";for(;s.length>i.length;)o+="out of "+e(t.parent(),s[s.length-1])+"; ",s.pop();if(!this.mathlist.isCollapsed())return Ai(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=Ai(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,s)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const s=this.element.getBoundingClientRect();e.style.left=s.left+"px",e.style.top=s.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,s=!1,i=[],a=!1;if(Array.isArray(t)?(e=t[0],i=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...i),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,s=!0}else"function"==typeof this[e]&&(a=this[e](...i),s=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),s}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let s=0,i=!1;for(this.mathlist.contentWillChange();!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),i||(a.applyStyle({mode:"text"}),a.latex=a.body),s-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let s=0,i=!1;for(;!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),i||a.applyStyle({mode:"math",type:"mord"}),s-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,s=!1;for(;!s;){const i=this.mathlist.sibling(e);s=!(i&&("text"===i.mode&&!i.type||"math"===i.mode&&/mord|textord|mpunct/.test(i.type))),s||(t=i.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(s));const i=this.getTextBeforeAnchor_()+s;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(s))return!0;if(/[\^_]/.test(s))return/(^|\s)[a-zA-Z][^_]$/.test(i)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[s];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(i))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(s))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(i))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(i)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(i))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(s))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(i)&&!/(dxd|abc|xyz|uvw)$/.test(i))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(i))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(i)&&!/(αβγ)$/.test(i))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(s))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let s,i,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!s&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const i=this.mode;s?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==i&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(s||a||(a=ve.selectorForKeystroke(this.mode,t)),!s&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!s){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||s)&&s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const s=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[i],{...this.config,suppressChangeNotifications:!0}),this.mode=s}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(s,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),s.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),s=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(s),s))return}let s="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=i(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),i=At.suggest(e+t);a=i.length>1,0===i.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),i[0].match!==e+t&&this.mathlist.insertSuggestion(i[0].match,-i[0].match.length+e.length+1),s=i[0].match)}else if("math"===this.mode){const s={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(s){if("moveToSuperscript"===s){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===s&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(s)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,s,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let s=0;ski(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,s=!1;for(;t&&!s;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,s=!0),e+=1,t=this.mathlist.ancestor(e)}const s=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),i=N.makeSpan(s,"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",i.height,"em");const o=[a];if(0!==i.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",i.height+i.depth,"em"),t.setStyle("vertical-align",-i.depth,"em"),o.push(t)}o.push(i);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let s="";if("latex"===(e=e||"latex")||"latex-expanded"===e)s=t.toLatex("latex-expanded"===e);else if("mathML"===e)s=t.toMathML(this.config);else if("spoken"===e)s=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",s=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const i=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),s=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=i,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);s=JSON.stringify(e)}else"ASCIIMath"===e&&(s=function t(e,s){if(!e)return"";if(Array.isArray(e)){let s="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let i=0;for(s='"';e[i]&&"text"===e[i].mode;)s+=e[i].body,i++;s+='"'+t(e.slice(i))}else{let i=0;for(;e[i]&&"math"===e[i].mode;)s+=t(e[i]),i++;s+=t(e.slice(i))}return s.trim()}if("text"===e.mode)return'"'+e.body+'"';let i="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":i=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(i+="(",i+=t(e.numer),i+=")/(",i+=t(e.denom),i+=")"):(i+="("+t(e.numer)+"),",i+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?i+="root("+t(e.index)+")("+t(e.body)+")":i+="sqrt("+t(e.body)+")";break;case"leftright":i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",i+=t(e.body),i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":i=hs[a]||a||("string"==typeof e.body?e.body:""),"\\"===i[0]&&(i+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?i=String.fromCharCode(parseInt("0x"+o[1])):i.length>0&&"\\"===i.charAt(0)&&(i="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":i=a&&hs[a]?hs[a]:a&&ds[a]?ds[a]:e.body;break;case"mopen":case"mclose":i+=e.body;break;case"mpunct":i=ds[a]||a;break;case"mop":"​"!==e.body&&(i="",i+="\\operatorname"===a?t(e.body):e.body||a,i+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":i=" "}if(e.subscript){i+="_";const s=t(e.subscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}if(e.superscript){i+="^";const s=t(e.superscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}return i}(t,this.config));return s}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const s=te.makeRoot("math",e);return this.formatMathlist(s,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!0:s.subscript&&(i=!1),e+=1,s=this.mathlist.ancestor(e);return i?t:0}_subscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!1:s.subscript&&(i=!0),e+=1,s=this.mathlist.ancestor(e);return i?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const s=this._getSelectionBounds();s&&(t={x:s.right+e.left-this.field.scrollLeft,y:s.top+e.top-this.field.scrollTop})}if(t){const s=t.x-window.scrollX;se.right&&this.field.scroll({top:0,left:s-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const s=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=s)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,s){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,s&&this.$insert(s,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const s=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(s)}else{const s=he.parseTokens(n(e),t,null,this.config.macros);s?this.mathlist.spliceCommandStringAroundInsertionPoint(s):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const s=this.suggestionIndex%e.length,i=t.length-e[s].match.length;0!==i&&this.mathlist.insertSuggestion(e[s].match,i),Je.showPopoverWithLatex(this,e[s].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const s=this;let i,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gi(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),i=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+s.config.namespace+"command-pressed");n&&s.$perform(JSON.parse(n));const l=t.getAttribute("data-"+s.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&s.$perform(JSON.parse(l))}),300))}})),gi(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gi(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?s.style.width="286px":4===e.length||2===e.length?s.style.width="146px":1===e.length?s.style.width="86px":s.style.width="146px",s.style.height="auto";let i="";for(const t of e)i+="";i="
      "+i+"
    ",s.innerHTML=i,cs.makeKeycap(this,s.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-s.clientHeight<0&&(s.style.width="auto",e.length<=6?s.style.height="56px":e.length<=12?s.style.height="108px":s.style.height="205px");const t=(a.top-s.clientHeight+5).toString()+"px",i=Math.max(0,Math.min(window.innerWidth-s.offsetWidth,(a.left+a.right-s.offsetWidth)/2))+"px";s.style.transform="translate("+i+","+t+")",s.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xi(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let s=!1;for(let i=0;i=1){s=[];for(let t=1;t<=i;t++)s.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),i=t.mathlist.endOffset()+1;if(i<=e.length-1){s=[];for(let t=i;t<=e.length-1;t++)s.push(e[t])}break}case"start":case"end":break;case"group":s=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(s=t.mathlist.parent());break}}return s}(this,t);if(null===s)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const i={...this.config};(e.withHighlighting||"amazon"===i.speechEngine)&&(i.textToSpeechMarkup=window.sre&&"sre"===i.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(i.generateID=!0));const a=te.toSpeakableText(s,i);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,i),!1}}let wi,Si=0;function Ai(t,e,s){const i=Object.assign({},t.config);return i.textToSpeechMarkup="",i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(s,i)}function Mi(t,e,s,i){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=Ai(t,"deleted: ",i):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(s):"replacement"===e?a=Ai(t,"",t.mathlist.sibling(0)):"line"===e?(a=Ai(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=i?Ai(t,e+" ",i):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vi.prototype.undo_=vi.prototype.undo,vi.prototype.redo_=vi.prototype.redo,vi.prototype.scrollIntoView_=vi.prototype.scrollIntoView,vi.prototype.scrollToStart_=vi.prototype.scrollToStart,vi.prototype.scrollToEnd_=vi.prototype.scrollToEnd,vi.prototype.insert_=vi.prototype.$insert;var Ci={isValidMathfield:ki,MathField:vi};function _i(t,e,s){let i=s,a=0;const o=t.length;for(;i0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_i(s,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+s.length),mathstyle:i}),c=r+s.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){s.textContent=t}return s.className="sr-only",s}(t,s)),/\bspeakable-text\b/i.test(s.renderAccessibleContent)&&s.renderToSpeakableText){const i=document.createElement("span");i.innerHTML=s.renderToSpeakableText(t,s),i.className="sr-only",e.appendChild(i)}return e.appendChild(a),e}return a}function Di(t,e){let s=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))s=document.createDocumentFragment(),s.appendChild(Fi(t,void 0,e,!0));else{const i=Li(t,e.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;s=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Bi(t,e,s){if(!window)return;if(!s&&window.mathlive&&(s=window.mathlive.config),"amazon"!==(s=s||{}).speechEngine)return void(s.handleSpeak&&s.handleSpeak(e));if(!window.AWS)return;const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:s.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=s.onReadAloudStatus||window.mathlive.onReadAloudStatus;i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),s=new Blob([t.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(s);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const s of window.mathlive.readAloudMarks)s.time0&&Array.from(e.children).forEach(e=>{t(e,s)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=i,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function $i(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Ri(t,e){Ei&&((e=e||{}).renderToMarkup=e.renderToMarkup||qi,e.renderToMathML=e.renderToMathML||Ii,e.renderToSpeakableText=e.renderToSpeakableText||Pi,e.macros=e.macros||At.MACROS,Ei.renderMathInElement($i(t),e))}function Ki(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const Ni={latexToMarkup:qi,latexToMathML:Ii,latexToSpeakableText:Pi,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const s=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(s,e)},astToLatex:function(t,e){return pi(t,e)},makeMathField:function(t,e){if(!Ci)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Oi,e.handleReadAloud=e.handleReadAloud||Bi,new Ci.MathField($i(t),e)},renderMathInDocument:function(t){Ri(document.body,t)},renderMathInElement:Ri,revertToOriginalContent:function(t,e){(t=(t=$i(t)).children[1])instanceof Ci.MathField?t.revertToOriginalContent():(Ki(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=$i(t)).children[1])instanceof Ci.MathField?t.originalContent:(Ki(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Bi,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let s=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(s=e.time/1e3);let i=window.mathlive.readAloudTokens.indexOf(t);i>=0&&(i+=e,i−"; + "' data-alt-keys='-' data-key='-' data-alt-keys='-'>−"; } else if (/tt/.test(cls)) { row += "
  • +

    For example, when typing "if x >0":

    +
      +
    • "i" -> math mode, imaginary unit
    • +
    • "if" -> text mode, english word "if"
    • +
    • "if x" -> all in text mode, maybe the next word is xylophone?
    • +
    • "if x >" -> "if" stays in text mode, but now "x >" is in math mode
    • +
    • "if x > 0" -> "if" in text mode, "x > 0" in math mode
    • +
    +

    Smart Mode is off by default.

    +

    Manually switching mode (by typing alt/option+=) will temporarily turn off smart mode.

    +

    Examples

    +
      +
    • slope = rise/run
    • +
    • If x > 0, then f(x) = sin(x)
    • +
    • x^2 + sin (x) when x > 0
    • +
    • When x<0, x^{2n+1}<0
    • +
    • Graph x^2 -x+3 =0 for 0<=x<=5
    • +
    • Divide by x-3 and then add x^2-1 to both sides
    • +
    • Given g(x) = 4x – 3, when does g(x)=0?
    • +
    • Let D be the set {(x,y)|0<=x<=1 and 0<=y<=x}
    • +
    • \int_{the unit square} f(x,y) dx dy
    • +
    • For all n in NN
    • +
    +

    config.smartSuperscript=true:boolean

    If true, when a digit is entered in an empty superscript, the cursor leaps automatically out of the superscript. This makes entry of common diff --git a/tutorials/CONFIG.md b/tutorials/CONFIG.md index 2e985ef9e..8267fa962 100644 --- a/tutorials/CONFIG.md +++ b/tutorials/CONFIG.md @@ -174,6 +174,37 @@ If `false`, the literal value of the character will be inserted instead. --- +**`config.smartMode=false`**:`boolean` + +If `config.smartMode = true`, during text input the field will switch automatically between 'math' and 'text' mode depending on what is typed and the context of the formula. If necessary, what was previously typed will be 'fixed' to account for the new info. + +For example, when typing "if x >0": + +- "i" -> math mode, imaginary unit +- "if" -> text mode, english word "if" +- "if x" -> all in text mode, maybe the next word is xylophone? +- "if x >" -> "if" stays in text mode, but now "x >" is in math mode +- "if x > 0" -> "if" in text mode, "x > 0" in math mode + +Smart Mode is off by default. + +Manually switching mode (by typing `alt/option+=`) will temporarily turn off smart mode. + +**Examples** + +- slope = rise/run +- If x > 0, then f(x) = sin(x) +- x^2 + sin (x) when x > 0 +- When x<0, x^{2n+1}<0 +- Graph x^2 -x+3 =0 for 0<=x<=5 +- Divide by x-3 and then add x^2-1 to both sides +- Given g(x) = 4x – 3, when does g(x)=0? +- Let D be the set {(x,y)|0<=x<=1 and 0<=y<=x} +- \int\_{the unit square} f(x,y) dx dy +- For all n in NN + +--- + **`config.smartSuperscript=true`**:`boolean` If `true`, when a digit is entered in an empty superscript, the cursor From 1c694d9f34dfa8d5f0c810f559a5190d6cd53f75 Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Wed, 5 Feb 2020 17:39:21 -0800 Subject: [PATCH 15/28] 0.34.0 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index c00298313..16677d35f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "mathlive", - "version": "0.33.2", + "version": "0.34.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index dd3bebfca..8ea8f38e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mathlive", - "version": "0.33.2", + "version": "0.34.0", "description": "Render and edit beautifully typeset math", "license": "MIT", "funding": { From f5f01c33a3d9930a0a7a07c969459163fb07bb93 Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Wed, 5 Feb 2020 17:57:39 -0800 Subject: [PATCH 16/28] Updated CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47fad612e..eeca9d140 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## +## 0.34 (Feb 5, 2020) ### Bug Fixes From e74fba1bd570f96c71a86af3d5a60720b6b7b3b6 Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Wed, 5 Feb 2020 18:09:53 -0800 Subject: [PATCH 17/28] chore: avoid prettify-ing the dist directory --- dist/mathlive.core.css | 204 +- dist/mathlive.css | 2085 +--- dist/mathlive.js | 21073 +-------------------------------------- package.json | 6 +- 4 files changed, 8 insertions(+), 23360 deletions(-) diff --git a/dist/mathlive.core.css b/dist/mathlive.core.css index 23c4ba849..0f3f2a4ec 100644 --- a/dist/mathlive.core.css +++ b/dist/mathlive.core.css @@ -1,203 +1 @@ -.ML__mathlive { - line-height: 0; - direction: ltr; - text-align: left; - text-indent: 0; - text-rendering: auto; - font-style: normal; - font-size-adjust: none; - letter-spacing: normal; - word-wrap: normal; - word-spacing: normal; - white-space: nowrap; - display: inline-block; - text-shadow: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - width: -webkit-min-content; - width: -moz-min-content; - width: min-content; - transform: translateZ(0); -} -.ML__base { - display: inline-block; - position: relative; - cursor: text; -} -.ML__strut, -.ML__strut--bottom { - display: inline-block; - min-height: 1em; -} -.ML__caret:after { - content: ''; - border: none; - border-radius: 2px; - border-right: 2px solid var(--caret); - margin-right: -2px; - position: relative; - left: -1px; - -webkit-animation: ML__caret-blink 1.05s step-end infinite forwards; - animation: ML__caret-blink 1.05s step-end infinite forwards; -} -.ML__text-caret:after { - content: ''; - border: none; - border-radius: 1px; - border-right: 1px solid var(--caret); - margin-right: -1px; - position: relative; - left: 0; - -webkit-animation: ML__caret-blink 1.05s step-end infinite forwards; - animation: ML__caret-blink 1.05s step-end infinite forwards; -} -.ML__command-caret:after { - content: '_'; - border: none; - margin-right: -1ex; - position: relative; - color: var(--caret); - -webkit-animation: ML__caret-blink 1.05s step-end infinite forwards; - animation: ML__caret-blink 1.05s step-end infinite forwards; -} -.ML__text { - line-height: 1; - white-space: pre; -} -.ML__focused .ML__text { - background: hsla(var(--hue), 40%, 50%, 0.1); -} -@-webkit-keyframes ML__caret-blink { - 0%, - to { - opacity: 1; - } - 50% { - opacity: 0; - } -} -@keyframes ML__caret-blink { - 0%, - to { - opacity: 1; - } - 50% { - opacity: 0; - } -} -.ML__textarea__textarea { - transform: scale(0); - resize: none; - position: absolute; - clip: rect(0 0 0 0); - width: 1px; - height: 1px; - font-size: 16px; -} -.ML__fieldcontainer { - display: flex; - flex-flow: row; - justify-content: space-between; - align-items: flex-end; - min-height: 39px; - touch-action: none; - width: 100%; - --hue: 212; - --highlight: hsl(var(--hue), 97%, 85%); - --caret: hsl(var(--hue), 40%, 49%); - --highlight-inactive: #ccc; - --primary: hsl(var(--hue), 40%, 50%); - --secondary: hsl(var(--hue), 19%, 26%); - --on-secondary: hsl(var(--hue), 19%, 26%); -} -@media (prefers-color-scheme: dark) { - body:not([theme='light']) .ML__fieldcontainer { - --highlight: hsl(var(--hue), 40%, 49%); - --highlight-inactive: hsl(var(--hue), 10%, 35%); - --caret: hsl(var(--hue), 97%, 85%); - --secondary: hsl(var(--hue), 25%, 35%); - --on-secondary: #fafafa; - } -} -body[theme='dark'] .ML__fieldcontainer { - --highlight: hsl(var(--hue), 40%, 49%); - --highlight-inactive: hsl(var(--hue), 10%, 35%); - --caret: hsl(var(--hue), 97%, 85%); - --secondary: hsl(var(--hue), 25%, 35%); - --on-secondary: #fafafa; -} -.ML__fieldcontainer:focus { - outline: 2px solid var(--primary); - outline-offset: 3px; -} -.ML__fieldcontainer__field { - align-self: center; - position: relative; - overflow: hidden; - line-height: 0; - padding: 2px; - width: 100%; -} -.ML__virtual-keyboard-toggle { - display: flex; - align-self: center; - align-items: center; - flex-shrink: 0; - flex-direction: column; - justify-content: center; - width: 34px; - height: 34px; - padding: 0; - margin-right: 4px; - cursor: pointer; - box-sizing: border-box; - border-radius: 50%; - border: 1px solid transparent; - transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); - color: var(--primary); - fill: currentColor; - background: transparent; -} -.ML__virtual-keyboard-toggle:hover { - background: hsl(var(--hue), 25%, 35%); - color: #fafafa; - fill: currentColor; - border-radius: 50%; - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), - 0 3px 1px -2px rgba(0, 0, 0, 0.2); -} -.ML__popover { - visibility: hidden; - min-width: 160px; - background-color: rgba(97, 97, 97, 0.95); - color: #fff; - text-align: center; - border-radius: 6px; - position: fixed; - z-index: 1; - display: flex; - flex-direction: column; - justify-content: center; - box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); - transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1); -} -.ML__popover:after { - content: ''; - position: absolute; - top: -5px; - left: calc(50% - 3px); - width: 0; - height: 0; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - font-size: 1rem; - border-bottom: 5px solid rgba(97, 97, 97, 0.9); -} -.reverse-direction:after { - top: auto; - bottom: -5px; - border-top: 5px solid rgba(97, 97, 97, 0.9); - border-bottom: 0; -} +.ML__mathlive{line-height:0;direction:ltr;text-align:left;text-indent:0;text-rendering:auto;font-style:normal;font-size-adjust:none;letter-spacing:normal;word-wrap:normal;word-spacing:normal;white-space:nowrap;display:inline-block;text-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:-webkit-min-content;width:-moz-min-content;width:min-content;transform:translateZ(0)}.ML__base{display:inline-block;position:relative;cursor:text}.ML__strut,.ML__strut--bottom{display:inline-block;min-height:1em}.ML__caret:after{content:"";border:none;border-radius:2px;border-right:2px solid var(--caret);margin-right:-2px;position:relative;left:-1px;-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__text-caret:after{content:"";border:none;border-radius:1px;border-right:1px solid var(--caret);margin-right:-1px;position:relative;left:0;-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__command-caret:after{content:"_";border:none;margin-right:-1ex;position:relative;color:var(--caret);-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__text{line-height:1;white-space:pre}.ML__focused .ML__text{background:hsla(var(--hue),40%,50%,.1)}@-webkit-keyframes ML__caret-blink{0%,to{opacity:1}50%{opacity:0}}@keyframes ML__caret-blink{0%,to{opacity:1}50%{opacity:0}}.ML__textarea__textarea{transform:scale(0);resize:none;position:absolute;clip:rect(0 0 0 0);width:1px;height:1px;font-size:16px}.ML__fieldcontainer{display:flex;flex-flow:row;justify-content:space-between;align-items:flex-end;min-height:39px;touch-action:none;width:100%;--hue:212;--highlight:hsl(var(--hue),97%,85%);--caret:hsl(var(--hue),40%,49%);--highlight-inactive:#ccc;--primary:hsl(var(--hue),40%,50%);--secondary:hsl(var(--hue),19%,26%);--on-secondary:hsl(var(--hue),19%,26%)}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__fieldcontainer{--highlight:hsl(var(--hue),40%,49%);--highlight-inactive:hsl(var(--hue),10%,35%);--caret:hsl(var(--hue),97%,85%);--secondary:hsl(var(--hue),25%,35%);--on-secondary:#fafafa}}body[theme=dark] .ML__fieldcontainer{--highlight:hsl(var(--hue),40%,49%);--highlight-inactive:hsl(var(--hue),10%,35%);--caret:hsl(var(--hue),97%,85%);--secondary:hsl(var(--hue),25%,35%);--on-secondary:#fafafa}.ML__fieldcontainer:focus{outline:2px solid var(--primary);outline-offset:3px}.ML__fieldcontainer__field{align-self:center;position:relative;overflow:hidden;line-height:0;padding:2px;width:100%}.ML__virtual-keyboard-toggle{display:flex;align-self:center;align-items:center;flex-shrink:0;flex-direction:column;justify-content:center;width:34px;height:34px;padding:0;margin-right:4px;cursor:pointer;box-sizing:border-box;border-radius:50%;border:1px solid transparent;transition:background .2s cubic-bezier(.64,.09,.08,1);color:var(--primary);fill:currentColor;background:transparent}.ML__virtual-keyboard-toggle:hover{background:hsl(var(--hue),25%,35%);color:#fafafa;fill:currentColor;border-radius:50%;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.ML__popover{visibility:hidden;min-width:160px;background-color:rgba(97,97,97,.95);color:#fff;text-align:center;border-radius:6px;position:fixed;z-index:1;display:flex;flex-direction:column;justify-content:center;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);transition:all .2s cubic-bezier(.64,.09,.08,1)}.ML__popover:after{content:"";position:absolute;top:-5px;left:calc(50% - 3px);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;font-size:1rem;border-bottom:5px solid rgba(97,97,97,.9)}.reverse-direction:after{top:auto;bottom:-5px;border-top:5px solid rgba(97,97,97,.9);border-bottom:0} \ No newline at end of file diff --git a/dist/mathlive.css b/dist/mathlive.css index 4cd382404..42f46755d 100644 --- a/dist/mathlive.css +++ b/dist/mathlive.css @@ -1,2084 +1 @@ -@font-face { - font-family: KaTeX_AMS; - src: url(fonts/KaTeX_AMS-Regular.woff2) format('woff2'), - url(fonts/KaTeX_AMS-Regular.woff) format('woff'); - font-weight: 400; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Caligraphic; - src: url(fonts/KaTeX_Caligraphic-Bold.woff2) format('woff2'), - url(fonts/KaTeX_Caligraphic-Bold.woff) format('woff'); - font-weight: 700; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Caligraphic; - src: url(fonts/KaTeX_Caligraphic-Regular.woff2) format('woff2'), - url(fonts/KaTeX_Caligraphic-Regular.woff) format('woff'); - font-weight: 400; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Fraktur; - src: url(fonts/KaTeX_Fraktur-Bold.woff2) format('woff2'), - url(fonts/KaTeX_Fraktur-Bold.woff) format('woff'); - font-weight: 700; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Fraktur; - src: url(fonts/KaTeX_Fraktur-Regular.woff2) format('woff2'), - url(fonts/KaTeX_Fraktur-Regular.woff) format('woff'); - font-weight: 400; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Main; - src: url(fonts/KaTeX_Main-BoldItalic.woff2) format('woff2'), - url(fonts/KaTeX_Main-BoldItalic.woff) format('woff'); - font-weight: 700; - font-style: italic; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Main; - src: url(fonts/KaTeX_Main-Bold.woff2) format('woff2'), - url(fonts/KaTeX_Main-Bold.woff) format('woff'); - font-weight: 700; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Main; - src: url(fonts/KaTeX_Main-Italic.woff2) format('woff2'), - url(fonts/KaTeX_Main-Italic.woff) format('woff'); - font-weight: 400; - font-style: italic; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Math; - src: url(fonts/KaTeX_Math-BoldItalic.woff2) format('woff2'), - url(fonts/KaTeX_Math-BoldItalic.woff) format('woff'); - font-weight: 700; - font-style: italic; - font-display: 'swap'; -} -@font-face { - font-family: 'KaTeX_SansSerif'; - src: url(fonts/KaTeX_SansSerif-Bold.woff2) format('woff2'), - url(fonts/KaTeX_SansSerif-Bold.woff) format('woff'); - font-weight: 700; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: 'KaTeX_SansSerif'; - src: url(fonts/KaTeX_SansSerif-Italic.woff2) format('woff2'), - url(fonts/KaTeX_SansSerif-Italic.woff) format('woff'); - font-weight: 400; - font-style: italic; - font-display: 'swap'; -} -@font-face { - font-family: 'KaTeX_SansSerif'; - src: url(fonts/KaTeX_SansSerif-Regular.woff2) format('woff2'), - url(fonts/KaTeX_SansSerif-Regular.woff) format('woff'); - font-weight: 400; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Script; - src: url(fonts/KaTeX_Script-Regular.woff2) format('woff2'), - url(fonts/KaTeX_Script-Regular.woff) format('woff'); - font-weight: 400; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Size1; - src: url(fonts/KaTeX_Size1-Regular.woff2) format('woff2'), - url(fonts/KaTeX_Size1-Regular.woff) format('woff'); - font-weight: 400; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Size2; - src: url(fonts/KaTeX_Size2-Regular.woff2) format('woff2'), - url(fonts/KaTeX_Size2-Regular.woff) format('woff'); - font-weight: 400; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Size3; - src: url(fonts/KaTeX_Size3-Regular.woff2) format('woff2'), - url(fonts/KaTeX_Size3-Regular.woff) format('woff'); - font-weight: 400; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Size4; - src: url(fonts/KaTeX_Size4-Regular.woff2) format('woff2'), - url(fonts/KaTeX_Size4-Regular.woff) format('woff'); - font-weight: 400; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Typewriter; - src: url(fonts/KaTeX_Typewriter-Regular.woff2) format('woff2'), - url(fonts/KaTeX_Typewriter-Regular.woff) format('woff'); - font-weight: 400; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Main; - src: url(fonts/KaTeX_Main-Regular.woff2) format('woff2'), - url(fonts/KaTeX_Main-Regular.woff) format('woff'); - font-weight: 400; - font-style: normal; - font-display: 'swap'; -} -@font-face { - font-family: KaTeX_Math; - src: url(fonts/KaTeX_Math-Italic.woff2) format('woff2'), - url(fonts/KaTeX_Math-Italic.woff) format('woff'); - font-weight: 400; - font-style: italic; - font-display: 'swap'; -} -.sr-only { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - overflow: hidden; - clip: rect(0, 0, 0, 0); - white-space: nowrap; - border: 0; -} -.ML__mathit { - font-family: KaTeX_Math; - font-style: italic; -} -.ML__mathrm { - font-family: KaTeX_Main; - font-style: normal; -} -.ML__mathbf { - font-family: KaTeX_Main; - font-weight: 700; -} -.ML__mathbfit { - font-family: KaTeX_Math; - font-weight: 700; - font-style: italic; -} -.ML__ams, -.ML__bb { - font-family: KaTeX_AMS; -} -.ML__cal { - font-family: KaTeX_Caligraphic; -} -.ML__frak { - font-family: KaTeX_Fraktur; -} -.ML__tt { - font-family: KaTeX_Typewriter; -} -.ML__script { - font-family: KaTeX_Script; -} -.ML__sans { - font-family: KaTeX_SansSerif; -} -.ML__mainit { - font-family: KaTeX_Main; - font-style: italic; -} -.ML__series_el, -.ML__series_ul { - font-weight: 100; -} -.ML__series_l { - font-weight: 200; -} -.ML__series_sl { - font-weight: 300; -} -.ML__series_sb { - font-weight: 500; -} -.ML__bold { - font-weight: 700; -} -.ML__series_eb { - font-weight: 800; -} -.ML__series_ub { - font-weight: 900; -} -.ML__series_uc { - font-stretch: ultra-condensed; -} -.ML__series_ec { - font-stretch: extra-condensed; -} -.ML__series_c { - font-stretch: condensed; -} -.ML__series_sc { - font-stretch: semi-condensed; -} -.ML__series_sx { - font-stretch: semi-expanded; -} -.ML__series_x { - font-stretch: expanded; -} -.ML__series_ex { - font-stretch: extra-expanded; -} -.ML__series_ux { - font-stretch: ultra-expanded; -} -.ML__it { - font-style: italic; -} -.ML__shape_ol { - -webkit-text-stroke: 1px #000; - text-stroke: 1px #000; - color: transparent; -} -.ML__shape_sc { - font-variant: small-caps; -} -.ML__shape_sl { - font-style: oblique; -} -.ML__emph { - color: #bc2612; -} -.ML__emph .ML__emph { - color: #0c7f99; -} -.ML__mathlive .highlight { - color: #007cb2; - background: #edd1b0; -} -.ML__mathlive .reset-textstyle.scriptstyle { - font-size: 0.7em; -} -.ML__mathlive .reset-textstyle.scriptscriptstyle { - font-size: 0.5em; -} -.ML__mathlive .reset-scriptstyle.textstyle { - font-size: 1.42857em; -} -.ML__mathlive .reset-scriptstyle.scriptscriptstyle { - font-size: 0.71429em; -} -.ML__mathlive .reset-scriptscriptstyle.textstyle { - font-size: 2em; -} -.ML__mathlive .reset-scriptscriptstyle.scriptstyle { - font-size: 1.4em; -} -.ML__mathlive .style-wrap { - position: relative; -} -.ML__mathlive .vlist { - display: inline-block; -} -.ML__mathlive .vlist > span { - display: block; - height: 0; - position: relative; - line-height: 0; -} -.ML__mathlive .vlist > span > span { - display: inline-block; -} -.ML__mathlive .msubsup { - text-align: left; -} -.ML__mathlive .mfrac > span { - text-align: center; -} -.ML__mathlive .mfrac .frac-line { - width: 100%; -} -.ML__mathlive .mfrac .frac-line:after { - content: ''; - display: block; - margin-top: -0.04em; - border-bottom-style: solid; - border-bottom-width: 0.04em; - min-height: 0.04em; -} -.ML__mathlive .rspace.negativethinspace { - margin-right: -0.16667em; -} -.ML__mathlive .rspace.thinspace { - margin-right: 0.16667em; -} -.ML__mathlive .rspace.negativemediumspace { - margin-right: -0.22222em; -} -.ML__mathlive .rspace.mediumspace { - margin-right: 0.22222em; -} -.ML__mathlive .rspace.thickspace { - margin-right: 0.27778em; -} -.ML__mathlive .rspace.sixmuspace { - margin-right: 0.333333em; -} -.ML__mathlive .rspace.eightmuspace { - margin-right: 0.444444em; -} -.ML__mathlive .rspace.enspace { - margin-right: 0.5em; -} -.ML__mathlive .rspace.twelvemuspace { - margin-right: 0.666667em; -} -.ML__mathlive .rspace.quad { - margin-right: 1em; -} -.ML__mathlive .rspace.qquad { - margin-right: 2em; -} -.ML__mathlive .mspace { - display: inline-block; -} -.ML__mathlive .mspace.negativethinspace { - margin-left: -0.16667em; -} -.ML__mathlive .mspace.thinspace { - width: 0.16667em; -} -.ML__mathlive .mspace.negativemediumspace { - margin-left: -0.22222em; -} -.ML__mathlive .mspace.mediumspace { - width: 0.22222em; -} -.ML__mathlive .mspace.thickspace { - width: 0.27778em; -} -.ML__mathlive .mspace.sixmuspace { - width: 0.333333em; -} -.ML__mathlive .mspace.eightmuspace { - width: 0.444444em; -} -.ML__mathlive .mspace.enspace { - width: 0.5em; -} -.ML__mathlive .mspace.twelvemuspace { - width: 0.666667em; -} -.ML__mathlive .mspace.quad { - width: 1em; -} -.ML__mathlive .mspace.qquad { - width: 2em; -} -.ML__mathlive .llap, -.ML__mathlive .rlap { - width: 0; - position: relative; -} -.ML__mathlive .llap > .inner, -.ML__mathlive .rlap > .inner { - position: absolute; -} -.ML__mathlive .llap > .fix, -.ML__mathlive .rlap > .fix { - display: inline-block; -} -.ML__mathlive .llap > .inner { - right: 0; -} -.ML__mathlive .rlap > .inner { - left: 0; -} -.ML__mathlive .rule { - display: inline-block; - border: 0 solid; - position: relative; -} -.ML__mathlive .overline .overline-line, -.ML__mathlive .underline .underline-line { - width: 100%; -} -.ML__mathlive .overline .overline-line:before, -.ML__mathlive .underline .underline-line:before { - border-bottom-style: solid; - border-bottom-width: 0.04em; - content: ''; - display: block; -} -.ML__mathlive .overline .overline-line:after, -.ML__mathlive .underline .underline-line:after { - border-bottom-style: solid; - border-bottom-width: 0.04em; - min-height: thin; - content: ''; - display: block; - margin-top: -1px; -} -.ML__mathlive .sqrt { - display: inline-block; -} -.ML__mathlive .sqrt > .sqrt-sign { - font-family: KaTeX_Main; - position: relative; -} -.ML__mathlive .sqrt .sqrt-line { - height: 0.04em; - width: 100%; -} -.ML__mathlive .sqrt .sqrt-line:before { - content: ''; - display: block; - margin-top: -0.04em; - border-bottom-style: solid; - border-bottom-width: 0.04em; - min-height: 0.5px; -} -.ML__mathlive .sqrt .sqrt-line:after { - border-bottom-width: 1px; - content: ' '; - display: block; - margin-top: -0.1em; -} -.ML__mathlive .sqrt > .root { - margin-left: 0.27777778em; - margin-right: -0.55555556em; -} -.ML__mathlive .fontsize-ensurer, -.ML__mathlive .sizing { - display: inline-block; -} -.ML__mathlive .fontsize-ensurer.reset-size1.size1, -.ML__mathlive .sizing.reset-size1.size1 { - font-size: 1em; -} -.ML__mathlive .fontsize-ensurer.reset-size1.size2, -.ML__mathlive .sizing.reset-size1.size2 { - font-size: 1.4em; -} -.ML__mathlive .fontsize-ensurer.reset-size1.size3, -.ML__mathlive .sizing.reset-size1.size3 { - font-size: 1.6em; -} -.ML__mathlive .fontsize-ensurer.reset-size1.size4, -.ML__mathlive .sizing.reset-size1.size4 { - font-size: 1.8em; -} -.ML__mathlive .fontsize-ensurer.reset-size1.size5, -.ML__mathlive .sizing.reset-size1.size5 { - font-size: 2em; -} -.ML__mathlive .fontsize-ensurer.reset-size1.size6, -.ML__mathlive .sizing.reset-size1.size6 { - font-size: 2.4em; -} -.ML__mathlive .fontsize-ensurer.reset-size1.size7, -.ML__mathlive .sizing.reset-size1.size7 { - font-size: 2.88em; -} -.ML__mathlive .fontsize-ensurer.reset-size1.size8, -.ML__mathlive .sizing.reset-size1.size8 { - font-size: 3.46em; -} -.ML__mathlive .fontsize-ensurer.reset-size1.size9, -.ML__mathlive .sizing.reset-size1.size9 { - font-size: 4.14em; -} -.ML__mathlive .fontsize-ensurer.reset-size1.size10, -.ML__mathlive .sizing.reset-size1.size10 { - font-size: 4.98em; -} -.ML__mathlive .fontsize-ensurer.reset-size2.size1, -.ML__mathlive .sizing.reset-size2.size1 { - font-size: 0.71428571em; -} -.ML__mathlive .fontsize-ensurer.reset-size2.size2, -.ML__mathlive .sizing.reset-size2.size2 { - font-size: 1em; -} -.ML__mathlive .fontsize-ensurer.reset-size2.size3, -.ML__mathlive .sizing.reset-size2.size3 { - font-size: 1.14285714em; -} -.ML__mathlive .fontsize-ensurer.reset-size2.size4, -.ML__mathlive .sizing.reset-size2.size4 { - font-size: 1.28571429em; -} -.ML__mathlive .fontsize-ensurer.reset-size2.size5, -.ML__mathlive .sizing.reset-size2.size5 { - font-size: 1.42857143em; -} -.ML__mathlive .fontsize-ensurer.reset-size2.size6, -.ML__mathlive .sizing.reset-size2.size6 { - font-size: 1.71428571em; -} -.ML__mathlive .fontsize-ensurer.reset-size2.size7, -.ML__mathlive .sizing.reset-size2.size7 { - font-size: 2.05714286em; -} -.ML__mathlive .fontsize-ensurer.reset-size2.size8, -.ML__mathlive .sizing.reset-size2.size8 { - font-size: 2.47142857em; -} -.ML__mathlive .fontsize-ensurer.reset-size2.size9, -.ML__mathlive .sizing.reset-size2.size9 { - font-size: 2.95714286em; -} -.ML__mathlive .fontsize-ensurer.reset-size2.size10, -.ML__mathlive .sizing.reset-size2.size10 { - font-size: 3.55714286em; -} -.ML__mathlive .fontsize-ensurer.reset-size3.size1, -.ML__mathlive .sizing.reset-size3.size1 { - font-size: 0.625em; -} -.ML__mathlive .fontsize-ensurer.reset-size3.size2, -.ML__mathlive .sizing.reset-size3.size2 { - font-size: 0.875em; -} -.ML__mathlive .fontsize-ensurer.reset-size3.size3, -.ML__mathlive .sizing.reset-size3.size3 { - font-size: 1em; -} -.ML__mathlive .fontsize-ensurer.reset-size3.size4, -.ML__mathlive .sizing.reset-size3.size4 { - font-size: 1.125em; -} -.ML__mathlive .fontsize-ensurer.reset-size3.size5, -.ML__mathlive .sizing.reset-size3.size5 { - font-size: 1.25em; -} -.ML__mathlive .fontsize-ensurer.reset-size3.size6, -.ML__mathlive .sizing.reset-size3.size6 { - font-size: 1.5em; -} -.ML__mathlive .fontsize-ensurer.reset-size3.size7, -.ML__mathlive .sizing.reset-size3.size7 { - font-size: 1.8em; -} -.ML__mathlive .fontsize-ensurer.reset-size3.size8, -.ML__mathlive .sizing.reset-size3.size8 { - font-size: 2.1625em; -} -.ML__mathlive .fontsize-ensurer.reset-size3.size9, -.ML__mathlive .sizing.reset-size3.size9 { - font-size: 2.5875em; -} -.ML__mathlive .fontsize-ensurer.reset-size3.size10, -.ML__mathlive .sizing.reset-size3.size10 { - font-size: 3.1125em; -} -.ML__mathlive .fontsize-ensurer.reset-size4.size1, -.ML__mathlive .sizing.reset-size4.size1 { - font-size: 0.55555556em; -} -.ML__mathlive .fontsize-ensurer.reset-size4.size2, -.ML__mathlive .sizing.reset-size4.size2 { - font-size: 0.77777778em; -} -.ML__mathlive .fontsize-ensurer.reset-size4.size3, -.ML__mathlive .sizing.reset-size4.size3 { - font-size: 0.88888889em; -} -.ML__mathlive .fontsize-ensurer.reset-size4.size4, -.ML__mathlive .sizing.reset-size4.size4 { - font-size: 1em; -} -.ML__mathlive .fontsize-ensurer.reset-size4.size5, -.ML__mathlive .sizing.reset-size4.size5 { - font-size: 1.11111111em; -} -.ML__mathlive .fontsize-ensurer.reset-size4.size6, -.ML__mathlive .sizing.reset-size4.size6 { - font-size: 1.33333333em; -} -.ML__mathlive .fontsize-ensurer.reset-size4.size7, -.ML__mathlive .sizing.reset-size4.size7 { - font-size: 1.6em; -} -.ML__mathlive .fontsize-ensurer.reset-size4.size8, -.ML__mathlive .sizing.reset-size4.size8 { - font-size: 1.92222222em; -} -.ML__mathlive .fontsize-ensurer.reset-size4.size9, -.ML__mathlive .sizing.reset-size4.size9 { - font-size: 2.3em; -} -.ML__mathlive .fontsize-ensurer.reset-size4.size10, -.ML__mathlive .sizing.reset-size4.size10 { - font-size: 2.76666667em; -} -.ML__mathlive .fontsize-ensurer.reset-size5.size1, -.ML__mathlive .sizing.reset-size5.size1 { - font-size: 0.5em; -} -.ML__mathlive .fontsize-ensurer.reset-size5.size2, -.ML__mathlive .sizing.reset-size5.size2 { - font-size: 0.7em; -} -.ML__mathlive .fontsize-ensurer.reset-size5.size3, -.ML__mathlive .sizing.reset-size5.size3 { - font-size: 0.8em; -} -.ML__mathlive .fontsize-ensurer.reset-size5.size4, -.ML__mathlive .sizing.reset-size5.size4 { - font-size: 0.9em; -} -.ML__mathlive .fontsize-ensurer.reset-size5.size5, -.ML__mathlive .sizing.reset-size5.size5 { - font-size: 1em; -} -.ML__mathlive .fontsize-ensurer.reset-size5.size6, -.ML__mathlive .sizing.reset-size5.size6 { - font-size: 1.2em; -} -.ML__mathlive .fontsize-ensurer.reset-size5.size7, -.ML__mathlive .sizing.reset-size5.size7 { - font-size: 1.44em; -} -.ML__mathlive .fontsize-ensurer.reset-size5.size8, -.ML__mathlive .sizing.reset-size5.size8 { - font-size: 1.73em; -} -.ML__mathlive .fontsize-ensurer.reset-size5.size9, -.ML__mathlive .sizing.reset-size5.size9 { - font-size: 2.07em; -} -.ML__mathlive .fontsize-ensurer.reset-size5.size10, -.ML__mathlive .sizing.reset-size5.size10 { - font-size: 2.49em; -} -.ML__mathlive .fontsize-ensurer.reset-size6.size1, -.ML__mathlive .sizing.reset-size6.size1 { - font-size: 0.41666667em; -} -.ML__mathlive .fontsize-ensurer.reset-size6.size2, -.ML__mathlive .sizing.reset-size6.size2 { - font-size: 0.58333333em; -} -.ML__mathlive .fontsize-ensurer.reset-size6.size3, -.ML__mathlive .sizing.reset-size6.size3 { - font-size: 0.66666667em; -} -.ML__mathlive .fontsize-ensurer.reset-size6.size4, -.ML__mathlive .sizing.reset-size6.size4 { - font-size: 0.75em; -} -.ML__mathlive .fontsize-ensurer.reset-size6.size5, -.ML__mathlive .sizing.reset-size6.size5 { - font-size: 0.83333333em; -} -.ML__mathlive .fontsize-ensurer.reset-size6.size6, -.ML__mathlive .sizing.reset-size6.size6 { - font-size: 1em; -} -.ML__mathlive .fontsize-ensurer.reset-size6.size7, -.ML__mathlive .sizing.reset-size6.size7 { - font-size: 1.2em; -} -.ML__mathlive .fontsize-ensurer.reset-size6.size8, -.ML__mathlive .sizing.reset-size6.size8 { - font-size: 1.44166667em; -} -.ML__mathlive .fontsize-ensurer.reset-size6.size9, -.ML__mathlive .sizing.reset-size6.size9 { - font-size: 1.725em; -} -.ML__mathlive .fontsize-ensurer.reset-size6.size10, -.ML__mathlive .sizing.reset-size6.size10 { - font-size: 2.075em; -} -.ML__mathlive .fontsize-ensurer.reset-size7.size1, -.ML__mathlive .sizing.reset-size7.size1 { - font-size: 0.34722222em; -} -.ML__mathlive .fontsize-ensurer.reset-size7.size2, -.ML__mathlive .sizing.reset-size7.size2 { - font-size: 0.48611111em; -} -.ML__mathlive .fontsize-ensurer.reset-size7.size3, -.ML__mathlive .sizing.reset-size7.size3 { - font-size: 0.55555556em; -} -.ML__mathlive .fontsize-ensurer.reset-size7.size4, -.ML__mathlive .sizing.reset-size7.size4 { - font-size: 0.625em; -} -.ML__mathlive .fontsize-ensurer.reset-size7.size5, -.ML__mathlive .sizing.reset-size7.size5 { - font-size: 0.69444444em; -} -.ML__mathlive .fontsize-ensurer.reset-size7.size6, -.ML__mathlive .sizing.reset-size7.size6 { - font-size: 0.83333333em; -} -.ML__mathlive .fontsize-ensurer.reset-size7.size7, -.ML__mathlive .sizing.reset-size7.size7 { - font-size: 1em; -} -.ML__mathlive .fontsize-ensurer.reset-size7.size8, -.ML__mathlive .sizing.reset-size7.size8 { - font-size: 1.20138889em; -} -.ML__mathlive .fontsize-ensurer.reset-size7.size9, -.ML__mathlive .sizing.reset-size7.size9 { - font-size: 1.4375em; -} -.ML__mathlive .fontsize-ensurer.reset-size7.size10, -.ML__mathlive .sizing.reset-size7.size10 { - font-size: 1.72916667em; -} -.ML__mathlive .fontsize-ensurer.reset-size8.size1, -.ML__mathlive .sizing.reset-size8.size1 { - font-size: 0.28901734em; -} -.ML__mathlive .fontsize-ensurer.reset-size8.size2, -.ML__mathlive .sizing.reset-size8.size2 { - font-size: 0.40462428em; -} -.ML__mathlive .fontsize-ensurer.reset-size8.size3, -.ML__mathlive .sizing.reset-size8.size3 { - font-size: 0.46242775em; -} -.ML__mathlive .fontsize-ensurer.reset-size8.size4, -.ML__mathlive .sizing.reset-size8.size4 { - font-size: 0.52023121em; -} -.ML__mathlive .fontsize-ensurer.reset-size8.size5, -.ML__mathlive .sizing.reset-size8.size5 { - font-size: 0.57803468em; -} -.ML__mathlive .fontsize-ensurer.reset-size8.size6, -.ML__mathlive .sizing.reset-size8.size6 { - font-size: 0.69364162em; -} -.ML__mathlive .fontsize-ensurer.reset-size8.size7, -.ML__mathlive .sizing.reset-size8.size7 { - font-size: 0.83236994em; -} -.ML__mathlive .fontsize-ensurer.reset-size8.size8, -.ML__mathlive .sizing.reset-size8.size8 { - font-size: 1em; -} -.ML__mathlive .fontsize-ensurer.reset-size8.size9, -.ML__mathlive .sizing.reset-size8.size9 { - font-size: 1.19653179em; -} -.ML__mathlive .fontsize-ensurer.reset-size8.size10, -.ML__mathlive .sizing.reset-size8.size10 { - font-size: 1.43930636em; -} -.ML__mathlive .fontsize-ensurer.reset-size9.size1, -.ML__mathlive .sizing.reset-size9.size1 { - font-size: 0.24154589em; -} -.ML__mathlive .fontsize-ensurer.reset-size9.size2, -.ML__mathlive .sizing.reset-size9.size2 { - font-size: 0.33816425em; -} -.ML__mathlive .fontsize-ensurer.reset-size9.size3, -.ML__mathlive .sizing.reset-size9.size3 { - font-size: 0.38647343em; -} -.ML__mathlive .fontsize-ensurer.reset-size9.size4, -.ML__mathlive .sizing.reset-size9.size4 { - font-size: 0.43478261em; -} -.ML__mathlive .fontsize-ensurer.reset-size9.size5, -.ML__mathlive .sizing.reset-size9.size5 { - font-size: 0.48309179em; -} -.ML__mathlive .fontsize-ensurer.reset-size9.size6, -.ML__mathlive .sizing.reset-size9.size6 { - font-size: 0.57971014em; -} -.ML__mathlive .fontsize-ensurer.reset-size9.size7, -.ML__mathlive .sizing.reset-size9.size7 { - font-size: 0.69565217em; -} -.ML__mathlive .fontsize-ensurer.reset-size9.size8, -.ML__mathlive .sizing.reset-size9.size8 { - font-size: 0.83574879em; -} -.ML__mathlive .fontsize-ensurer.reset-size9.size9, -.ML__mathlive .sizing.reset-size9.size9 { - font-size: 1em; -} -.ML__mathlive .fontsize-ensurer.reset-size9.size10, -.ML__mathlive .sizing.reset-size9.size10 { - font-size: 1.20289855em; -} -.ML__mathlive .fontsize-ensurer.reset-size10.size1, -.ML__mathlive .sizing.reset-size10.size1 { - font-size: 0.20080321em; -} -.ML__mathlive .fontsize-ensurer.reset-size10.size2, -.ML__mathlive .sizing.reset-size10.size2 { - font-size: 0.2811245em; -} -.ML__mathlive .fontsize-ensurer.reset-size10.size3, -.ML__mathlive .sizing.reset-size10.size3 { - font-size: 0.32128514em; -} -.ML__mathlive .fontsize-ensurer.reset-size10.size4, -.ML__mathlive .sizing.reset-size10.size4 { - font-size: 0.36144578em; -} -.ML__mathlive .fontsize-ensurer.reset-size10.size5, -.ML__mathlive .sizing.reset-size10.size5 { - font-size: 0.40160643em; -} -.ML__mathlive .fontsize-ensurer.reset-size10.size6, -.ML__mathlive .sizing.reset-size10.size6 { - font-size: 0.48192771em; -} -.ML__mathlive .fontsize-ensurer.reset-size10.size7, -.ML__mathlive .sizing.reset-size10.size7 { - font-size: 0.57831325em; -} -.ML__mathlive .fontsize-ensurer.reset-size10.size8, -.ML__mathlive .sizing.reset-size10.size8 { - font-size: 0.69477912em; -} -.ML__mathlive .fontsize-ensurer.reset-size10.size9, -.ML__mathlive .sizing.reset-size10.size9 { - font-size: 0.8313253em; -} -.ML__mathlive .fontsize-ensurer.reset-size10.size10, -.ML__mathlive .sizing.reset-size10.size10 { - font-size: 1em; -} -.ML__mathlive .delimsizing.size1 { - font-family: KaTeX_Size1; -} -.ML__mathlive .delimsizing.size2 { - font-family: KaTeX_Size2; -} -.ML__mathlive .delimsizing.size3 { - font-family: KaTeX_Size3; -} -.ML__mathlive .delimsizing.size4 { - font-family: KaTeX_Size4; -} -.ML__mathlive .delimsizing.mult .delim-size1 > span { - font-family: KaTeX_Size1; - vertical-align: top; -} -.ML__mathlive .delimsizing.mult .delim-size4 > span { - font-family: KaTeX_Size4; - vertical-align: top; -} -.ML__mathlive .nulldelimiter { - width: 0.12em; -} -.ML__mathlive .op-symbol { - position: relative; -} -.ML__mathlive .op-symbol.small-op { - font-family: KaTeX_Size1; -} -.ML__mathlive .op-symbol.large-op { - font-family: KaTeX_Size2; -} -.ML__mathlive .op-limits .vlist > span { - text-align: center; -} -.ML__mathlive .accent > .vlist > span { - text-align: center; -} -.ML__mathlive .accent .accent-body > span { - width: 0; -} -.ML__mathlive .accent .accent-body.accent-vec > span { - position: relative; - left: 0.326em; -} -.ML__mathlive .mtable .vertical-separator { - display: inline-block; - margin: 0 -0.025em; - border-right: 0.05em solid #000; -} -.ML__mathlive .mtable .arraycolsep { - display: inline-block; -} -.ML__mathlive .mtable .col-align-c > .vlist { - text-align: center; -} -.ML__mathlive .mtable .col-align-l > .vlist { - text-align: left; -} -.ML__mathlive .mtable .col-align-r > .vlist { - text-align: right; -} -.ML__selection { - background: var(--highlight-inactive); - box-sizing: border-box; -} -.ML__focused .ML__selection { - background: var(--highlight) !important; - color: var(--on-highlight); -} -.ML__contains-caret.ML__close, -.ML__contains-caret.ML__open, -.ML__contains-caret > .ML__close, -.ML__contains-caret > .ML__open, -.sqrt.ML__contains-caret > .sqrt-sign, -.sqrt.ML__contains-caret > .vlist > span > .sqrt-line { - color: var(--caret); -} -.ML__command { - font-family: Source Code Pro, Consolas, Roboto Mono, Menlo, - Bitstream Vera Sans Mono, DejaVu Sans Mono, Monaco, Courier, monospace; - letter-spacing: -1px; - font-weight: 400; - color: var(--primary); -} -:not(.ML__command) + .ML__command { - margin-left: 0.25em; -} -.ML__command + :not(.ML__command) { - padding-left: 0.25em; -} -.ML__smart-fence__close { - opacity: 0.5; -} -.ML__keystroke-caption { - visibility: hidden; - background: var(--secondary); - border-color: var(--secondary-border); - box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); - text-align: center; - border-radius: 6px; - padding: 16px; - position: absolute; - z-index: 1; - display: flex; - flex-direction: row; - justify-content: center; - --keystroke: #fff; - --on-keystroke: #555; - --keystroke-border: #f7f7f7; -} -@media (prefers-color-scheme: dark) { - body:not([theme='light']) .ML__keystroke-caption { - --keystroke: hsl(var(--hue), 50%, 30%); - --on-keystroke: #fafafa; - --keystroke-border: hsl(var(--hue), 50%, 25%); - } -} -body[theme='dark'] .ML__keystroke-caption { - --keystroke: hsl(var(--hue), 50%, 30%); - --on-keystroke: #fafafa; - --keystroke-border: hsl(var(--hue), 50%, 25%); -} -[data-tooltip] { - position: relative; -} -[data-tooltip][data-placement='top']:after { - top: inherit; - bottom: 100%; -} -[data-tooltip]:after { - position: absolute; - visibility: hidden; - content: attr(data-tooltip); - display: inline-table; - top: 110%; - width: -webkit-max-content; - width: -moz-max-content; - width: max-content; - max-width: 200px; - padding: 8px; - background: #616161; - color: #fff; - text-align: center; - z-index: 2; - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), - 0 3px 1px -2px rgba(0, 0, 0, 0.2); - border-radius: 2px; - font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, - Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, - sans-serif; - font-weight: 400; - font-size: 12px; - opacity: 0; - transform: scale(0.5); - transition: all 0.15s cubic-bezier(0.4, 0, 1, 1); -} -@media only screen and (max-width: 767px) { - [data-tooltip]:after { - height: 32px; - padding: 4px 16px; - font-size: 14px; - } -} -[data-tooltip]:hover { - position: relative; -} -[data-tooltip]:hover:after { - visibility: visible; - opacity: 1; - transform: scale(1); -} -[data-tooltip][data-delay]:after { - transition-delay: 0s; -} -[data-tooltip][data-delay]:hover:after { - transition-delay: 1s; -} -.can-redo [data-command='redo'] { - opacity: 1 !important; -} -.can-undo [data-command='undo'] { - opacity: 1 !important; -} -.ML__keyboard { - --keyboard-background: rgba(209, 213, 217, 0.95); - --keyboard-text: #000; - --keyboard-text-active: var(--primary); - --keyboard-background-border: #ddd; - --keycap-background: #fff; - --keycap-background-active: #e5e5e5; - --keycap-background-border: #e5e6e9; - --keycap-background-border-bottom: #8d8f92; - --keycap-text: #000; - --keycap-text-active: #fff; - --keycap-secondary-text: #000; - --keycap-modifier-background: #b9bdc7; - --keycap-modifier-border: #c5c9d0; - --keycap-modifier-border-bottom: #989da6; - --keyboard-alternate-background: #fff; - --keyboard-alternate-background-active: #e5e5e5; - --keyboard-alternate-text: #000; - position: fixed; - left: 0; - bottom: -267px; - width: 100vw; - z-index: 105; - padding-top: 5px; - transform: translate(0); - opacity: 0; - visibility: hidden; - transition: 0.28s cubic-bezier(0, 0, 0.2, 1); - transition-property: transform, opacity; - -webkit-backdrop-filter: grayscale(50%); - backdrop-filter: grayscale(50%); - background-color: var(--keyboard-background); - border: 1px solid var(--keyboard-background-border); - font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, - Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, - sans-serif; - font-size: 16px; - font-weight: 400; - margin: 0; - text-shadow: none; - box-sizing: border-box; - touch-action: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; - box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); -} -.ML__keyboard.is-visible { - transform: translateY(-267px); - opacity: 1; - visibility: visible; - transition-timing-function: cubic-bezier(0.4, 0, 1, 1); -} -.ML__keyboard .tex { - font-family: KaTeX_Main, Cambria Math, Asana Math, OpenSymbol, Symbola, STIX, - Times, serif !important; -} -.ML__keyboard .tex-math { - font-family: KaTeX_Math, Cambria Math, Asana Math, OpenSymbol, Symbola, STIX, - Times, serif !important; -} -.ML__keyboard .tt { - font-family: Source Code Pro, Consolas, Roboto Mono, Menlo, - Bitstream Vera Sans Mono, DejaVu Sans Mono, Monaco, Courier, monospace !important; - font-size: 30px; - font-weight: 400; -} -.ML__keyboard.alternate-keys { - visibility: hidden; - max-width: 286px; - background-color: var(--keyboard-alternate-background); - text-align: center; - border-radius: 6px; - position: fixed; - bottom: auto; - top: 0; - box-sizing: content-box; - transform: none; - z-index: 106; - display: flex; - flex-direction: row; - justify-content: center; - align-content: center; - box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); - transition: none; -} -@media only screen and (max-height: 412px) { - .ML__keyboard.alternate-keys { - max-width: 320px; - } -} -.ML__keyboard.alternate-keys.is-visible { - visibility: visible; -} -.ML__keyboard.alternate-keys ul { - list-style: none; - margin: 3px; - padding: 0; - display: flex; - flex-flow: row wrap-reverse; - justify-content: center; -} -.ML__keyboard.alternate-keys ul > li { - display: flex; - flex-flow: column; - align-items: center; - justify-content: center; - font-size: 30px; - height: 70px; - width: 70px; - box-sizing: border-box; - margin: 0; - background: transparent; - border: 1px solid transparent; - border-radius: 5px; - pointer-events: all; - color: var(--keyboard-alternate-text); - fill: currentColor; -} -@media only screen and (max-height: 412px) { - .ML__keyboard.alternate-keys ul > li { - font-size: 24px; - height: 50px; - width: 50px; - } -} -.ML__keyboard.alternate-keys ul > li.active, -.ML__keyboard.alternate-keys ul > li.pressed, -.ML__keyboard.alternate-keys ul > li:hover { - box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); - background: var(--keyboard-alternate-background-active); - color: var(--keyboard-text-active); -} -.ML__keyboard.alternate-keys ul > li.small { - font-size: 18px; -} -.ML__keyboard.alternate-keys ul > li.small-button { - width: 42px; - height: 42px; - margin: 2px; - background: #fbfbfb; -} -.ML__keyboard.alternate-keys ul > li.small-button:hover { - background: var(--keyboard-alternate-background-active); -} -.ML__keyboard.alternate-keys ul > li.box > div, -.ML__keyboard.alternate-keys ul > li.box > span { - border: 1px dashed rgba(0, 0, 0, 0.24); -} -.ML__keyboard.alternate-keys ul > li .warning { - min-height: 60px; - min-width: 60px; - background: #cd0030; - color: #fff; - padding: 5px; - display: flex; - align-items: center; - justify-content: center; - border-radius: 5px; -} -.ML__keyboard.alternate-keys ul > li .warning.active, -.ML__keyboard.alternate-keys ul > li .warning.pressed, -.ML__keyboard.alternate-keys ul > li .warning:hover { - background: red; -} -.ML__keyboard.alternate-keys ul > li .warning svg { - width: 50px; - height: 50px; -} -.ML__keyboard.alternate-keys ul > li aside { - font-size: 12px; - line-height: 12px; - opacity: 0.78; -} -.ML__keyboard > div.keyboard-layer { - display: none; - outline: none; -} -.ML__keyboard > div.keyboard-layer.is-visible { - display: flex; - flex-flow: column; -} -.ML__keyboard > div > div.keyboard-toolbar { - align-self: center; - display: flex; - flex-flow: row; - justify-content: space-between; - width: 736px; -} -@media only screen and (min-width: 768px) and (max-width: 1024px) { - .ML__keyboard > div > div.keyboard-toolbar { - width: 556px; - } -} -@media only screen and (max-width: 767px) { - .ML__keyboard > div > div.keyboard-toolbar { - width: 365px; - max-width: 100vw; - } -} -.ML__keyboard > div > div.keyboard-toolbar svg { - height: 20px; - width: 20px; -} -@media only screen and (max-width: 767px) { - .ML__keyboard > div > div.keyboard-toolbar svg { - height: 13px; - width: 17px; - } -} -.ML__keyboard > div > div.keyboard-toolbar > .left { - justify-content: flex-start; - display: flex; - flex-flow: row; -} -.ML__keyboard > div > div.keyboard-toolbar > .right { - justify-content: flex-end; - display: flex; - flex-flow: row; -} -.ML__keyboard > div > div.keyboard-toolbar > div > div { - display: flex; - align-items: baseline; - justify-content: center; - pointer-events: all; - color: var(--keyboard-text); - fill: currentColor; - background: 0; - font-size: 110%; - cursor: pointer; - min-height: 0; - padding: 4px 10px; - margin: 7px 4px 6px; - box-shadow: none; - border: none; - border-bottom: 2px solid transparent; -} -.ML__keyboard > div > div.keyboard-toolbar > div > div.disabled.pressed svg, -.ML__keyboard > div > div.keyboard-toolbar > div > div.disabled:hover svg, -.ML__keyboard > div > div.keyboard-toolbar > div > div.disabled svg { - color: var(--keyboard-text); - opacity: 0.2; -} -@media only screen and (max-width: 414px) { - .ML__keyboard > div > div.keyboard-toolbar > div > div { - font-size: 100%; - padding: 0 6px 0 0; - } -} -@media only screen and (max-width: 767px) { - .ML__keyboard > div > div.keyboard-toolbar > div > div { - padding-left: 4px; - padding-right: 4px; - font-size: 90%; - } -} -.ML__keyboard > div > div.keyboard-toolbar > div > div.active, -.ML__keyboard > div > div.keyboard-toolbar > div > div.pressed, -.ML__keyboard > div > div.keyboard-toolbar > div > div:active, -.ML__keyboard > div > div.keyboard-toolbar > div > div:hover { - color: var(--keyboard-text-active); -} -.ML__keyboard > div > div.keyboard-toolbar > div > div.selected { - color: var(--keyboard-text-active); - border-bottom: 2px solid var(--keyboard-text-active); - margin-bottom: 8px; - padding-bottom: 0; -} -.ML__keyboard div .rows { - border: 0; - border-collapse: separate; - clear: both; - margin: auto; - display: flex; - flex-flow: column; - align-items: center; -} -.ML__keyboard div .rows > ul { - list-style: none; - height: 40px; - margin: 0 0 3px; - padding: 0; -} -.ML__keyboard div .rows > ul > li { - display: flex; - flex-flow: column; - align-items: center; - justify-content: center; - width: 34px; - margin-right: 2px; - height: 40px; - box-sizing: border-box; - padding: 8px 0; - vertical-align: top; - text-align: center; - float: left; - color: var(--keycap-text); - fill: currentColor; - font-size: 20px; - background: var(--keycap-background); - border: 1px solid var(--keycap-background-border); - border-bottom-color: var(--keycap-background-border-bottom); - border-radius: 5px; - pointer-events: all; - position: relative; - overflow: hidden; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-tap-highlight-color: transparent; -} -.ML__keyboard div .rows > ul > li:last-child { - margin-right: 0; -} -.ML__keyboard div .rows > ul > li.small { - font-size: 16px; -} -.ML__keyboard div .rows > ul > li.tt { - color: var(--keyboard-text-active); -} -.ML__keyboard div .rows > ul > li.bottom { - justify-content: flex-end; -} -.ML__keyboard div .rows > ul > li.left { - align-items: flex-start; - padding-left: 4px; -} -.ML__keyboard div .rows > ul > li.right { - align-items: flex-end; - padding-right: 4px; -} -.ML__keyboard div .rows > ul > li svg { - width: 20px; - height: 20px; -} -.ML__keyboard div .rows > ul > li .warning { - height: 25px; - width: 25px; - min-height: 25px; - min-width: 25px; - background: #cd0030; - color: #fff; - border-radius: 100%; - padding: 5px; - display: flex; - align-items: center; - justify-content: center; - margin-bottom: -2px; -} -.ML__keyboard div .rows > ul > li .warning svg { - width: 16px; - height: 16px; -} -@media only screen and (max-width: 768px) { - .ML__keyboard div .rows > ul > li .warning { - height: 16px; - width: 16px; - min-height: 16px; - min-width: 16px; - } - .ML__keyboard div .rows > ul > li .warning svg { - width: 14px; - height: 14px; - } -} -.ML__keyboard div .rows > ul > li > .w0 { - width: 0; -} -.ML__keyboard div .rows > ul > li > .w5 { - width: 16px; -} -.ML__keyboard div .rows > ul > li > .w15 { - width: 52px; -} -.ML__keyboard div .rows > ul > li > .w20 { - width: 70px; -} -.ML__keyboard div .rows > ul > li > .w50 { - width: 178px; -} -.ML__keyboard div .rows > ul > li.separator { - background: transparent; - border: none; - pointer-events: none; -} -@media only screen and (max-width: 560px) { - .ML__keyboard div .rows > ul > li.if-wide { - display: none; - } -} -.ML__keyboard div .rows > ul > li.tex-math { - font-size: 25px; -} -.ML__keyboard div .rows > ul > li.pressed, -.ML__keyboard div .rows > ul > li:hover { - background: var(--keycap-background-active); - color: var(--keyboard-text-active); -} -.ML__keyboard div .rows > ul > li.action.active, -.ML__keyboard div .rows > ul > li.action:active, -.ML__keyboard div .rows > ul > li.keycap.active, -.ML__keyboard div .rows > ul > li.keycap:active { - transform: translateY(-20px) scale(1.4); - z-index: 100; - color: var(--keyboard-text-active); -} -.ML__keyboard div .rows > ul > li.modifier.active, -.ML__keyboard div .rows > ul > li.modifier:active { - background: var(--keyboard-text-active); - color: var(--keycap-text-active); -} -.ML__keyboard div .rows > ul > li.action.font-glyph, -.ML__keyboard div .rows > ul > li.modifier.font-glyph { - font-size: 18px; -} -@media only screen and (max-width: 767px) { - .ML__keyboard div .rows > ul > li.action.font-glyph, - .ML__keyboard div .rows > ul > li.modifier.font-glyph { - font-size: 16px; - } -} -@media only screen and (max-width: 767px) { - .ML__keyboard div .rows > ul > li.bigfnbutton, - .ML__keyboard div .rows > ul > li.fnbutton { - font-size: 12px; - } -} -.ML__keyboard div .rows > ul > li.bigfnbutton { - font-size: 14px; -} -@media only screen and (max-width: 767px) { - .ML__keyboard div .rows > ul > li.bigfnbutton { - font-size: 9px; - } -} -.ML__keyboard div .rows > ul > li.action, -.ML__keyboard div .rows > ul > li.modifier { - background-color: var(--keycap-modifier-background); - border-bottom-color: var(--keycap-modifier-border); - border-color: var(--keycap-modifier-border) var(--keycap-modifier-border) - var(--keycap-modifier-border-bottom); - font-size: 65%; - font-weight: 100; -} -.ML__keyboard div .rows > ul > li.action.selected, -.ML__keyboard div .rows > ul > li.modifier.selected { - color: var(--keyboard-text-active); -} -.ML__keyboard div .rows > ul > li.action.selected.active, -.ML__keyboard div .rows > ul > li.action.selected.pressed, -.ML__keyboard div .rows > ul > li.action.selected:active, -.ML__keyboard div .rows > ul > li.action.selected:hover, -.ML__keyboard div .rows > ul > li.modifier.selected.active, -.ML__keyboard div .rows > ul > li.modifier.selected.pressed, -.ML__keyboard div .rows > ul > li.modifier.selected:active, -.ML__keyboard div .rows > ul > li.modifier.selected:hover { - color: #fff; -} -.ML__keyboard div .rows > ul > li.keycap.w50 { - font-size: 80%; - padding-top: 10px; - font-weight: 100; -} -.ML__keyboard div .rows > ul > li small { - color: #555; -} -@media only screen and (max-width: 767px) { - .ML__keyboard div .rows > ul > li small { - font-size: 9px; - } -} -.ML__keyboard div .rows > ul > li aside { - font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, - Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, - sans-serif; - font-size: 10px; - line-height: 10px; - color: #666; -} -@media only screen and (max-width: 767px) { - .ML__keyboard div .rows > ul > li aside { - display: none; - } -} -@media only screen and (max-width: 414px) { - .ML__keyboard div .rows > ul > li { - width: 29px; - margin-right: 2px; - } - .ML__keyboard div .rows > ul > .w5 { - width: 13.5px; - } - .ML__keyboard div .rows > ul > .w15 { - width: 44.5px; - } - .ML__keyboard div .rows > ul > .w20 { - width: 60px; - } - .ML__keyboard div .rows > ul > .w50 { - width: 153px; - } -} -@media only screen and (min-width: 415px) and (max-width: 768px) { - .ML__keyboard div .rows > ul > li { - width: 37px; - margin-right: 3px; - } - .ML__keyboard div .rows > ul > .w5 { - width: 17px; - } - .ML__keyboard div .rows > ul > .w15 { - width: 57px; - } - .ML__keyboard div .rows > ul > .w20 { - width: 77px; - } - .ML__keyboard div .rows > ul > .w50 { - width: 197px; - } -} -@media only screen and (min-width: 768px) and (max-width: 1024px) { - .ML__keyboard div .rows > ul { - height: 52px; - } - .ML__keyboard div .rows > ul > li { - height: 52px; - width: 51px; - margin-right: 4px; - } - .ML__keyboard div .rows > ul > .w5 { - width: 23.5px; - } - .ML__keyboard div .rows > ul > .w15 { - width: 78.5px; - } - .ML__keyboard div .rows > ul > .w20 { - width: 106px; - } - .ML__keyboard div .rows > ul > .w50 { - width: 271px; - } -} -@media only screen and (min-width: 1025px) { - .ML__keyboard div .rows > ul { - height: 52px; - } - .ML__keyboard div .rows > ul > li { - height: 52px; - width: 66px; - margin-right: 6px; - } - .ML__keyboard div .rows > ul > .action, - .ML__keyboard div .rows > ul > .modifier { - font-size: 80%; - } - .ML__keyboard div .rows > ul > .w5 { - width: 30px; - } - .ML__keyboard div .rows > ul > .w15 { - width: 102px; - } - .ML__keyboard div .rows > ul > .w20 { - width: 138px; - } - .ML__keyboard div .rows > ul > .w50 { - width: 354px; - } -} -@media (prefers-color-scheme: dark) { - body:not([theme='light']) .ML__keyboard { - --hue: 206; - --keyboard-background: hsl(var(--hue), 19%, 38%); - --keyboard-text: #f0f0f0; - --keyboard-text-active: hsl(var(--hue), 100%, 60%); - --keyboard-background-border: #333; - --keycap-background: hsl(var(--hue), 25%, 39%); - --keycap-background-active: hsl(var(--hue), 35%, 42%); - --keycap-background-border: hsl(var(--hue), 25%, 35%); - --keycap-background-border-bottom: #426b8a; - --keycap-text: #d0d0d0; - --keycap-text-active: #000; - --keycap-secondary-text: #fff; - --keycap-modifier-background: hsl(var(--hue), 35%, 40%); - --keycap-modifier-border: hsl(var(--hue), 35%, 35%); - --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); - --keyboard-alternate-background: hsl(var(--hue), 19%, 38%); - --keyboard-alternate-background-active: hsl(var(--hue), 35%, 42%); - --keyboard-alternate-text: #d1d1d1; - } -} -body[theme='dark'] .ML__keyboard { - --hue: 206; - --keyboard-background: hsl(var(--hue), 19%, 38%); - --keyboard-text: #f0f0f0; - --keyboard-text-active: hsl(var(--hue), 100%, 60%); - --keyboard-background-border: #333; - --keycap-background: hsl(var(--hue), 25%, 39%); - --keycap-background-active: hsl(var(--hue), 35%, 42%); - --keycap-background-border: hsl(var(--hue), 25%, 35%); - --keycap-background-border-bottom: #426b8a; - --keycap-text: #d0d0d0; - --keycap-text-active: #000; - --keycap-secondary-text: #fff; - --keycap-modifier-background: hsl(var(--hue), 35%, 40%); - --keycap-modifier-border: hsl(var(--hue), 35%, 35%); - --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); - --keyboard-alternate-background: hsl(var(--hue), 19%, 38%); - --keyboard-alternate-background-active: hsl(var(--hue), 35%, 42%); - --keyboard-alternate-text: #d1d1d1; -} -div.ML__keyboard.material { - --keyboard-background: rgba(209, 213, 217, 0.9); - --keyboard-background-border: #ddd; - --keycap-background: transparent; - --keycap-background-active: #cccfd1; - --keycap-background-border: transparent; - --keyboard-alternate-background: #efefef; - --keyboard-alternate-text: #000; - font-family: Roboto, sans-serif; -} -div.ML__keyboard.material.alternate-keys { - background: var(--keyboard-alternate-background); - border: 1px solid transparent; - border-radius: 5px; - box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); -} -div.ML__keyboard.material.alternate-keys ul li.active, -div.ML__keyboard.material.alternate-keys ul li.pressed, -div.ML__keyboard.material.alternate-keys ul li:active, -div.ML__keyboard.material.alternate-keys ul li:hover { - border: 1px solid transparent; - background: #5f97fc; - color: #fff; - fill: currentColor; -} -div.ML__keyboard.material .keyboard-toolbar > div > div { - font-size: 16px; -} -div.ML__keyboard.material .keyboard-toolbar div.div.active, -div.ML__keyboard.material .keyboard-toolbar div.div.pressed, -div.ML__keyboard.material .keyboard-toolbar div div:active, -div.ML__keyboard.material .keyboard-toolbar div div:hover { - color: #5f97fc; - fill: currentColor; -} -div.ML__keyboard.material .keyboard-toolbar > div > .selected { - color: #5f97fc; - fill: currentColor; - border-bottom: 2px solid #5f97fc; - margin-bottom: 8px; - padding-bottom: 0; -} -div.ML__keyboard.material div > .rows > ul > .keycap { - background: transparent; - border: 1px solid transparent; - border-radius: 5px; - color: var(--keycap-text); - fill: currentColor; - transition: none; -} -div.ML__keyboard.material div > .rows > ul > .keycap.tt { - color: #5f97fc; -} -div.ML__keyboard.material div > .rows > ul > .keycap[data-key=' '] { - margin-top: 10px; - margin-bottom: 10px; - height: 20px; - background: #e0e0e0; -} -div.ML__keyboard.material div > .rows > ul > .keycap[data-key=' '].active, -div.ML__keyboard.material div > .rows > ul > .keycap[data-key=' '].pressed, -div.ML__keyboard.material div > .rows > ul > .keycap[data-key=' ']:active, -div.ML__keyboard.material div > .rows > ul > .keycap[data-key=' ']:hover { - background: #d0d0d0; - box-shadow: none; - transform: none; -} -div.ML__keyboard.material div > .rows > ul > .keycap:not([data-key=' ']):hover { - border: 1px solid transparent; - background: var(--keycap-background-active); - box-shadow: none; -} -div.ML__keyboard.material div > .rows > ul > .keycap:not([data-key=' ']).active, -div.ML__keyboard.material - div - > .rows - > ul - > .keycap:not([data-key=' ']).pressed, -div.ML__keyboard.material - div - > .rows - > ul - > .keycap:not([data-key=' ']):active { - background: var(--keyboard-alternate-background); - color: var(--keyboard-alternate-text); - box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); -} -@media only screen and (max-width: 767px) { - div.ML__keyboard.material - div - > .rows - > ul - > .keycap:not([data-key=' ']).active, - div.ML__keyboard.material - div - > .rows - > ul - > .keycap:not([data-key=' ']).pressed, - div.ML__keyboard.material - div - > .rows - > ul - > .keycap:not([data-key=' ']):active { - box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), - 0 6px 6px rgba(0, 0, 0, 0.23); - font-size: 10px; - vertical-align: top; - width: 19.5px; - margin-right: 10px; - margin-left: 10px; - transform: translateY(-20px) scale(2); - transition: none; - justify-content: flex-start; - padding: 2px 0 0; - z-index: 100; - } -} -@media only screen and (max-width: 414px) { - div.ML__keyboard.material - div - > .rows - > ul - > .keycap:not([data-key=' ']).active, - div.ML__keyboard.material - div - > .rows - > ul - > .keycap:not([data-key=' ']).pressed, - div.ML__keyboard.material - div - > .rows - > ul - > .keycap:not([data-key=' ']):active { - width: 16.5px; - } -} -@media only screen and (max-width: 767px) { - div.ML__keyboard.material div > .rows > ul > .keycap:last-child.active, - div.ML__keyboard.material div > .rows > ul > .keycap:last-child:active { - margin-right: 0; - margin-left: 14px; - } -} -div.ML__keyboard.material div div.rows ul li.action, -div.ML__keyboard.material div div.rows ul li.modifier { - background: transparent; - border: 0; - color: #869096; - fill: currentColor; - font-size: 16px; - transition: none; -} -div.ML__keyboard.material div div.rows ul li.action.selected, -div.ML__keyboard.material div div.rows ul li.modifier.selected { - color: #5f97fc; - border-radius: 0; - border-bottom: 2px solid #5f97fc; -} -div.ML__keyboard.material div div.rows ul li.action.active, -div.ML__keyboard.material div div.rows ul li.action.pressed, -div.ML__keyboard.material div div.rows ul li.action:active, -div.ML__keyboard.material div div.rows ul li.action:hover, -div.ML__keyboard.material div div.rows ul li.modifier.active, -div.ML__keyboard.material div div.rows ul li.modifier.pressed, -div.ML__keyboard.material div div.rows ul li.modifier:active, -div.ML__keyboard.material div div.rows ul li.modifier:hover { - border: 0; - color: var(--keycap-text); - background: var(--keycap-background-active); - box-shadow: none; -} -div.ML__keyboard.material div div.rows ul li.bigfnbutton, -div.ML__keyboard.material div div.rows ul li.fnbutton { - background: transparent; - border: 0; -} -div.ML__keyboard.material div div.rows ul li.bigfnbutton.selected, -div.ML__keyboard.material div div.rows ul li.fnbutton.selected { - color: #5f97fc; - fill: currentColor; - border-radius: 0; - border-bottom: 2px solid #5f97fc; -} -div.ML__keyboard.material div div.rows ul li.bigfnbutton.active, -div.ML__keyboard.material div div.rows ul li.bigfnbutton.pressed, -div.ML__keyboard.material div div.rows ul li.bigfnbutton:active, -div.ML__keyboard.material div div.rows ul li.bigfnbutton:hover, -div.ML__keyboard.material div div.rows ul li.fnbutton.active, -div.ML__keyboard.material div div.rows ul li.fnbutton.pressed, -div.ML__keyboard.material div div.rows ul li.fnbutton:active, -div.ML__keyboard.material div div.rows ul li.fnbutton:hover { - border: 0; - color: #5f97fc; - fill: currentColor; - background: var(--keycap-background-active); - box-shadow: none; -} -@media (prefers-color-scheme: dark) { - body:not([theme='light']) div.ML__keyboard.material { - --hue: 198; - --keyboard-background: hsl(var(--hue), 19%, 18%); - --keyboard-text: #d4d6d7; - --keyboard-text-active: #5f97fc; - --keyboard-background-border: #333; - --keycap-background: hsl(var(--hue), 25%, 39%); - --keycap-background-active: #5f97fc; - --keycap-background-border: transparent; - --keycap-background-border-bottom: transparent; - --keycap-text: #d0d0d0; - --keycap-text-active: #d4d6d7; - --keycap-secondary-text: #5f97fc; - --keycap-modifier-background: hsl(var(--hue), 35%, 40%); - --keycap-modifier-border: hsl(var(--hue), 35%, 35%); - --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); - --keyboard-alternate-background: hsl(var(--hue), 8%, 2%); - --keyboard-alternate-background-active: hsl(var(--hue), 35%, 42%); - --keyboard-alternate-text: #d1d1d1; - } -} -body[theme='dark'] div.ML__keyboard.material { - --hue: 198; - --keyboard-background: hsl(var(--hue), 19%, 18%); - --keyboard-text: #d4d6d7; - --keyboard-text-active: #5f97fc; - --keyboard-background-border: #333; - --keycap-background: hsl(var(--hue), 25%, 39%); - --keycap-background-active: #5f97fc; - --keycap-background-border: transparent; - --keycap-background-border-bottom: transparent; - --keycap-text: #d0d0d0; - --keycap-text-active: #d4d6d7; - --keycap-secondary-text: #5f97fc; - --keycap-modifier-background: hsl(var(--hue), 35%, 40%); - --keycap-modifier-border: hsl(var(--hue), 35%, 35%); - --keycap-modifier-border-bottom: hsl(var(--hue), 35%, 42%); - --keyboard-alternate-background: hsl(var(--hue), 8%, 2%); - --keyboard-alternate-background-active: hsl(var(--hue), 35%, 42%); - --keyboard-alternate-text: #d1d1d1; -} -.ML__error { - background-image: radial-gradient( - ellipse at center, - #cc0041, - transparent 70% - ); - background-repeat: repeat-x; - background-size: 3px 3px; - background-position: 0 98%; -} -.ML__suggestion { - opacity: 0.5; -} -.ML__placeholder { - opacity: 0.7; - padding-left: 0.5ex; - padding-right: 0.5ex; -} -.ML__keystroke-caption > span { - min-width: 14px; - margin: 0 8px 0 0; - padding: 4px; - background-color: var(--keystroke); - color: var(--on-keystroke); - fill: currentColor; - font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, - Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, - sans-serif; - font-size: 1em; - border-radius: 6px; - border: 2px solid var(--keystroke-border); -} -.ML__virtual-keyboard-toggle.pressed { - background: hsla(0, 0%, 70%, 0.5); -} -.ML__virtual-keyboard-toggle:focus { - outline: none; - border-radius: 50%; - border: 2px solid var(--primary); -} -.ML__virtual-keyboard-toggle.active, -.ML__virtual-keyboard-toggle.active:hover { - background: hsla(0, 0%, 70%, 0.5); - color: #000; - fill: currentColor; -} -div.ML__popover.is-visible { - visibility: visible; - -webkit-animation: ML__fade-in 0.15s cubic-bezier(0, 0, 0.2, 1); - animation: ML__fade-in 0.15s cubic-bezier(0, 0, 0.2, 1); -} -@-webkit-keyframes ML__fade-in { - 0% { - opacity: 0; - } - to { - opacity: 1; - } -} -@keyframes ML__fade-in { - 0% { - opacity: 0; - } - to { - opacity: 1; - } -} -.ML__popover__content { - border-radius: 6px; - padding: 2px; - cursor: pointer; - min-height: 100px; - display: flex; - flex-direction: column; - justify-content: center; - margin-left: 8px; - margin-right: 8px; -} -.ML__popover__content a { - color: #5ea6fd; - padding-top: 0.3em; - margin-top: 0.4em; - display: block; -} -.ML__popover__content a:hover { - color: #5ea6fd; - text-decoration: underline; -} -.ML__popover__content.active, -.ML__popover__content.pressed, -.ML__popover__content:hover { - background: hsla(0, 0%, 100%, 0.1); -} -.ML__popover__command { - font-size: 1.6rem; -} -.ML__popover__prev-shortcut { - height: 31px; - opacity: 0.1; - cursor: pointer; - margin-left: 8px; - margin-right: 8px; - padding-top: 4px; - padding-bottom: 2px; -} -.ML__popover__next-shortcut:hover, -.ML__popover__prev-shortcut:hover { - opacity: 0.3; -} -.ML__popover__next-shortcut.active, -.ML__popover__next-shortcut.pressed, -.ML__popover__prev-shortcut.active, -.ML__popover__prev-shortcut.pressed { - opacity: 1; -} -.ML__popover__next-shortcut > span, -.ML__popover__prev-shortcut > span { - padding: 5px; - border-radius: 50%; - width: 20px; - height: 20px; - display: inline-block; -} -.ML__popover__prev-shortcut > span > span { - margin-top: -2px; - display: block; -} -.ML__popover__next-shortcut > span > span { - margin-top: 2px; - display: block; -} -.ML__popover__next-shortcut:hover > span, -.ML__popover__prev-shortcut:hover > span { - background: hsla(0, 0%, 100%, 0.1); -} -.ML__popover__next-shortcut { - height: 34px; - opacity: 0.1; - cursor: pointer; - margin-left: 8px; - margin-right: 8px; - padding-top: 2px; - padding-bottom: 4px; -} -.ML__popover__shortcut { - font-size: 0.8em; - margin-top: 0.25em; -} -.ML__popover__note, -.ML__popover__shortcut { - font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, - Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, - sans-serif; - opacity: 0.7; - padding-top: 0.25em; -} -.ML__popover__note { - font-size: 0.8rem; - line-height: 1em; - padding-left: 0.5em; - padding-right: 0.5em; -} -.ML__shortcut-join { - opacity: 0.5; -} -.ML__scroller { - position: fixed; - z-index: 1; - top: 0; - height: 100vh; - width: 200px; -} +@font-face{font-family:KaTeX_AMS;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff");font-weight:700;font-style:italic;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff");font-weight:400;font-style:italic;font-display:"swap"}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff");font-weight:700;font-style:italic;font-display:"swap"}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff");font-weight:700;font-style:normal;font-display:"swap"}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff");font-weight:400;font-style:italic;font-display:"swap"}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Script;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size1;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size2;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size3;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Size4;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Typewriter;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff");font-weight:400;font-style:normal;font-display:"swap"}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff");font-weight:400;font-style:italic;font-display:"swap"}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.ML__mathit{font-family:KaTeX_Math;font-style:italic}.ML__mathrm{font-family:KaTeX_Main;font-style:normal}.ML__mathbf{font-family:KaTeX_Main;font-weight:700}.ML__mathbfit{font-family:KaTeX_Math;font-weight:700;font-style:italic}.ML__ams,.ML__bb{font-family:KaTeX_AMS}.ML__cal{font-family:KaTeX_Caligraphic}.ML__frak{font-family:KaTeX_Fraktur}.ML__tt{font-family:KaTeX_Typewriter}.ML__script{font-family:KaTeX_Script}.ML__sans{font-family:KaTeX_SansSerif}.ML__mainit{font-family:KaTeX_Main;font-style:italic}.ML__series_el,.ML__series_ul{font-weight:100}.ML__series_l{font-weight:200}.ML__series_sl{font-weight:300}.ML__series_sb{font-weight:500}.ML__bold{font-weight:700}.ML__series_eb{font-weight:800}.ML__series_ub{font-weight:900}.ML__series_uc{font-stretch:ultra-condensed}.ML__series_ec{font-stretch:extra-condensed}.ML__series_c{font-stretch:condensed}.ML__series_sc{font-stretch:semi-condensed}.ML__series_sx{font-stretch:semi-expanded}.ML__series_x{font-stretch:expanded}.ML__series_ex{font-stretch:extra-expanded}.ML__series_ux{font-stretch:ultra-expanded}.ML__it{font-style:italic}.ML__shape_ol{-webkit-text-stroke:1px #000;text-stroke:1px #000;color:transparent}.ML__shape_sc{font-variant:small-caps}.ML__shape_sl{font-style:oblique}.ML__emph{color:#bc2612}.ML__emph .ML__emph{color:#0c7f99}.ML__mathlive .highlight{color:#007cb2;background:#edd1b0}.ML__mathlive .reset-textstyle.scriptstyle{font-size:.7em}.ML__mathlive .reset-textstyle.scriptscriptstyle{font-size:.5em}.ML__mathlive .reset-scriptstyle.textstyle{font-size:1.42857em}.ML__mathlive .reset-scriptstyle.scriptscriptstyle{font-size:.71429em}.ML__mathlive .reset-scriptscriptstyle.textstyle{font-size:2em}.ML__mathlive .reset-scriptscriptstyle.scriptstyle{font-size:1.4em}.ML__mathlive .style-wrap{position:relative}.ML__mathlive .vlist{display:inline-block}.ML__mathlive .vlist>span{display:block;height:0;position:relative;line-height:0}.ML__mathlive .vlist>span>span{display:inline-block}.ML__mathlive .msubsup{text-align:left}.ML__mathlive .mfrac>span{text-align:center}.ML__mathlive .mfrac .frac-line{width:100%}.ML__mathlive .mfrac .frac-line:after{content:"";display:block;margin-top:-.04em;border-bottom-style:solid;border-bottom-width:.04em;min-height:.04em}.ML__mathlive .rspace.negativethinspace{margin-right:-.16667em}.ML__mathlive .rspace.thinspace{margin-right:.16667em}.ML__mathlive .rspace.negativemediumspace{margin-right:-.22222em}.ML__mathlive .rspace.mediumspace{margin-right:.22222em}.ML__mathlive .rspace.thickspace{margin-right:.27778em}.ML__mathlive .rspace.sixmuspace{margin-right:.333333em}.ML__mathlive .rspace.eightmuspace{margin-right:.444444em}.ML__mathlive .rspace.enspace{margin-right:.5em}.ML__mathlive .rspace.twelvemuspace{margin-right:.666667em}.ML__mathlive .rspace.quad{margin-right:1em}.ML__mathlive .rspace.qquad{margin-right:2em}.ML__mathlive .mspace{display:inline-block}.ML__mathlive .mspace.negativethinspace{margin-left:-.16667em}.ML__mathlive .mspace.thinspace{width:.16667em}.ML__mathlive .mspace.negativemediumspace{margin-left:-.22222em}.ML__mathlive .mspace.mediumspace{width:.22222em}.ML__mathlive .mspace.thickspace{width:.27778em}.ML__mathlive .mspace.sixmuspace{width:.333333em}.ML__mathlive .mspace.eightmuspace{width:.444444em}.ML__mathlive .mspace.enspace{width:.5em}.ML__mathlive .mspace.twelvemuspace{width:.666667em}.ML__mathlive .mspace.quad{width:1em}.ML__mathlive .mspace.qquad{width:2em}.ML__mathlive .llap,.ML__mathlive .rlap{width:0;position:relative}.ML__mathlive .llap>.inner,.ML__mathlive .rlap>.inner{position:absolute}.ML__mathlive .llap>.fix,.ML__mathlive .rlap>.fix{display:inline-block}.ML__mathlive .llap>.inner{right:0}.ML__mathlive .rlap>.inner{left:0}.ML__mathlive .rule{display:inline-block;border:0 solid;position:relative}.ML__mathlive .overline .overline-line,.ML__mathlive .underline .underline-line{width:100%}.ML__mathlive .overline .overline-line:before,.ML__mathlive .underline .underline-line:before{border-bottom-style:solid;border-bottom-width:.04em;content:"";display:block}.ML__mathlive .overline .overline-line:after,.ML__mathlive .underline .underline-line:after{border-bottom-style:solid;border-bottom-width:.04em;min-height:thin;content:"";display:block;margin-top:-1px}.ML__mathlive .sqrt{display:inline-block}.ML__mathlive .sqrt>.sqrt-sign{font-family:KaTeX_Main;position:relative}.ML__mathlive .sqrt .sqrt-line{height:.04em;width:100%}.ML__mathlive .sqrt .sqrt-line:before{content:"";display:block;margin-top:-.04em;border-bottom-style:solid;border-bottom-width:.04em;min-height:.5px}.ML__mathlive .sqrt .sqrt-line:after{border-bottom-width:1px;content:" ";display:block;margin-top:-.1em}.ML__mathlive .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.ML__mathlive .fontsize-ensurer,.ML__mathlive .sizing{display:inline-block}.ML__mathlive .fontsize-ensurer.reset-size1.size1,.ML__mathlive .sizing.reset-size1.size1{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size1.size2,.ML__mathlive .sizing.reset-size1.size2{font-size:1.4em}.ML__mathlive .fontsize-ensurer.reset-size1.size3,.ML__mathlive .sizing.reset-size1.size3{font-size:1.6em}.ML__mathlive .fontsize-ensurer.reset-size1.size4,.ML__mathlive .sizing.reset-size1.size4{font-size:1.8em}.ML__mathlive .fontsize-ensurer.reset-size1.size5,.ML__mathlive .sizing.reset-size1.size5{font-size:2em}.ML__mathlive .fontsize-ensurer.reset-size1.size6,.ML__mathlive .sizing.reset-size1.size6{font-size:2.4em}.ML__mathlive .fontsize-ensurer.reset-size1.size7,.ML__mathlive .sizing.reset-size1.size7{font-size:2.88em}.ML__mathlive .fontsize-ensurer.reset-size1.size8,.ML__mathlive .sizing.reset-size1.size8{font-size:3.46em}.ML__mathlive .fontsize-ensurer.reset-size1.size9,.ML__mathlive .sizing.reset-size1.size9{font-size:4.14em}.ML__mathlive .fontsize-ensurer.reset-size1.size10,.ML__mathlive .sizing.reset-size1.size10{font-size:4.98em}.ML__mathlive .fontsize-ensurer.reset-size2.size1,.ML__mathlive .sizing.reset-size2.size1{font-size:.71428571em}.ML__mathlive .fontsize-ensurer.reset-size2.size2,.ML__mathlive .sizing.reset-size2.size2{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size2.size3,.ML__mathlive .sizing.reset-size2.size3{font-size:1.14285714em}.ML__mathlive .fontsize-ensurer.reset-size2.size4,.ML__mathlive .sizing.reset-size2.size4{font-size:1.28571429em}.ML__mathlive .fontsize-ensurer.reset-size2.size5,.ML__mathlive .sizing.reset-size2.size5{font-size:1.42857143em}.ML__mathlive .fontsize-ensurer.reset-size2.size6,.ML__mathlive .sizing.reset-size2.size6{font-size:1.71428571em}.ML__mathlive .fontsize-ensurer.reset-size2.size7,.ML__mathlive .sizing.reset-size2.size7{font-size:2.05714286em}.ML__mathlive .fontsize-ensurer.reset-size2.size8,.ML__mathlive .sizing.reset-size2.size8{font-size:2.47142857em}.ML__mathlive .fontsize-ensurer.reset-size2.size9,.ML__mathlive .sizing.reset-size2.size9{font-size:2.95714286em}.ML__mathlive .fontsize-ensurer.reset-size2.size10,.ML__mathlive .sizing.reset-size2.size10{font-size:3.55714286em}.ML__mathlive .fontsize-ensurer.reset-size3.size1,.ML__mathlive .sizing.reset-size3.size1{font-size:.625em}.ML__mathlive .fontsize-ensurer.reset-size3.size2,.ML__mathlive .sizing.reset-size3.size2{font-size:.875em}.ML__mathlive .fontsize-ensurer.reset-size3.size3,.ML__mathlive .sizing.reset-size3.size3{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size3.size4,.ML__mathlive .sizing.reset-size3.size4{font-size:1.125em}.ML__mathlive .fontsize-ensurer.reset-size3.size5,.ML__mathlive .sizing.reset-size3.size5{font-size:1.25em}.ML__mathlive .fontsize-ensurer.reset-size3.size6,.ML__mathlive .sizing.reset-size3.size6{font-size:1.5em}.ML__mathlive .fontsize-ensurer.reset-size3.size7,.ML__mathlive .sizing.reset-size3.size7{font-size:1.8em}.ML__mathlive .fontsize-ensurer.reset-size3.size8,.ML__mathlive .sizing.reset-size3.size8{font-size:2.1625em}.ML__mathlive .fontsize-ensurer.reset-size3.size9,.ML__mathlive .sizing.reset-size3.size9{font-size:2.5875em}.ML__mathlive .fontsize-ensurer.reset-size3.size10,.ML__mathlive .sizing.reset-size3.size10{font-size:3.1125em}.ML__mathlive .fontsize-ensurer.reset-size4.size1,.ML__mathlive .sizing.reset-size4.size1{font-size:.55555556em}.ML__mathlive .fontsize-ensurer.reset-size4.size2,.ML__mathlive .sizing.reset-size4.size2{font-size:.77777778em}.ML__mathlive .fontsize-ensurer.reset-size4.size3,.ML__mathlive .sizing.reset-size4.size3{font-size:.88888889em}.ML__mathlive .fontsize-ensurer.reset-size4.size4,.ML__mathlive .sizing.reset-size4.size4{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size4.size5,.ML__mathlive .sizing.reset-size4.size5{font-size:1.11111111em}.ML__mathlive .fontsize-ensurer.reset-size4.size6,.ML__mathlive .sizing.reset-size4.size6{font-size:1.33333333em}.ML__mathlive .fontsize-ensurer.reset-size4.size7,.ML__mathlive .sizing.reset-size4.size7{font-size:1.6em}.ML__mathlive .fontsize-ensurer.reset-size4.size8,.ML__mathlive .sizing.reset-size4.size8{font-size:1.92222222em}.ML__mathlive .fontsize-ensurer.reset-size4.size9,.ML__mathlive .sizing.reset-size4.size9{font-size:2.3em}.ML__mathlive .fontsize-ensurer.reset-size4.size10,.ML__mathlive .sizing.reset-size4.size10{font-size:2.76666667em}.ML__mathlive .fontsize-ensurer.reset-size5.size1,.ML__mathlive .sizing.reset-size5.size1{font-size:.5em}.ML__mathlive .fontsize-ensurer.reset-size5.size2,.ML__mathlive .sizing.reset-size5.size2{font-size:.7em}.ML__mathlive .fontsize-ensurer.reset-size5.size3,.ML__mathlive .sizing.reset-size5.size3{font-size:.8em}.ML__mathlive .fontsize-ensurer.reset-size5.size4,.ML__mathlive .sizing.reset-size5.size4{font-size:.9em}.ML__mathlive .fontsize-ensurer.reset-size5.size5,.ML__mathlive .sizing.reset-size5.size5{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size5.size6,.ML__mathlive .sizing.reset-size5.size6{font-size:1.2em}.ML__mathlive .fontsize-ensurer.reset-size5.size7,.ML__mathlive .sizing.reset-size5.size7{font-size:1.44em}.ML__mathlive .fontsize-ensurer.reset-size5.size8,.ML__mathlive .sizing.reset-size5.size8{font-size:1.73em}.ML__mathlive .fontsize-ensurer.reset-size5.size9,.ML__mathlive .sizing.reset-size5.size9{font-size:2.07em}.ML__mathlive .fontsize-ensurer.reset-size5.size10,.ML__mathlive .sizing.reset-size5.size10{font-size:2.49em}.ML__mathlive .fontsize-ensurer.reset-size6.size1,.ML__mathlive .sizing.reset-size6.size1{font-size:.41666667em}.ML__mathlive .fontsize-ensurer.reset-size6.size2,.ML__mathlive .sizing.reset-size6.size2{font-size:.58333333em}.ML__mathlive .fontsize-ensurer.reset-size6.size3,.ML__mathlive .sizing.reset-size6.size3{font-size:.66666667em}.ML__mathlive .fontsize-ensurer.reset-size6.size4,.ML__mathlive .sizing.reset-size6.size4{font-size:.75em}.ML__mathlive .fontsize-ensurer.reset-size6.size5,.ML__mathlive .sizing.reset-size6.size5{font-size:.83333333em}.ML__mathlive .fontsize-ensurer.reset-size6.size6,.ML__mathlive .sizing.reset-size6.size6{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size6.size7,.ML__mathlive .sizing.reset-size6.size7{font-size:1.2em}.ML__mathlive .fontsize-ensurer.reset-size6.size8,.ML__mathlive .sizing.reset-size6.size8{font-size:1.44166667em}.ML__mathlive .fontsize-ensurer.reset-size6.size9,.ML__mathlive .sizing.reset-size6.size9{font-size:1.725em}.ML__mathlive .fontsize-ensurer.reset-size6.size10,.ML__mathlive .sizing.reset-size6.size10{font-size:2.075em}.ML__mathlive .fontsize-ensurer.reset-size7.size1,.ML__mathlive .sizing.reset-size7.size1{font-size:.34722222em}.ML__mathlive .fontsize-ensurer.reset-size7.size2,.ML__mathlive .sizing.reset-size7.size2{font-size:.48611111em}.ML__mathlive .fontsize-ensurer.reset-size7.size3,.ML__mathlive .sizing.reset-size7.size3{font-size:.55555556em}.ML__mathlive .fontsize-ensurer.reset-size7.size4,.ML__mathlive .sizing.reset-size7.size4{font-size:.625em}.ML__mathlive .fontsize-ensurer.reset-size7.size5,.ML__mathlive .sizing.reset-size7.size5{font-size:.69444444em}.ML__mathlive .fontsize-ensurer.reset-size7.size6,.ML__mathlive .sizing.reset-size7.size6{font-size:.83333333em}.ML__mathlive .fontsize-ensurer.reset-size7.size7,.ML__mathlive .sizing.reset-size7.size7{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size7.size8,.ML__mathlive .sizing.reset-size7.size8{font-size:1.20138889em}.ML__mathlive .fontsize-ensurer.reset-size7.size9,.ML__mathlive .sizing.reset-size7.size9{font-size:1.4375em}.ML__mathlive .fontsize-ensurer.reset-size7.size10,.ML__mathlive .sizing.reset-size7.size10{font-size:1.72916667em}.ML__mathlive .fontsize-ensurer.reset-size8.size1,.ML__mathlive .sizing.reset-size8.size1{font-size:.28901734em}.ML__mathlive .fontsize-ensurer.reset-size8.size2,.ML__mathlive .sizing.reset-size8.size2{font-size:.40462428em}.ML__mathlive .fontsize-ensurer.reset-size8.size3,.ML__mathlive .sizing.reset-size8.size3{font-size:.46242775em}.ML__mathlive .fontsize-ensurer.reset-size8.size4,.ML__mathlive .sizing.reset-size8.size4{font-size:.52023121em}.ML__mathlive .fontsize-ensurer.reset-size8.size5,.ML__mathlive .sizing.reset-size8.size5{font-size:.57803468em}.ML__mathlive .fontsize-ensurer.reset-size8.size6,.ML__mathlive .sizing.reset-size8.size6{font-size:.69364162em}.ML__mathlive .fontsize-ensurer.reset-size8.size7,.ML__mathlive .sizing.reset-size8.size7{font-size:.83236994em}.ML__mathlive .fontsize-ensurer.reset-size8.size8,.ML__mathlive .sizing.reset-size8.size8{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size8.size9,.ML__mathlive .sizing.reset-size8.size9{font-size:1.19653179em}.ML__mathlive .fontsize-ensurer.reset-size8.size10,.ML__mathlive .sizing.reset-size8.size10{font-size:1.43930636em}.ML__mathlive .fontsize-ensurer.reset-size9.size1,.ML__mathlive .sizing.reset-size9.size1{font-size:.24154589em}.ML__mathlive .fontsize-ensurer.reset-size9.size2,.ML__mathlive .sizing.reset-size9.size2{font-size:.33816425em}.ML__mathlive .fontsize-ensurer.reset-size9.size3,.ML__mathlive .sizing.reset-size9.size3{font-size:.38647343em}.ML__mathlive .fontsize-ensurer.reset-size9.size4,.ML__mathlive .sizing.reset-size9.size4{font-size:.43478261em}.ML__mathlive .fontsize-ensurer.reset-size9.size5,.ML__mathlive .sizing.reset-size9.size5{font-size:.48309179em}.ML__mathlive .fontsize-ensurer.reset-size9.size6,.ML__mathlive .sizing.reset-size9.size6{font-size:.57971014em}.ML__mathlive .fontsize-ensurer.reset-size9.size7,.ML__mathlive .sizing.reset-size9.size7{font-size:.69565217em}.ML__mathlive .fontsize-ensurer.reset-size9.size8,.ML__mathlive .sizing.reset-size9.size8{font-size:.83574879em}.ML__mathlive .fontsize-ensurer.reset-size9.size9,.ML__mathlive .sizing.reset-size9.size9{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size9.size10,.ML__mathlive .sizing.reset-size9.size10{font-size:1.20289855em}.ML__mathlive .fontsize-ensurer.reset-size10.size1,.ML__mathlive .sizing.reset-size10.size1{font-size:.20080321em}.ML__mathlive .fontsize-ensurer.reset-size10.size2,.ML__mathlive .sizing.reset-size10.size2{font-size:.2811245em}.ML__mathlive .fontsize-ensurer.reset-size10.size3,.ML__mathlive .sizing.reset-size10.size3{font-size:.32128514em}.ML__mathlive .fontsize-ensurer.reset-size10.size4,.ML__mathlive .sizing.reset-size10.size4{font-size:.36144578em}.ML__mathlive .fontsize-ensurer.reset-size10.size5,.ML__mathlive .sizing.reset-size10.size5{font-size:.40160643em}.ML__mathlive .fontsize-ensurer.reset-size10.size6,.ML__mathlive .sizing.reset-size10.size6{font-size:.48192771em}.ML__mathlive .fontsize-ensurer.reset-size10.size7,.ML__mathlive .sizing.reset-size10.size7{font-size:.57831325em}.ML__mathlive .fontsize-ensurer.reset-size10.size8,.ML__mathlive .sizing.reset-size10.size8{font-size:.69477912em}.ML__mathlive .fontsize-ensurer.reset-size10.size9,.ML__mathlive .sizing.reset-size10.size9{font-size:.8313253em}.ML__mathlive .fontsize-ensurer.reset-size10.size10,.ML__mathlive .sizing.reset-size10.size10{font-size:1em}.ML__mathlive .delimsizing.size1{font-family:KaTeX_Size1}.ML__mathlive .delimsizing.size2{font-family:KaTeX_Size2}.ML__mathlive .delimsizing.size3{font-family:KaTeX_Size3}.ML__mathlive .delimsizing.size4{font-family:KaTeX_Size4}.ML__mathlive .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1;vertical-align:top}.ML__mathlive .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4;vertical-align:top}.ML__mathlive .nulldelimiter{width:.12em}.ML__mathlive .op-symbol{position:relative}.ML__mathlive .op-symbol.small-op{font-family:KaTeX_Size1}.ML__mathlive .op-symbol.large-op{font-family:KaTeX_Size2}.ML__mathlive .op-limits .vlist>span{text-align:center}.ML__mathlive .accent>.vlist>span{text-align:center}.ML__mathlive .accent .accent-body>span{width:0}.ML__mathlive .accent .accent-body.accent-vec>span{position:relative;left:.326em}.ML__mathlive .mtable .vertical-separator{display:inline-block;margin:0 -.025em;border-right:.05em solid #000}.ML__mathlive .mtable .arraycolsep{display:inline-block}.ML__mathlive .mtable .col-align-c>.vlist{text-align:center}.ML__mathlive .mtable .col-align-l>.vlist{text-align:left}.ML__mathlive .mtable .col-align-r>.vlist{text-align:right}.ML__selection{background:var(--highlight-inactive);box-sizing:border-box}.ML__focused .ML__selection{background:var(--highlight)!important;color:var(--on-highlight)}.ML__contains-caret.ML__close,.ML__contains-caret.ML__open,.ML__contains-caret>.ML__close,.ML__contains-caret>.ML__open,.sqrt.ML__contains-caret>.sqrt-sign,.sqrt.ML__contains-caret>.vlist>span>.sqrt-line{color:var(--caret)}.ML__command{font-family:Source Code Pro,Consolas,Roboto Mono,Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Courier,monospace;letter-spacing:-1px;font-weight:400;color:var(--primary)}:not(.ML__command)+.ML__command{margin-left:.25em}.ML__command+:not(.ML__command){padding-left:.25em}.ML__smart-fence__close{opacity:.5}.ML__keystroke-caption{visibility:hidden;background:var(--secondary);border-color:var(--secondary-border);box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);text-align:center;border-radius:6px;padding:16px;position:absolute;z-index:1;display:flex;flex-direction:row;justify-content:center;--keystroke:#fff;--on-keystroke:#555;--keystroke-border:#f7f7f7}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__keystroke-caption{--keystroke:hsl(var(--hue),50%,30%);--on-keystroke:#fafafa;--keystroke-border:hsl(var(--hue),50%,25%)}}body[theme=dark] .ML__keystroke-caption{--keystroke:hsl(var(--hue),50%,30%);--on-keystroke:#fafafa;--keystroke-border:hsl(var(--hue),50%,25%)}[data-tooltip]{position:relative}[data-tooltip][data-placement=top]:after{top:inherit;bottom:100%}[data-tooltip]:after{position:absolute;visibility:hidden;content:attr(data-tooltip);display:inline-table;top:110%;width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:200px;padding:8px;background:#616161;color:#fff;text-align:center;z-index:2;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);border-radius:2px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-weight:400;font-size:12px;opacity:0;transform:scale(.5);transition:all .15s cubic-bezier(.4,0,1,1)}@media only screen and (max-width:767px){[data-tooltip]:after{height:32px;padding:4px 16px;font-size:14px}}[data-tooltip]:hover{position:relative}[data-tooltip]:hover:after{visibility:visible;opacity:1;transform:scale(1)}[data-tooltip][data-delay]:after{transition-delay:0s}[data-tooltip][data-delay]:hover:after{transition-delay:1s}.can-redo [data-command=redo]{opacity:1!important}.can-undo [data-command=undo]{opacity:1!important}.ML__keyboard{--keyboard-background:rgba(209,213,217,0.95);--keyboard-text:#000;--keyboard-text-active:var(--primary);--keyboard-background-border:#ddd;--keycap-background:#fff;--keycap-background-active:#e5e5e5;--keycap-background-border:#e5e6e9;--keycap-background-border-bottom:#8d8f92;--keycap-text:#000;--keycap-text-active:#fff;--keycap-secondary-text:#000;--keycap-modifier-background:#b9bdc7;--keycap-modifier-border:#c5c9d0;--keycap-modifier-border-bottom:#989da6;--keyboard-alternate-background:#fff;--keyboard-alternate-background-active:#e5e5e5;--keyboard-alternate-text:#000;position:fixed;left:0;bottom:-267px;width:100vw;z-index:105;padding-top:5px;transform:translate(0);opacity:0;visibility:hidden;transition:.28s cubic-bezier(0,0,.2,1);transition-property:transform,opacity;-webkit-backdrop-filter:grayscale(50%);backdrop-filter:grayscale(50%);background-color:var(--keyboard-background);border:1px solid var(--keyboard-background-border);font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:16px;font-weight:400;margin:0;text-shadow:none;box-sizing:border-box;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23)}.ML__keyboard.is-visible{transform:translateY(-267px);opacity:1;visibility:visible;transition-timing-function:cubic-bezier(.4,0,1,1)}.ML__keyboard .tex{font-family:KaTeX_Main,Cambria Math,Asana Math,OpenSymbol,Symbola,STIX,Times,serif!important}.ML__keyboard .tex-math{font-family:KaTeX_Math,Cambria Math,Asana Math,OpenSymbol,Symbola,STIX,Times,serif!important}.ML__keyboard .tt{font-family:Source Code Pro,Consolas,Roboto Mono,Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Courier,monospace!important;font-size:30px;font-weight:400}.ML__keyboard.alternate-keys{visibility:hidden;max-width:286px;background-color:var(--keyboard-alternate-background);text-align:center;border-radius:6px;position:fixed;bottom:auto;top:0;box-sizing:content-box;transform:none;z-index:106;display:flex;flex-direction:row;justify-content:center;align-content:center;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);transition:none}@media only screen and (max-height:412px){.ML__keyboard.alternate-keys{max-width:320px}}.ML__keyboard.alternate-keys.is-visible{visibility:visible}.ML__keyboard.alternate-keys ul{list-style:none;margin:3px;padding:0;display:flex;flex-flow:row wrap-reverse;justify-content:center}.ML__keyboard.alternate-keys ul>li{display:flex;flex-flow:column;align-items:center;justify-content:center;font-size:30px;height:70px;width:70px;box-sizing:border-box;margin:0;background:transparent;border:1px solid transparent;border-radius:5px;pointer-events:all;color:var(--keyboard-alternate-text);fill:currentColor}@media only screen and (max-height:412px){.ML__keyboard.alternate-keys ul>li{font-size:24px;height:50px;width:50px}}.ML__keyboard.alternate-keys ul>li.active,.ML__keyboard.alternate-keys ul>li.pressed,.ML__keyboard.alternate-keys ul>li:hover{box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23);background:var(--keyboard-alternate-background-active);color:var(--keyboard-text-active)}.ML__keyboard.alternate-keys ul>li.small{font-size:18px}.ML__keyboard.alternate-keys ul>li.small-button{width:42px;height:42px;margin:2px;background:#fbfbfb}.ML__keyboard.alternate-keys ul>li.small-button:hover{background:var(--keyboard-alternate-background-active)}.ML__keyboard.alternate-keys ul>li.box>div,.ML__keyboard.alternate-keys ul>li.box>span{border:1px dashed rgba(0,0,0,.24)}.ML__keyboard.alternate-keys ul>li .warning{min-height:60px;min-width:60px;background:#cd0030;color:#fff;padding:5px;display:flex;align-items:center;justify-content:center;border-radius:5px}.ML__keyboard.alternate-keys ul>li .warning.active,.ML__keyboard.alternate-keys ul>li .warning.pressed,.ML__keyboard.alternate-keys ul>li .warning:hover{background:red}.ML__keyboard.alternate-keys ul>li .warning svg{width:50px;height:50px}.ML__keyboard.alternate-keys ul>li aside{font-size:12px;line-height:12px;opacity:.78}.ML__keyboard>div.keyboard-layer{display:none;outline:none}.ML__keyboard>div.keyboard-layer.is-visible{display:flex;flex-flow:column}.ML__keyboard>div>div.keyboard-toolbar{align-self:center;display:flex;flex-flow:row;justify-content:space-between;width:736px}@media only screen and (min-width:768px) and (max-width:1024px){.ML__keyboard>div>div.keyboard-toolbar{width:556px}}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar{width:365px;max-width:100vw}}.ML__keyboard>div>div.keyboard-toolbar svg{height:20px;width:20px}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar svg{height:13px;width:17px}}.ML__keyboard>div>div.keyboard-toolbar>.left{justify-content:flex-start;display:flex;flex-flow:row}.ML__keyboard>div>div.keyboard-toolbar>.right{justify-content:flex-end;display:flex;flex-flow:row}.ML__keyboard>div>div.keyboard-toolbar>div>div{display:flex;align-items:baseline;justify-content:center;pointer-events:all;color:var(--keyboard-text);fill:currentColor;background:0;font-size:110%;cursor:pointer;min-height:0;padding:4px 10px;margin:7px 4px 6px;box-shadow:none;border:none;border-bottom:2px solid transparent}.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled.pressed svg,.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled:hover svg,.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled svg{color:var(--keyboard-text);opacity:.2}@media only screen and (max-width:414px){.ML__keyboard>div>div.keyboard-toolbar>div>div{font-size:100%;padding:0 6px 0 0}}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar>div>div{padding-left:4px;padding-right:4px;font-size:90%}}.ML__keyboard>div>div.keyboard-toolbar>div>div.active,.ML__keyboard>div>div.keyboard-toolbar>div>div.pressed,.ML__keyboard>div>div.keyboard-toolbar>div>div:active,.ML__keyboard>div>div.keyboard-toolbar>div>div:hover{color:var(--keyboard-text-active)}.ML__keyboard>div>div.keyboard-toolbar>div>div.selected{color:var(--keyboard-text-active);border-bottom:2px solid var(--keyboard-text-active);margin-bottom:8px;padding-bottom:0}.ML__keyboard div .rows{border:0;border-collapse:separate;clear:both;margin:auto;display:flex;flex-flow:column;align-items:center}.ML__keyboard div .rows>ul{list-style:none;height:40px;margin:0 0 3px;padding:0}.ML__keyboard div .rows>ul>li{display:flex;flex-flow:column;align-items:center;justify-content:center;width:34px;margin-right:2px;height:40px;box-sizing:border-box;padding:8px 0;vertical-align:top;text-align:center;float:left;color:var(--keycap-text);fill:currentColor;font-size:20px;background:var(--keycap-background);border:1px solid var(--keycap-background-border);border-bottom-color:var(--keycap-background-border-bottom);border-radius:5px;pointer-events:all;position:relative;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ML__keyboard div .rows>ul>li:last-child{margin-right:0}.ML__keyboard div .rows>ul>li.small{font-size:16px}.ML__keyboard div .rows>ul>li.tt{color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.bottom{justify-content:flex-end}.ML__keyboard div .rows>ul>li.left{align-items:flex-start;padding-left:4px}.ML__keyboard div .rows>ul>li.right{align-items:flex-end;padding-right:4px}.ML__keyboard div .rows>ul>li svg{width:20px;height:20px}.ML__keyboard div .rows>ul>li .warning{height:25px;width:25px;min-height:25px;min-width:25px;background:#cd0030;color:#fff;border-radius:100%;padding:5px;display:flex;align-items:center;justify-content:center;margin-bottom:-2px}.ML__keyboard div .rows>ul>li .warning svg{width:16px;height:16px}@media only screen and (max-width:768px){.ML__keyboard div .rows>ul>li .warning{height:16px;width:16px;min-height:16px;min-width:16px}.ML__keyboard div .rows>ul>li .warning svg{width:14px;height:14px}}.ML__keyboard div .rows>ul>li>.w0{width:0}.ML__keyboard div .rows>ul>li>.w5{width:16px}.ML__keyboard div .rows>ul>li>.w15{width:52px}.ML__keyboard div .rows>ul>li>.w20{width:70px}.ML__keyboard div .rows>ul>li>.w50{width:178px}.ML__keyboard div .rows>ul>li.separator{background:transparent;border:none;pointer-events:none}@media only screen and (max-width:560px){.ML__keyboard div .rows>ul>li.if-wide{display:none}}.ML__keyboard div .rows>ul>li.tex-math{font-size:25px}.ML__keyboard div .rows>ul>li.pressed,.ML__keyboard div .rows>ul>li:hover{background:var(--keycap-background-active);color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.action.active,.ML__keyboard div .rows>ul>li.action:active,.ML__keyboard div .rows>ul>li.keycap.active,.ML__keyboard div .rows>ul>li.keycap:active{transform:translateY(-20px) scale(1.4);z-index:100;color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.modifier.active,.ML__keyboard div .rows>ul>li.modifier:active{background:var(--keyboard-text-active);color:var(--keycap-text-active)}.ML__keyboard div .rows>ul>li.action.font-glyph,.ML__keyboard div .rows>ul>li.modifier.font-glyph{font-size:18px}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.action.font-glyph,.ML__keyboard div .rows>ul>li.modifier.font-glyph{font-size:16px}}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.bigfnbutton,.ML__keyboard div .rows>ul>li.fnbutton{font-size:12px}}.ML__keyboard div .rows>ul>li.bigfnbutton{font-size:14px}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.bigfnbutton{font-size:9px}}.ML__keyboard div .rows>ul>li.action,.ML__keyboard div .rows>ul>li.modifier{background-color:var(--keycap-modifier-background);border-bottom-color:var(--keycap-modifier-border);border-color:var(--keycap-modifier-border) var(--keycap-modifier-border) var(--keycap-modifier-border-bottom);font-size:65%;font-weight:100}.ML__keyboard div .rows>ul>li.action.selected,.ML__keyboard div .rows>ul>li.modifier.selected{color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.action.selected.active,.ML__keyboard div .rows>ul>li.action.selected.pressed,.ML__keyboard div .rows>ul>li.action.selected:active,.ML__keyboard div .rows>ul>li.action.selected:hover,.ML__keyboard div .rows>ul>li.modifier.selected.active,.ML__keyboard div .rows>ul>li.modifier.selected.pressed,.ML__keyboard div .rows>ul>li.modifier.selected:active,.ML__keyboard div .rows>ul>li.modifier.selected:hover{color:#fff}.ML__keyboard div .rows>ul>li.keycap.w50{font-size:80%;padding-top:10px;font-weight:100}.ML__keyboard div .rows>ul>li small{color:#555}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li small{font-size:9px}}.ML__keyboard div .rows>ul>li aside{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:10px;line-height:10px;color:#666}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li aside{display:none}}@media only screen and (max-width:414px){.ML__keyboard div .rows>ul>li{width:29px;margin-right:2px}.ML__keyboard div .rows>ul>.w5{width:13.5px}.ML__keyboard div .rows>ul>.w15{width:44.5px}.ML__keyboard div .rows>ul>.w20{width:60px}.ML__keyboard div .rows>ul>.w50{width:153px}}@media only screen and (min-width:415px) and (max-width:768px){.ML__keyboard div .rows>ul>li{width:37px;margin-right:3px}.ML__keyboard div .rows>ul>.w5{width:17px}.ML__keyboard div .rows>ul>.w15{width:57px}.ML__keyboard div .rows>ul>.w20{width:77px}.ML__keyboard div .rows>ul>.w50{width:197px}}@media only screen and (min-width:768px) and (max-width:1024px){.ML__keyboard div .rows>ul{height:52px}.ML__keyboard div .rows>ul>li{height:52px;width:51px;margin-right:4px}.ML__keyboard div .rows>ul>.w5{width:23.5px}.ML__keyboard div .rows>ul>.w15{width:78.5px}.ML__keyboard div .rows>ul>.w20{width:106px}.ML__keyboard div .rows>ul>.w50{width:271px}}@media only screen and (min-width:1025px){.ML__keyboard div .rows>ul{height:52px}.ML__keyboard div .rows>ul>li{height:52px;width:66px;margin-right:6px}.ML__keyboard div .rows>ul>.action,.ML__keyboard div .rows>ul>.modifier{font-size:80%}.ML__keyboard div .rows>ul>.w5{width:30px}.ML__keyboard div .rows>ul>.w15{width:102px}.ML__keyboard div .rows>ul>.w20{width:138px}.ML__keyboard div .rows>ul>.w50{width:354px}}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__keyboard{--hue:206;--keyboard-background:hsl(var(--hue),19%,38%);--keyboard-text:#f0f0f0;--keyboard-text-active:hsl(var(--hue),100%,60%);--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:hsl(var(--hue),35%,42%);--keycap-background-border:hsl(var(--hue),25%,35%);--keycap-background-border-bottom:#426b8a;--keycap-text:#d0d0d0;--keycap-text-active:#000;--keycap-secondary-text:#fff;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),19%,38%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}}body[theme=dark] .ML__keyboard{--hue:206;--keyboard-background:hsl(var(--hue),19%,38%);--keyboard-text:#f0f0f0;--keyboard-text-active:hsl(var(--hue),100%,60%);--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:hsl(var(--hue),35%,42%);--keycap-background-border:hsl(var(--hue),25%,35%);--keycap-background-border-bottom:#426b8a;--keycap-text:#d0d0d0;--keycap-text-active:#000;--keycap-secondary-text:#fff;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),19%,38%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}div.ML__keyboard.material{--keyboard-background:rgba(209,213,217,0.9);--keyboard-background-border:#ddd;--keycap-background:transparent;--keycap-background-active:#cccfd1;--keycap-background-border:transparent;--keyboard-alternate-background:#efefef;--keyboard-alternate-text:#000;font-family:Roboto,sans-serif}div.ML__keyboard.material.alternate-keys{background:var(--keyboard-alternate-background);border:1px solid transparent;border-radius:5px;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22)}div.ML__keyboard.material.alternate-keys ul li.active,div.ML__keyboard.material.alternate-keys ul li.pressed,div.ML__keyboard.material.alternate-keys ul li:active,div.ML__keyboard.material.alternate-keys ul li:hover{border:1px solid transparent;background:#5f97fc;color:#fff;fill:currentColor}div.ML__keyboard.material .keyboard-toolbar>div>div{font-size:16px}div.ML__keyboard.material .keyboard-toolbar div.div.active,div.ML__keyboard.material .keyboard-toolbar div.div.pressed,div.ML__keyboard.material .keyboard-toolbar div div:active,div.ML__keyboard.material .keyboard-toolbar div div:hover{color:#5f97fc;fill:currentColor}div.ML__keyboard.material .keyboard-toolbar>div>.selected{color:#5f97fc;fill:currentColor;border-bottom:2px solid #5f97fc;margin-bottom:8px;padding-bottom:0}div.ML__keyboard.material div>.rows>ul>.keycap{background:transparent;border:1px solid transparent;border-radius:5px;color:var(--keycap-text);fill:currentColor;transition:none}div.ML__keyboard.material div>.rows>ul>.keycap.tt{color:#5f97fc}div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]{margin-top:10px;margin-bottom:10px;height:20px;background:#e0e0e0}div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "].active,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "].pressed,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]:active,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]:hover{background:#d0d0d0;box-shadow:none;transform:none}div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):hover{border:1px solid transparent;background:var(--keycap-background-active);box-shadow:none}div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{background:var(--keyboard-alternate-background);color:var(--keyboard-alternate-text);box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23)}@media only screen and (max-width:767px){div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23);font-size:10px;vertical-align:top;width:19.5px;margin-right:10px;margin-left:10px;transform:translateY(-20px) scale(2);transition:none;justify-content:flex-start;padding:2px 0 0;z-index:100}}@media only screen and (max-width:414px){div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{width:16.5px}}@media only screen and (max-width:767px){div.ML__keyboard.material div>.rows>ul>.keycap:last-child.active,div.ML__keyboard.material div>.rows>ul>.keycap:last-child:active{margin-right:0;margin-left:14px}}div.ML__keyboard.material div div.rows ul li.action,div.ML__keyboard.material div div.rows ul li.modifier{background:transparent;border:0;color:#869096;fill:currentColor;font-size:16px;transition:none}div.ML__keyboard.material div div.rows ul li.action.selected,div.ML__keyboard.material div div.rows ul li.modifier.selected{color:#5f97fc;border-radius:0;border-bottom:2px solid #5f97fc}div.ML__keyboard.material div div.rows ul li.action.active,div.ML__keyboard.material div div.rows ul li.action.pressed,div.ML__keyboard.material div div.rows ul li.action:active,div.ML__keyboard.material div div.rows ul li.action:hover,div.ML__keyboard.material div div.rows ul li.modifier.active,div.ML__keyboard.material div div.rows ul li.modifier.pressed,div.ML__keyboard.material div div.rows ul li.modifier:active,div.ML__keyboard.material div div.rows ul li.modifier:hover{border:0;color:var(--keycap-text);background:var(--keycap-background-active);box-shadow:none}div.ML__keyboard.material div div.rows ul li.bigfnbutton,div.ML__keyboard.material div div.rows ul li.fnbutton{background:transparent;border:0}div.ML__keyboard.material div div.rows ul li.bigfnbutton.selected,div.ML__keyboard.material div div.rows ul li.fnbutton.selected{color:#5f97fc;fill:currentColor;border-radius:0;border-bottom:2px solid #5f97fc}div.ML__keyboard.material div div.rows ul li.bigfnbutton.active,div.ML__keyboard.material div div.rows ul li.bigfnbutton.pressed,div.ML__keyboard.material div div.rows ul li.bigfnbutton:active,div.ML__keyboard.material div div.rows ul li.bigfnbutton:hover,div.ML__keyboard.material div div.rows ul li.fnbutton.active,div.ML__keyboard.material div div.rows ul li.fnbutton.pressed,div.ML__keyboard.material div div.rows ul li.fnbutton:active,div.ML__keyboard.material div div.rows ul li.fnbutton:hover{border:0;color:#5f97fc;fill:currentColor;background:var(--keycap-background-active);box-shadow:none}@media (prefers-color-scheme:dark){body:not([theme=light]) div.ML__keyboard.material{--hue:198;--keyboard-background:hsl(var(--hue),19%,18%);--keyboard-text:#d4d6d7;--keyboard-text-active:#5f97fc;--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:#5f97fc;--keycap-background-border:transparent;--keycap-background-border-bottom:transparent;--keycap-text:#d0d0d0;--keycap-text-active:#d4d6d7;--keycap-secondary-text:#5f97fc;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),8%,2%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}}body[theme=dark] div.ML__keyboard.material{--hue:198;--keyboard-background:hsl(var(--hue),19%,18%);--keyboard-text:#d4d6d7;--keyboard-text-active:#5f97fc;--keyboard-background-border:#333;--keycap-background:hsl(var(--hue),25%,39%);--keycap-background-active:#5f97fc;--keycap-background-border:transparent;--keycap-background-border-bottom:transparent;--keycap-text:#d0d0d0;--keycap-text-active:#d4d6d7;--keycap-secondary-text:#5f97fc;--keycap-modifier-background:hsl(var(--hue),35%,40%);--keycap-modifier-border:hsl(var(--hue),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue),35%,42%);--keyboard-alternate-background:hsl(var(--hue),8%,2%);--keyboard-alternate-background-active:hsl(var(--hue),35%,42%);--keyboard-alternate-text:#d1d1d1}.ML__error{background-image:radial-gradient(ellipse at center,#cc0041,transparent 70%);background-repeat:repeat-x;background-size:3px 3px;background-position:0 98%}.ML__suggestion{opacity:.5}.ML__placeholder{opacity:.7;padding-left:.5ex;padding-right:.5ex}.ML__keystroke-caption>span{min-width:14px;margin:0 8px 0 0;padding:4px;background-color:var(--keystroke);color:var(--on-keystroke);fill:currentColor;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:1em;border-radius:6px;border:2px solid var(--keystroke-border)}.ML__virtual-keyboard-toggle.pressed{background:hsla(0,0%,70%,.5)}.ML__virtual-keyboard-toggle:focus{outline:none;border-radius:50%;border:2px solid var(--primary)}.ML__virtual-keyboard-toggle.active,.ML__virtual-keyboard-toggle.active:hover{background:hsla(0,0%,70%,.5);color:#000;fill:currentColor}div.ML__popover.is-visible{visibility:visible;-webkit-animation:ML__fade-in .15s cubic-bezier(0,0,.2,1);animation:ML__fade-in .15s cubic-bezier(0,0,.2,1)}@-webkit-keyframes ML__fade-in{0%{opacity:0}to{opacity:1}}@keyframes ML__fade-in{0%{opacity:0}to{opacity:1}}.ML__popover__content{border-radius:6px;padding:2px;cursor:pointer;min-height:100px;display:flex;flex-direction:column;justify-content:center;margin-left:8px;margin-right:8px}.ML__popover__content a{color:#5ea6fd;padding-top:.3em;margin-top:.4em;display:block}.ML__popover__content a:hover{color:#5ea6fd;text-decoration:underline}.ML__popover__content.active,.ML__popover__content.pressed,.ML__popover__content:hover{background:hsla(0,0%,100%,.1)}.ML__popover__command{font-size:1.6rem}.ML__popover__prev-shortcut{height:31px;opacity:.1;cursor:pointer;margin-left:8px;margin-right:8px;padding-top:4px;padding-bottom:2px}.ML__popover__next-shortcut:hover,.ML__popover__prev-shortcut:hover{opacity:.3}.ML__popover__next-shortcut.active,.ML__popover__next-shortcut.pressed,.ML__popover__prev-shortcut.active,.ML__popover__prev-shortcut.pressed{opacity:1}.ML__popover__next-shortcut>span,.ML__popover__prev-shortcut>span{padding:5px;border-radius:50%;width:20px;height:20px;display:inline-block}.ML__popover__prev-shortcut>span>span{margin-top:-2px;display:block}.ML__popover__next-shortcut>span>span{margin-top:2px;display:block}.ML__popover__next-shortcut:hover>span,.ML__popover__prev-shortcut:hover>span{background:hsla(0,0%,100%,.1)}.ML__popover__next-shortcut{height:34px;opacity:.1;cursor:pointer;margin-left:8px;margin-right:8px;padding-top:2px;padding-bottom:4px}.ML__popover__shortcut{font-size:.8em;margin-top:.25em}.ML__popover__note,.ML__popover__shortcut{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;opacity:.7;padding-top:.25em}.ML__popover__note{font-size:.8rem;line-height:1em;padding-left:.5em;padding-right:.5em}.ML__shortcut-join{opacity:.5}.ML__scroller{position:fixed;z-index:1;top:0;height:100vh;width:200px} \ No newline at end of file diff --git a/dist/mathlive.js b/dist/mathlive.js index 0ea1409da..f13cf39ef 100644 --- a/dist/mathlive.js +++ b/dist/mathlive.js @@ -1,21072 +1 @@ -var global, factory; -(global = this), - (factory = function() { - function t(t, e) { - e = e || 0; - const i = t.charCodeAt(e); - if (55296 <= i && i <= 56319 && e < t.length - 1) { - const s = i, - a = t.charCodeAt(e + 1); - return 56320 <= a && a <= 57343 - ? 1024 * (s - 55296) + (a - 56320) + 65536 - : s; - } - if (56320 <= i && i <= 57343 && e >= 1) { - const s = t.charCodeAt(e - 1), - a = i; - return 55296 <= s && s <= 56319 - ? 1024 * (s - 55296) + (a - 56320) + 65536 - : a; - } - return i; - } - function e(e, s) { - if ((s = s || 0) < 0) return 0; - if (s >= e.length - 1) return e.length; - let a = i(t(e, s)); - for (let r = s + 1; r < e.length; r++) { - if ( - 55296 <= e.charCodeAt(r - 1) && - e.charCodeAt(r - 1) <= 56319 && - 56320 <= e.charCodeAt(r) && - e.charCodeAt(r) <= 57343 - ) - continue; - const s = i(t(e, r)); - if ( - ((n = s), - !( - (11 === (o = a) && 12 === n) || - (3 === o && 11 === n) || - (11 === o && 3 === n) || - (0 === o && 1 === n) || - (2 !== o && - 0 !== o && - 1 !== o && - 2 !== n && - 0 !== n && - 1 !== n && - ((6 === o && - (6 === n || 7 === n || 9 === n || 10 === n)) || - !( - (9 !== o && 7 !== o) || - (7 !== n && 8 !== n) - ) || - ((10 === o || 8 === o) && 8 === n) || - (4 === o && 4 === n) || - 3 === n || - 5 === n)) - )) - ) - return r; - a = s; - } - var o, n; - return e.length; - } - function i(t) { - return 13 === t - ? 0 - : 10 === t - ? 1 - : (0 <= t && t <= 9) || - (11 <= t && t <= 12) || - (14 <= t && t <= 31) || - (127 <= t && t <= 159) || - 173 === t || - (1536 <= t && t <= 1541) || - 1564 === t || - 1757 === t || - 1807 === t || - 6158 === t || - 8203 === t || - (8206 <= t && t <= 8207) || - 8232 === t || - 8233 === t || - (8234 <= t && t <= 8238) || - (8288 <= t && t <= 8292) || - 8293 === t || - (8294 <= t && t <= 8303) || - (55296 <= t && t <= 57343) || - 65279 === t || - (65520 <= t && t <= 65528) || - (65529 <= t && t <= 65531) || - 69821 === t || - (113824 <= t && t <= 113827) || - (119155 <= t && t <= 119162) || - 917504 === t || - 917505 === t || - (917506 <= t && t <= 917535) || - (917536 <= t && t <= 917631) || - (917632 <= t && t <= 917759) || - (918e3 <= t && t <= 921599) - ? 2 - : (768 <= t && t <= 879) || - (1155 <= t && t <= 1159) || - (1160 <= t && t <= 1161) || - (1425 <= t && t <= 1469) || - 1471 === t || - (1473 <= t && t <= 1474) || - (1476 <= t && t <= 1477) || - 1479 === t || - (1552 <= t && t <= 1562) || - (1611 <= t && t <= 1631) || - 1648 === t || - (1750 <= t && t <= 1756) || - (1759 <= t && t <= 1764) || - (1767 <= t && t <= 1768) || - (1770 <= t && t <= 1773) || - 1809 === t || - (1840 <= t && t <= 1866) || - (1958 <= t && t <= 1968) || - (2027 <= t && t <= 2035) || - (2070 <= t && t <= 2073) || - (2075 <= t && t <= 2083) || - (2085 <= t && t <= 2087) || - (2089 <= t && t <= 2093) || - (2137 <= t && t <= 2139) || - (2275 <= t && t <= 2306) || - 2362 === t || - 2364 === t || - (2369 <= t && t <= 2376) || - 2381 === t || - (2385 <= t && t <= 2391) || - (2402 <= t && t <= 2403) || - 2433 === t || - 2492 === t || - 2494 === t || - (2497 <= t && t <= 2500) || - 2509 === t || - 2519 === t || - (2530 <= t && t <= 2531) || - (2561 <= t && t <= 2562) || - 2620 === t || - (2625 <= t && t <= 2626) || - (2631 <= t && t <= 2632) || - (2635 <= t && t <= 2637) || - 2641 === t || - (2672 <= t && t <= 2673) || - 2677 === t || - (2689 <= t && t <= 2690) || - 2748 === t || - (2753 <= t && t <= 2757) || - (2759 <= t && t <= 2760) || - 2765 === t || - (2786 <= t && t <= 2787) || - 2817 === t || - 2876 === t || - 2878 === t || - 2879 === t || - (2881 <= t && t <= 2884) || - 2893 === t || - 2902 === t || - 2903 === t || - (2914 <= t && t <= 2915) || - 2946 === t || - 3006 === t || - 3008 === t || - 3021 === t || - 3031 === t || - 3072 === t || - (3134 <= t && t <= 3136) || - (3142 <= t && t <= 3144) || - (3146 <= t && t <= 3149) || - (3157 <= t && t <= 3158) || - (3170 <= t && t <= 3171) || - 3201 === t || - 3260 === t || - 3263 === t || - 3266 === t || - 3270 === t || - (3276 <= t && t <= 3277) || - (3285 <= t && t <= 3286) || - (3298 <= t && t <= 3299) || - 3329 === t || - 3390 === t || - (3393 <= t && t <= 3396) || - 3405 === t || - 3415 === t || - (3426 <= t && t <= 3427) || - 3530 === t || - 3535 === t || - (3538 <= t && t <= 3540) || - 3542 === t || - 3551 === t || - 3633 === t || - (3636 <= t && t <= 3642) || - (3655 <= t && t <= 3662) || - 3761 === t || - (3764 <= t && t <= 3769) || - (3771 <= t && t <= 3772) || - (3784 <= t && t <= 3789) || - (3864 <= t && t <= 3865) || - 3893 === t || - 3895 === t || - 3897 === t || - (3953 <= t && t <= 3966) || - (3968 <= t && t <= 3972) || - (3974 <= t && t <= 3975) || - (3981 <= t && t <= 3991) || - (3993 <= t && t <= 4028) || - 4038 === t || - (4141 <= t && t <= 4144) || - (4146 <= t && t <= 4151) || - (4153 <= t && t <= 4154) || - (4157 <= t && t <= 4158) || - (4184 <= t && t <= 4185) || - (4190 <= t && t <= 4192) || - (4209 <= t && t <= 4212) || - 4226 === t || - (4229 <= t && t <= 4230) || - 4237 === t || - 4253 === t || - (4957 <= t && t <= 4959) || - (5906 <= t && t <= 5908) || - (5938 <= t && t <= 5940) || - (5970 <= t && t <= 5971) || - (6002 <= t && t <= 6003) || - (6068 <= t && t <= 6069) || - (6071 <= t && t <= 6077) || - 6086 === t || - (6089 <= t && t <= 6099) || - 6109 === t || - (6155 <= t && t <= 6157) || - 6313 === t || - (6432 <= t && t <= 6434) || - (6439 <= t && t <= 6440) || - 6450 === t || - (6457 <= t && t <= 6459) || - (6679 <= t && t <= 6680) || - 6683 === t || - 6742 === t || - (6744 <= t && t <= 6750) || - 6752 === t || - 6754 === t || - (6757 <= t && t <= 6764) || - (6771 <= t && t <= 6780) || - 6783 === t || - (6832 <= t && t <= 6845) || - 6846 === t || - (6912 <= t && t <= 6915) || - 6964 === t || - (6966 <= t && t <= 6970) || - 6972 === t || - 6978 === t || - (7019 <= t && t <= 7027) || - (7040 <= t && t <= 7041) || - (7074 <= t && t <= 7077) || - (7080 <= t && t <= 7081) || - (7083 <= t && t <= 7085) || - 7142 === t || - (7144 <= t && t <= 7145) || - 7149 === t || - (7151 <= t && t <= 7153) || - (7212 <= t && t <= 7219) || - (7222 <= t && t <= 7223) || - (7376 <= t && t <= 7378) || - (7380 <= t && t <= 7392) || - (7394 <= t && t <= 7400) || - 7405 === t || - 7412 === t || - (7416 <= t && t <= 7417) || - (7616 <= t && t <= 7669) || - (7676 <= t && t <= 7679) || - (8204 <= t && t <= 8205) || - (8400 <= t && t <= 8412) || - (8413 <= t && t <= 8416) || - 8417 === t || - (8418 <= t && t <= 8420) || - (8421 <= t && t <= 8432) || - (11503 <= t && t <= 11505) || - 11647 === t || - (11744 <= t && t <= 11775) || - (12330 <= t && t <= 12333) || - (12334 <= t && t <= 12335) || - (12441 <= t && t <= 12442) || - 42607 === t || - (42608 <= t && t <= 42610) || - (42612 <= t && t <= 42621) || - (42654 <= t && t <= 42655) || - (42736 <= t && t <= 42737) || - 43010 === t || - 43014 === t || - 43019 === t || - (43045 <= t && t <= 43046) || - 43204 === t || - (43232 <= t && t <= 43249) || - (43302 <= t && t <= 43309) || - (43335 <= t && t <= 43345) || - (43392 <= t && t <= 43394) || - 43443 === t || - (43446 <= t && t <= 43449) || - 43452 === t || - 43493 === t || - (43561 <= t && t <= 43566) || - (43569 <= t && t <= 43570) || - (43573 <= t && t <= 43574) || - 43587 === t || - 43596 === t || - 43644 === t || - 43696 === t || - (43698 <= t && t <= 43700) || - (43703 <= t && t <= 43704) || - (43710 <= t && t <= 43711) || - 43713 === t || - (43756 <= t && t <= 43757) || - 43766 === t || - 44005 === t || - 44008 === t || - 44013 === t || - 64286 === t || - (65024 <= t && t <= 65039) || - (65056 <= t && t <= 65071) || - (65438 <= t && t <= 65439) || - 66045 === t || - 66272 === t || - (66422 <= t && t <= 66426) || - (68097 <= t && t <= 68099) || - (68101 <= t && t <= 68102) || - (68108 <= t && t <= 68111) || - (68152 <= t && t <= 68154) || - 68159 === t || - (68325 <= t && t <= 68326) || - 69633 === t || - (69688 <= t && t <= 69702) || - (69759 <= t && t <= 69761) || - (69811 <= t && t <= 69814) || - (69817 <= t && t <= 69818) || - (69888 <= t && t <= 69890) || - (69927 <= t && t <= 69931) || - (69933 <= t && t <= 69940) || - 70003 === t || - (70016 <= t && t <= 70017) || - (70070 <= t && t <= 70078) || - (70090 <= t && t <= 70092) || - (70191 <= t && t <= 70193) || - 70196 === t || - (70198 <= t && t <= 70199) || - 70367 === t || - (70371 <= t && t <= 70378) || - (70400 <= t && t <= 70401) || - 70460 === t || - 70462 === t || - 70464 === t || - 70487 === t || - (70502 <= t && t <= 70508) || - (70512 <= t && t <= 70516) || - 70832 === t || - (70835 <= t && t <= 70840) || - 70842 === t || - 70845 === t || - (70847 <= t && t <= 70848) || - (70850 <= t && t <= 70851) || - 71087 === t || - (71090 <= t && t <= 71093) || - (71100 <= t && t <= 71101) || - (71103 <= t && t <= 71104) || - (71132 <= t && t <= 71133) || - (71219 <= t && t <= 71226) || - 71229 === t || - (71231 <= t && t <= 71232) || - 71339 === t || - 71341 === t || - (71344 <= t && t <= 71349) || - 71351 === t || - (71453 <= t && t <= 71455) || - (71458 <= t && t <= 71461) || - (71463 <= t && t <= 71467) || - (92912 <= t && t <= 92916) || - (92976 <= t && t <= 92982) || - (94095 <= t && t <= 94098) || - (113821 <= t && t <= 113822) || - 119141 === t || - (119143 <= t && t <= 119145) || - (119150 <= t && t <= 119154) || - (119163 <= t && t <= 119170) || - (119173 <= t && t <= 119179) || - (119210 <= t && t <= 119213) || - (119362 <= t && t <= 119364) || - (121344 <= t && t <= 121398) || - (121403 <= t && t <= 121452) || - 121461 === t || - 121476 === t || - (121499 <= t && t <= 121503) || - (121505 <= t && t <= 121519) || - (125136 <= t && t <= 125142) || - (917760 <= t && t <= 917999) - ? 3 - : 127462 <= t && t <= 127487 - ? 4 - : 127995 <= t && t <= 127999 - ? 12 - : 2307 === t || - 2363 === t || - (2366 <= t && t <= 2368) || - (2377 <= t && t <= 2380) || - (2382 <= t && t <= 2383) || - (2434 <= t && t <= 2435) || - (2495 <= t && t <= 2496) || - (2503 <= t && t <= 2504) || - (2507 <= t && t <= 2508) || - 2563 === t || - (2622 <= t && t <= 2624) || - 2691 === t || - (2750 <= t && t <= 2752) || - 2761 === t || - (2763 <= t && t <= 2764) || - (2818 <= t && t <= 2819) || - 2880 === t || - (2887 <= t && t <= 2888) || - (2891 <= t && t <= 2892) || - 3007 === t || - (3009 <= t && t <= 3010) || - (3014 <= t && t <= 3016) || - (3018 <= t && t <= 3020) || - (3073 <= t && t <= 3075) || - (3137 <= t && t <= 3140) || - (3202 <= t && t <= 3203) || - 3262 === t || - (3264 <= t && t <= 3265) || - (3267 <= t && t <= 3268) || - (3271 <= t && t <= 3272) || - (3274 <= t && t <= 3275) || - (3330 <= t && t <= 3331) || - (3391 <= t && t <= 3392) || - (3398 <= t && t <= 3400) || - (3402 <= t && t <= 3404) || - (3458 <= t && t <= 3459) || - (3536 <= t && t <= 3537) || - (3544 <= t && t <= 3550) || - (3570 <= t && t <= 3571) || - 3635 === t || - 3763 === t || - (3902 <= t && t <= 3903) || - 3967 === t || - 4145 === t || - (4155 <= t && t <= 4156) || - (4182 <= t && t <= 4183) || - 4228 === t || - 6070 === t || - (6078 <= t && t <= 6085) || - (6087 <= t && t <= 6088) || - (6435 <= t && t <= 6438) || - (6441 <= t && t <= 6443) || - (6448 <= t && t <= 6449) || - (6451 <= t && t <= 6456) || - (6681 <= t && t <= 6682) || - 6741 === t || - 6743 === t || - (6765 <= t && t <= 6770) || - 6916 === t || - 6965 === t || - 6971 === t || - (6973 <= t && t <= 6977) || - (6979 <= t && t <= 6980) || - 7042 === t || - 7073 === t || - (7078 <= t && t <= 7079) || - 7082 === t || - 7143 === t || - (7146 <= t && t <= 7148) || - 7150 === t || - (7154 <= t && t <= 7155) || - (7204 <= t && t <= 7211) || - (7220 <= t && t <= 7221) || - 7393 === t || - (7410 <= t && t <= 7411) || - (43043 <= t && t <= 43044) || - 43047 === t || - (43136 <= t && t <= 43137) || - (43188 <= t && t <= 43203) || - (43346 <= t && t <= 43347) || - 43395 === t || - (43444 <= t && t <= 43445) || - (43450 <= t && t <= 43451) || - (43453 <= t && t <= 43456) || - (43567 <= t && t <= 43568) || - (43571 <= t && t <= 43572) || - 43597 === t || - 43755 === t || - (43758 <= t && t <= 43759) || - 43765 === t || - (44003 <= t && t <= 44004) || - (44006 <= t && t <= 44007) || - (44009 <= t && t <= 44010) || - 44012 === t || - 69632 === t || - 69634 === t || - 69762 === t || - (69808 <= t && t <= 69810) || - (69815 <= t && t <= 69816) || - 69932 === t || - 70018 === t || - (70067 <= t && t <= 70069) || - (70079 <= t && t <= 70080) || - (70188 <= t && t <= 70190) || - (70194 <= t && t <= 70195) || - 70197 === t || - (70368 <= t && t <= 70370) || - (70402 <= t && t <= 70403) || - 70463 === t || - (70465 <= t && t <= 70468) || - (70471 <= t && t <= 70472) || - (70475 <= t && t <= 70477) || - (70498 <= t && t <= 70499) || - (70833 <= t && t <= 70834) || - 70841 === t || - (70843 <= t && t <= 70844) || - 70846 === t || - 70849 === t || - (71088 <= t && t <= 71089) || - (71096 <= t && t <= 71099) || - 71102 === t || - (71216 <= t && t <= 71218) || - (71227 <= t && t <= 71228) || - 71230 === t || - 71340 === t || - (71342 <= t && t <= 71343) || - 71350 === t || - (71456 <= t && t <= 71457) || - 71462 === t || - (94033 <= t && t <= 94078) || - 119142 === t || - 119149 === t - ? 5 - : (4352 <= t && t <= 4447) || (43360 <= t && t <= 43388) - ? 6 - : (4448 <= t && t <= 4519) || (55216 <= t && t <= 55238) - ? 7 - : (4520 <= t && t <= 4607) || (55243 <= t && t <= 55291) - ? 8 - : 44032 === t || - 44060 === t || - 44088 === t || - 44116 === t || - 44144 === t || - 44172 === t || - 44200 === t || - 44228 === t || - 44256 === t || - 44284 === t || - 44312 === t || - 44340 === t || - 44368 === t || - 44396 === t || - 44424 === t || - 44452 === t || - 44480 === t || - 44508 === t || - 44536 === t || - 44564 === t || - 44592 === t || - 44620 === t || - 44648 === t || - 44676 === t || - 44704 === t || - 44732 === t || - 44760 === t || - 44788 === t || - 44816 === t || - 44844 === t || - 44872 === t || - 44900 === t || - 44928 === t || - 44956 === t || - 44984 === t || - 45012 === t || - 45040 === t || - 45068 === t || - 45096 === t || - 45124 === t || - 45152 === t || - 45180 === t || - 45208 === t || - 45236 === t || - 45264 === t || - 45292 === t || - 45320 === t || - 45348 === t || - 45376 === t || - 45404 === t || - 45432 === t || - 45460 === t || - 45488 === t || - 45516 === t || - 45544 === t || - 45572 === t || - 45600 === t || - 45628 === t || - 45656 === t || - 45684 === t || - 45712 === t || - 45740 === t || - 45768 === t || - 45796 === t || - 45824 === t || - 45852 === t || - 45880 === t || - 45908 === t || - 45936 === t || - 45964 === t || - 45992 === t || - 46020 === t || - 46048 === t || - 46076 === t || - 46104 === t || - 46132 === t || - 46160 === t || - 46188 === t || - 46216 === t || - 46244 === t || - 46272 === t || - 46300 === t || - 46328 === t || - 46356 === t || - 46384 === t || - 46412 === t || - 46440 === t || - 46468 === t || - 46496 === t || - 46524 === t || - 46552 === t || - 46580 === t || - 46608 === t || - 46636 === t || - 46664 === t || - 46692 === t || - 46720 === t || - 46748 === t || - 46776 === t || - 46804 === t || - 46832 === t || - 46860 === t || - 46888 === t || - 46916 === t || - 46944 === t || - 46972 === t || - 47e3 === t || - 47028 === t || - 47056 === t || - 47084 === t || - 47112 === t || - 47140 === t || - 47168 === t || - 47196 === t || - 47224 === t || - 47252 === t || - 47280 === t || - 47308 === t || - 47336 === t || - 47364 === t || - 47392 === t || - 47420 === t || - 47448 === t || - 47476 === t || - 47504 === t || - 47532 === t || - 47560 === t || - 47588 === t || - 47616 === t || - 47644 === t || - 47672 === t || - 47700 === t || - 47728 === t || - 47756 === t || - 47784 === t || - 47812 === t || - 47840 === t || - 47868 === t || - 47896 === t || - 47924 === t || - 47952 === t || - 47980 === t || - 48008 === t || - 48036 === t || - 48064 === t || - 48092 === t || - 48120 === t || - 48148 === t || - 48176 === t || - 48204 === t || - 48232 === t || - 48260 === t || - 48288 === t || - 48316 === t || - 48344 === t || - 48372 === t || - 48400 === t || - 48428 === t || - 48456 === t || - 48484 === t || - 48512 === t || - 48540 === t || - 48568 === t || - 48596 === t || - 48624 === t || - 48652 === t || - 48680 === t || - 48708 === t || - 48736 === t || - 48764 === t || - 48792 === t || - 48820 === t || - 48848 === t || - 48876 === t || - 48904 === t || - 48932 === t || - 48960 === t || - 48988 === t || - 49016 === t || - 49044 === t || - 49072 === t || - 49100 === t || - 49128 === t || - 49156 === t || - 49184 === t || - 49212 === t || - 49240 === t || - 49268 === t || - 49296 === t || - 49324 === t || - 49352 === t || - 49380 === t || - 49408 === t || - 49436 === t || - 49464 === t || - 49492 === t || - 49520 === t || - 49548 === t || - 49576 === t || - 49604 === t || - 49632 === t || - 49660 === t || - 49688 === t || - 49716 === t || - 49744 === t || - 49772 === t || - 49800 === t || - 49828 === t || - 49856 === t || - 49884 === t || - 49912 === t || - 49940 === t || - 49968 === t || - 49996 === t || - 50024 === t || - 50052 === t || - 50080 === t || - 50108 === t || - 50136 === t || - 50164 === t || - 50192 === t || - 50220 === t || - 50248 === t || - 50276 === t || - 50304 === t || - 50332 === t || - 50360 === t || - 50388 === t || - 50416 === t || - 50444 === t || - 50472 === t || - 50500 === t || - 50528 === t || - 50556 === t || - 50584 === t || - 50612 === t || - 50640 === t || - 50668 === t || - 50696 === t || - 50724 === t || - 50752 === t || - 50780 === t || - 50808 === t || - 50836 === t || - 50864 === t || - 50892 === t || - 50920 === t || - 50948 === t || - 50976 === t || - 51004 === t || - 51032 === t || - 51060 === t || - 51088 === t || - 51116 === t || - 51144 === t || - 51172 === t || - 51200 === t || - 51228 === t || - 51256 === t || - 51284 === t || - 51312 === t || - 51340 === t || - 51368 === t || - 51396 === t || - 51424 === t || - 51452 === t || - 51480 === t || - 51508 === t || - 51536 === t || - 51564 === t || - 51592 === t || - 51620 === t || - 51648 === t || - 51676 === t || - 51704 === t || - 51732 === t || - 51760 === t || - 51788 === t || - 51816 === t || - 51844 === t || - 51872 === t || - 51900 === t || - 51928 === t || - 51956 === t || - 51984 === t || - 52012 === t || - 52040 === t || - 52068 === t || - 52096 === t || - 52124 === t || - 52152 === t || - 52180 === t || - 52208 === t || - 52236 === t || - 52264 === t || - 52292 === t || - 52320 === t || - 52348 === t || - 52376 === t || - 52404 === t || - 52432 === t || - 52460 === t || - 52488 === t || - 52516 === t || - 52544 === t || - 52572 === t || - 52600 === t || - 52628 === t || - 52656 === t || - 52684 === t || - 52712 === t || - 52740 === t || - 52768 === t || - 52796 === t || - 52824 === t || - 52852 === t || - 52880 === t || - 52908 === t || - 52936 === t || - 52964 === t || - 52992 === t || - 53020 === t || - 53048 === t || - 53076 === t || - 53104 === t || - 53132 === t || - 53160 === t || - 53188 === t || - 53216 === t || - 53244 === t || - 53272 === t || - 53300 === t || - 53328 === t || - 53356 === t || - 53384 === t || - 53412 === t || - 53440 === t || - 53468 === t || - 53496 === t || - 53524 === t || - 53552 === t || - 53580 === t || - 53608 === t || - 53636 === t || - 53664 === t || - 53692 === t || - 53720 === t || - 53748 === t || - 53776 === t || - 53804 === t || - 53832 === t || - 53860 === t || - 53888 === t || - 53916 === t || - 53944 === t || - 53972 === t || - 54e3 === t || - 54028 === t || - 54056 === t || - 54084 === t || - 54112 === t || - 54140 === t || - 54168 === t || - 54196 === t || - 54224 === t || - 54252 === t || - 54280 === t || - 54308 === t || - 54336 === t || - 54364 === t || - 54392 === t || - 54420 === t || - 54448 === t || - 54476 === t || - 54504 === t || - 54532 === t || - 54560 === t || - 54588 === t || - 54616 === t || - 54644 === t || - 54672 === t || - 54700 === t || - 54728 === t || - 54756 === t || - 54784 === t || - 54812 === t || - 54840 === t || - 54868 === t || - 54896 === t || - 54924 === t || - 54952 === t || - 54980 === t || - 55008 === t || - 55036 === t || - 55064 === t || - 55092 === t || - 55120 === t || - 55148 === t || - 55176 === t - ? 9 - : (44033 <= t && t <= 44059) || - (44061 <= t && t <= 44087) || - (44089 <= t && t <= 44115) || - (44117 <= t && t <= 44143) || - (44145 <= t && t <= 44171) || - (44173 <= t && t <= 44199) || - (44201 <= t && t <= 44227) || - (44229 <= t && t <= 44255) || - (44257 <= t && t <= 44283) || - (44285 <= t && t <= 44311) || - (44313 <= t && t <= 44339) || - (44341 <= t && t <= 44367) || - (44369 <= t && t <= 44395) || - (44397 <= t && t <= 44423) || - (44425 <= t && t <= 44451) || - (44453 <= t && t <= 44479) || - (44481 <= t && t <= 44507) || - (44509 <= t && t <= 44535) || - (44537 <= t && t <= 44563) || - (44565 <= t && t <= 44591) || - (44593 <= t && t <= 44619) || - (44621 <= t && t <= 44647) || - (44649 <= t && t <= 44675) || - (44677 <= t && t <= 44703) || - (44705 <= t && t <= 44731) || - (44733 <= t && t <= 44759) || - (44761 <= t && t <= 44787) || - (44789 <= t && t <= 44815) || - (44817 <= t && t <= 44843) || - (44845 <= t && t <= 44871) || - (44873 <= t && t <= 44899) || - (44901 <= t && t <= 44927) || - (44929 <= t && t <= 44955) || - (44957 <= t && t <= 44983) || - (44985 <= t && t <= 45011) || - (45013 <= t && t <= 45039) || - (45041 <= t && t <= 45067) || - (45069 <= t && t <= 45095) || - (45097 <= t && t <= 45123) || - (45125 <= t && t <= 45151) || - (45153 <= t && t <= 45179) || - (45181 <= t && t <= 45207) || - (45209 <= t && t <= 45235) || - (45237 <= t && t <= 45263) || - (45265 <= t && t <= 45291) || - (45293 <= t && t <= 45319) || - (45321 <= t && t <= 45347) || - (45349 <= t && t <= 45375) || - (45377 <= t && t <= 45403) || - (45405 <= t && t <= 45431) || - (45433 <= t && t <= 45459) || - (45461 <= t && t <= 45487) || - (45489 <= t && t <= 45515) || - (45517 <= t && t <= 45543) || - (45545 <= t && t <= 45571) || - (45573 <= t && t <= 45599) || - (45601 <= t && t <= 45627) || - (45629 <= t && t <= 45655) || - (45657 <= t && t <= 45683) || - (45685 <= t && t <= 45711) || - (45713 <= t && t <= 45739) || - (45741 <= t && t <= 45767) || - (45769 <= t && t <= 45795) || - (45797 <= t && t <= 45823) || - (45825 <= t && t <= 45851) || - (45853 <= t && t <= 45879) || - (45881 <= t && t <= 45907) || - (45909 <= t && t <= 45935) || - (45937 <= t && t <= 45963) || - (45965 <= t && t <= 45991) || - (45993 <= t && t <= 46019) || - (46021 <= t && t <= 46047) || - (46049 <= t && t <= 46075) || - (46077 <= t && t <= 46103) || - (46105 <= t && t <= 46131) || - (46133 <= t && t <= 46159) || - (46161 <= t && t <= 46187) || - (46189 <= t && t <= 46215) || - (46217 <= t && t <= 46243) || - (46245 <= t && t <= 46271) || - (46273 <= t && t <= 46299) || - (46301 <= t && t <= 46327) || - (46329 <= t && t <= 46355) || - (46357 <= t && t <= 46383) || - (46385 <= t && t <= 46411) || - (46413 <= t && t <= 46439) || - (46441 <= t && t <= 46467) || - (46469 <= t && t <= 46495) || - (46497 <= t && t <= 46523) || - (46525 <= t && t <= 46551) || - (46553 <= t && t <= 46579) || - (46581 <= t && t <= 46607) || - (46609 <= t && t <= 46635) || - (46637 <= t && t <= 46663) || - (46665 <= t && t <= 46691) || - (46693 <= t && t <= 46719) || - (46721 <= t && t <= 46747) || - (46749 <= t && t <= 46775) || - (46777 <= t && t <= 46803) || - (46805 <= t && t <= 46831) || - (46833 <= t && t <= 46859) || - (46861 <= t && t <= 46887) || - (46889 <= t && t <= 46915) || - (46917 <= t && t <= 46943) || - (46945 <= t && t <= 46971) || - (46973 <= t && t <= 46999) || - (47001 <= t && t <= 47027) || - (47029 <= t && t <= 47055) || - (47057 <= t && t <= 47083) || - (47085 <= t && t <= 47111) || - (47113 <= t && t <= 47139) || - (47141 <= t && t <= 47167) || - (47169 <= t && t <= 47195) || - (47197 <= t && t <= 47223) || - (47225 <= t && t <= 47251) || - (47253 <= t && t <= 47279) || - (47281 <= t && t <= 47307) || - (47309 <= t && t <= 47335) || - (47337 <= t && t <= 47363) || - (47365 <= t && t <= 47391) || - (47393 <= t && t <= 47419) || - (47421 <= t && t <= 47447) || - (47449 <= t && t <= 47475) || - (47477 <= t && t <= 47503) || - (47505 <= t && t <= 47531) || - (47533 <= t && t <= 47559) || - (47561 <= t && t <= 47587) || - (47589 <= t && t <= 47615) || - (47617 <= t && t <= 47643) || - (47645 <= t && t <= 47671) || - (47673 <= t && t <= 47699) || - (47701 <= t && t <= 47727) || - (47729 <= t && t <= 47755) || - (47757 <= t && t <= 47783) || - (47785 <= t && t <= 47811) || - (47813 <= t && t <= 47839) || - (47841 <= t && t <= 47867) || - (47869 <= t && t <= 47895) || - (47897 <= t && t <= 47923) || - (47925 <= t && t <= 47951) || - (47953 <= t && t <= 47979) || - (47981 <= t && t <= 48007) || - (48009 <= t && t <= 48035) || - (48037 <= t && t <= 48063) || - (48065 <= t && t <= 48091) || - (48093 <= t && t <= 48119) || - (48121 <= t && t <= 48147) || - (48149 <= t && t <= 48175) || - (48177 <= t && t <= 48203) || - (48205 <= t && t <= 48231) || - (48233 <= t && t <= 48259) || - (48261 <= t && t <= 48287) || - (48289 <= t && t <= 48315) || - (48317 <= t && t <= 48343) || - (48345 <= t && t <= 48371) || - (48373 <= t && t <= 48399) || - (48401 <= t && t <= 48427) || - (48429 <= t && t <= 48455) || - (48457 <= t && t <= 48483) || - (48485 <= t && t <= 48511) || - (48513 <= t && t <= 48539) || - (48541 <= t && t <= 48567) || - (48569 <= t && t <= 48595) || - (48597 <= t && t <= 48623) || - (48625 <= t && t <= 48651) || - (48653 <= t && t <= 48679) || - (48681 <= t && t <= 48707) || - (48709 <= t && t <= 48735) || - (48737 <= t && t <= 48763) || - (48765 <= t && t <= 48791) || - (48793 <= t && t <= 48819) || - (48821 <= t && t <= 48847) || - (48849 <= t && t <= 48875) || - (48877 <= t && t <= 48903) || - (48905 <= t && t <= 48931) || - (48933 <= t && t <= 48959) || - (48961 <= t && t <= 48987) || - (48989 <= t && t <= 49015) || - (49017 <= t && t <= 49043) || - (49045 <= t && t <= 49071) || - (49073 <= t && t <= 49099) || - (49101 <= t && t <= 49127) || - (49129 <= t && t <= 49155) || - (49157 <= t && t <= 49183) || - (49185 <= t && t <= 49211) || - (49213 <= t && t <= 49239) || - (49241 <= t && t <= 49267) || - (49269 <= t && t <= 49295) || - (49297 <= t && t <= 49323) || - (49325 <= t && t <= 49351) || - (49353 <= t && t <= 49379) || - (49381 <= t && t <= 49407) || - (49409 <= t && t <= 49435) || - (49437 <= t && t <= 49463) || - (49465 <= t && t <= 49491) || - (49493 <= t && t <= 49519) || - (49521 <= t && t <= 49547) || - (49549 <= t && t <= 49575) || - (49577 <= t && t <= 49603) || - (49605 <= t && t <= 49631) || - (49633 <= t && t <= 49659) || - (49661 <= t && t <= 49687) || - (49689 <= t && t <= 49715) || - (49717 <= t && t <= 49743) || - (49745 <= t && t <= 49771) || - (49773 <= t && t <= 49799) || - (49801 <= t && t <= 49827) || - (49829 <= t && t <= 49855) || - (49857 <= t && t <= 49883) || - (49885 <= t && t <= 49911) || - (49913 <= t && t <= 49939) || - (49941 <= t && t <= 49967) || - (49969 <= t && t <= 49995) || - (49997 <= t && t <= 50023) || - (50025 <= t && t <= 50051) || - (50053 <= t && t <= 50079) || - (50081 <= t && t <= 50107) || - (50109 <= t && t <= 50135) || - (50137 <= t && t <= 50163) || - (50165 <= t && t <= 50191) || - (50193 <= t && t <= 50219) || - (50221 <= t && t <= 50247) || - (50249 <= t && t <= 50275) || - (50277 <= t && t <= 50303) || - (50305 <= t && t <= 50331) || - (50333 <= t && t <= 50359) || - (50361 <= t && t <= 50387) || - (50389 <= t && t <= 50415) || - (50417 <= t && t <= 50443) || - (50445 <= t && t <= 50471) || - (50473 <= t && t <= 50499) || - (50501 <= t && t <= 50527) || - (50529 <= t && t <= 50555) || - (50557 <= t && t <= 50583) || - (50585 <= t && t <= 50611) || - (50613 <= t && t <= 50639) || - (50641 <= t && t <= 50667) || - (50669 <= t && t <= 50695) || - (50697 <= t && t <= 50723) || - (50725 <= t && t <= 50751) || - (50753 <= t && t <= 50779) || - (50781 <= t && t <= 50807) || - (50809 <= t && t <= 50835) || - (50837 <= t && t <= 50863) || - (50865 <= t && t <= 50891) || - (50893 <= t && t <= 50919) || - (50921 <= t && t <= 50947) || - (50949 <= t && t <= 50975) || - (50977 <= t && t <= 51003) || - (51005 <= t && t <= 51031) || - (51033 <= t && t <= 51059) || - (51061 <= t && t <= 51087) || - (51089 <= t && t <= 51115) || - (51117 <= t && t <= 51143) || - (51145 <= t && t <= 51171) || - (51173 <= t && t <= 51199) || - (51201 <= t && t <= 51227) || - (51229 <= t && t <= 51255) || - (51257 <= t && t <= 51283) || - (51285 <= t && t <= 51311) || - (51313 <= t && t <= 51339) || - (51341 <= t && t <= 51367) || - (51369 <= t && t <= 51395) || - (51397 <= t && t <= 51423) || - (51425 <= t && t <= 51451) || - (51453 <= t && t <= 51479) || - (51481 <= t && t <= 51507) || - (51509 <= t && t <= 51535) || - (51537 <= t && t <= 51563) || - (51565 <= t && t <= 51591) || - (51593 <= t && t <= 51619) || - (51621 <= t && t <= 51647) || - (51649 <= t && t <= 51675) || - (51677 <= t && t <= 51703) || - (51705 <= t && t <= 51731) || - (51733 <= t && t <= 51759) || - (51761 <= t && t <= 51787) || - (51789 <= t && t <= 51815) || - (51817 <= t && t <= 51843) || - (51845 <= t && t <= 51871) || - (51873 <= t && t <= 51899) || - (51901 <= t && t <= 51927) || - (51929 <= t && t <= 51955) || - (51957 <= t && t <= 51983) || - (51985 <= t && t <= 52011) || - (52013 <= t && t <= 52039) || - (52041 <= t && t <= 52067) || - (52069 <= t && t <= 52095) || - (52097 <= t && t <= 52123) || - (52125 <= t && t <= 52151) || - (52153 <= t && t <= 52179) || - (52181 <= t && t <= 52207) || - (52209 <= t && t <= 52235) || - (52237 <= t && t <= 52263) || - (52265 <= t && t <= 52291) || - (52293 <= t && t <= 52319) || - (52321 <= t && t <= 52347) || - (52349 <= t && t <= 52375) || - (52377 <= t && t <= 52403) || - (52405 <= t && t <= 52431) || - (52433 <= t && t <= 52459) || - (52461 <= t && t <= 52487) || - (52489 <= t && t <= 52515) || - (52517 <= t && t <= 52543) || - (52545 <= t && t <= 52571) || - (52573 <= t && t <= 52599) || - (52601 <= t && t <= 52627) || - (52629 <= t && t <= 52655) || - (52657 <= t && t <= 52683) || - (52685 <= t && t <= 52711) || - (52713 <= t && t <= 52739) || - (52741 <= t && t <= 52767) || - (52769 <= t && t <= 52795) || - (52797 <= t && t <= 52823) || - (52825 <= t && t <= 52851) || - (52853 <= t && t <= 52879) || - (52881 <= t && t <= 52907) || - (52909 <= t && t <= 52935) || - (52937 <= t && t <= 52963) || - (52965 <= t && t <= 52991) || - (52993 <= t && t <= 53019) || - (53021 <= t && t <= 53047) || - (53049 <= t && t <= 53075) || - (53077 <= t && t <= 53103) || - (53105 <= t && t <= 53131) || - (53133 <= t && t <= 53159) || - (53161 <= t && t <= 53187) || - (53189 <= t && t <= 53215) || - (53217 <= t && t <= 53243) || - (53245 <= t && t <= 53271) || - (53273 <= t && t <= 53299) || - (53301 <= t && t <= 53327) || - (53329 <= t && t <= 53355) || - (53357 <= t && t <= 53383) || - (53385 <= t && t <= 53411) || - (53413 <= t && t <= 53439) || - (53441 <= t && t <= 53467) || - (53469 <= t && t <= 53495) || - (53497 <= t && t <= 53523) || - (53525 <= t && t <= 53551) || - (53553 <= t && t <= 53579) || - (53581 <= t && t <= 53607) || - (53609 <= t && t <= 53635) || - (53637 <= t && t <= 53663) || - (53665 <= t && t <= 53691) || - (53693 <= t && t <= 53719) || - (53721 <= t && t <= 53747) || - (53749 <= t && t <= 53775) || - (53777 <= t && t <= 53803) || - (53805 <= t && t <= 53831) || - (53833 <= t && t <= 53859) || - (53861 <= t && t <= 53887) || - (53889 <= t && t <= 53915) || - (53917 <= t && t <= 53943) || - (53945 <= t && t <= 53971) || - (53973 <= t && t <= 53999) || - (54001 <= t && t <= 54027) || - (54029 <= t && t <= 54055) || - (54057 <= t && t <= 54083) || - (54085 <= t && t <= 54111) || - (54113 <= t && t <= 54139) || - (54141 <= t && t <= 54167) || - (54169 <= t && t <= 54195) || - (54197 <= t && t <= 54223) || - (54225 <= t && t <= 54251) || - (54253 <= t && t <= 54279) || - (54281 <= t && t <= 54307) || - (54309 <= t && t <= 54335) || - (54337 <= t && t <= 54363) || - (54365 <= t && t <= 54391) || - (54393 <= t && t <= 54419) || - (54421 <= t && t <= 54447) || - (54449 <= t && t <= 54475) || - (54477 <= t && t <= 54503) || - (54505 <= t && t <= 54531) || - (54533 <= t && t <= 54559) || - (54561 <= t && t <= 54587) || - (54589 <= t && t <= 54615) || - (54617 <= t && t <= 54643) || - (54645 <= t && t <= 54671) || - (54673 <= t && t <= 54699) || - (54701 <= t && t <= 54727) || - (54729 <= t && t <= 54755) || - (54757 <= t && t <= 54783) || - (54785 <= t && t <= 54811) || - (54813 <= t && t <= 54839) || - (54841 <= t && t <= 54867) || - (54869 <= t && t <= 54895) || - (54897 <= t && t <= 54923) || - (54925 <= t && t <= 54951) || - (54953 <= t && t <= 54979) || - (54981 <= t && t <= 55007) || - (55009 <= t && t <= 55035) || - (55037 <= t && t <= 55063) || - (55065 <= t && t <= 55091) || - (55093 <= t && t <= 55119) || - (55121 <= t && t <= 55147) || - (55149 <= t && t <= 55175) || - (55177 <= t && t <= 55203) - ? 10 - : 11; - } - var s = function(t) { - if (/^[\x20-\xFF]*$/.test(t)) return t; - const i = []; - let s, - a = 0; - for (; (s = e(t, a)) < t.length; ) i.push(t.slice(a, s)), (a = s); - return a < t.length && i.push(t.slice(a)), i; - }; - class a { - constructor(t, e) { - (this.type = t), (this.value = e); - } - } - class o { - constructor(t) { - (this.s = s(t)), (this.pos = 0); - } - end() { - return this.pos >= this.s.length; - } - get() { - return this.pos < this.s.length ? this.s[this.pos++] : null; - } - peek() { - return this.s[this.pos]; - } - scan(t) { - let e; - return ( - (e = - 'string' == typeof this.s - ? t.exec(this.s.slice(this.pos)) - : t.exec(this.s.slice(this.pos).join(''))), - e ? ((this.pos += e[0].length), e[0]) : null - ); - } - isWhiteSpace() { - return /[ \f\n\r\t\v\xA0\u2028\u2029]/.test(this.s[this.pos]); - } - makeToken() { - if (this.end()) return null; - if (this.isWhiteSpace()) return this.get(), new a('space'); - let t = null; - if ('\\' === this.peek()) { - if ((this.get(), !this.end())) { - let e = this.scan(/^[a-zA-Z*]+/); - 'bgroup' === e - ? (t = new a('{')) - : 'egroup' === e - ? (t = new a('}')) - : (e || (e = this.get()), - (t = new a('command', e))); - } - } else if ('{' === this.peek() || '}' === this.peek()) - t = new a(this.get()); - else if ('#' === this.peek()) { - if ((this.get(), !this.end())) { - let e = !1, - i = this.peek(); - if ( - /[0-9?]/.test(i) && - ((e = !0), this.pos + 1 < this.s.length) - ) { - const t = this.s[this.pos + 1]; - e = /[^0-9A-Za-z]/.test(t); - } - e - ? ((t = new a('#')), - (i = this.get()), - (t.value = - i >= '0' && i <= '9' ? parseInt(i) : '?')) - : (t = new a('literal', '#')); - } - } else - '~' === this.peek() - ? (this.get(), (t = new a('command', 'space'))) - : '$' === this.peek() - ? (this.get(), - '$' === this.peek() - ? (this.get(), (t = new a('$$'))) - : (t = new a('$'))) - : (t = new a('literal', this.get())); - return t; - } - } - var n = function(t) { - const e = [], - i = t.toString().split(/\r?\n/); - let s = '', - a = ''; - for (const t of i) { - (s += a), (a = ' '); - const e = t.match(/((?:\\%)|[^%])*/); - e && (s += e[0]); - } - const n = new o(s); - for (; !n.end(); ) { - const t = n.makeToken(); - t && e.push(t); - } - return e; - }, - r = { - 'AMS-Regular': { - 65: [0, 0.68889, 0, 0], - 66: [0, 0.68889, 0, 0], - 67: [0, 0.68889, 0, 0], - 68: [0, 0.68889, 0, 0], - 69: [0, 0.68889, 0, 0], - 70: [0, 0.68889, 0, 0], - 71: [0, 0.68889, 0, 0], - 72: [0, 0.68889, 0, 0], - 73: [0, 0.68889, 0, 0], - 74: [0.16667, 0.68889, 0, 0], - 75: [0, 0.68889, 0, 0], - 76: [0, 0.68889, 0, 0], - 77: [0, 0.68889, 0, 0], - 78: [0, 0.68889, 0, 0], - 79: [0.16667, 0.68889, 0, 0], - 80: [0, 0.68889, 0, 0], - 81: [0.16667, 0.68889, 0, 0], - 82: [0, 0.68889, 0, 0], - 83: [0, 0.68889, 0, 0], - 84: [0, 0.68889, 0, 0], - 85: [0, 0.68889, 0, 0], - 86: [0, 0.68889, 0, 0], - 87: [0, 0.68889, 0, 0], - 88: [0, 0.68889, 0, 0], - 89: [0, 0.68889, 0, 0], - 90: [0, 0.68889, 0, 0], - 107: [0, 0.68889, 0, 0], - 165: [0, 0.675, 0.025, 0], - 174: [0.15559, 0.69224, 0, 0], - 240: [0, 0.68889, 0, 0], - 295: [0, 0.68889, 0, 0], - 710: [0, 0.825, 0, 0], - 732: [0, 0.9, 0, 0], - 770: [0, 0.825, 0, 0], - 771: [0, 0.9, 0, 0], - 989: [0.08167, 0.58167, 0, 0], - 1008: [0, 0.43056, 0.04028, 0], - 8245: [0, 0.54986, 0, 0], - 8463: [0, 0.68889, 0, 0], - 8487: [0, 0.68889, 0, 0], - 8498: [0, 0.68889, 0, 0], - 8502: [0, 0.68889, 0, 0], - 8503: [0, 0.68889, 0, 0], - 8504: [0, 0.68889, 0, 0], - 8513: [0, 0.68889, 0, 0], - 8592: [-0.03598, 0.46402, 0, 0], - 8594: [-0.03598, 0.46402, 0, 0], - 8602: [-0.13313, 0.36687, 0, 0], - 8603: [-0.13313, 0.36687, 0, 0], - 8606: [0.01354, 0.52239, 0, 0], - 8608: [0.01354, 0.52239, 0, 0], - 8610: [0.01354, 0.52239, 0, 0], - 8611: [0.01354, 0.52239, 0, 0], - 8619: [0, 0.54986, 0, 0], - 8620: [0, 0.54986, 0, 0], - 8621: [-0.13313, 0.37788, 0, 0], - 8622: [-0.13313, 0.36687, 0, 0], - 8624: [0, 0.69224, 0, 0], - 8625: [0, 0.69224, 0, 0], - 8630: [0, 0.43056, 0, 0], - 8631: [0, 0.43056, 0, 0], - 8634: [0.08198, 0.58198, 0, 0], - 8635: [0.08198, 0.58198, 0, 0], - 8638: [0.19444, 0.69224, 0, 0], - 8639: [0.19444, 0.69224, 0, 0], - 8642: [0.19444, 0.69224, 0, 0], - 8643: [0.19444, 0.69224, 0, 0], - 8644: [0.1808, 0.675, 0, 0], - 8646: [0.1808, 0.675, 0, 0], - 8647: [0.1808, 0.675, 0, 0], - 8648: [0.19444, 0.69224, 0, 0], - 8649: [0.1808, 0.675, 0, 0], - 8650: [0.19444, 0.69224, 0, 0], - 8651: [0.01354, 0.52239, 0, 0], - 8652: [0.01354, 0.52239, 0, 0], - 8653: [-0.13313, 0.36687, 0, 0], - 8654: [-0.13313, 0.36687, 0, 0], - 8655: [-0.13313, 0.36687, 0, 0], - 8666: [0.13667, 0.63667, 0, 0], - 8667: [0.13667, 0.63667, 0, 0], - 8669: [-0.13313, 0.37788, 0, 0], - 8672: [-0.064, 0.437, 0, 0], - 8674: [-0.064, 0.437, 0, 0], - 8705: [0, 0.825, 0, 0], - 8708: [0, 0.68889, 0, 0], - 8709: [0.08167, 0.58167, 0, 0], - 8717: [0, 0.43056, 0, 0], - 8722: [-0.03598, 0.46402, 0, 0], - 8724: [0.08198, 0.69224, 0, 0], - 8726: [0.08167, 0.58167, 0, 0], - 8733: [0, 0.69224, 0, 0], - 8736: [0, 0.69224, 0, 0], - 8737: [0, 0.69224, 0, 0], - 8738: [0.03517, 0.52239, 0, 0], - 8739: [0.08167, 0.58167, 0, 0], - 8740: [0.25142, 0.74111, 0, 0], - 8741: [0.08167, 0.58167, 0, 0], - 8742: [0.25142, 0.74111, 0, 0], - 8756: [0, 0.69224, 0, 0], - 8757: [0, 0.69224, 0, 0], - 8764: [-0.13313, 0.36687, 0, 0], - 8765: [-0.13313, 0.37788, 0, 0], - 8769: [-0.13313, 0.36687, 0, 0], - 8770: [-0.03625, 0.46375, 0, 0], - 8774: [0.30274, 0.79383, 0, 0], - 8776: [-0.01688, 0.48312, 0, 0], - 8778: [0.08167, 0.58167, 0, 0], - 8782: [0.06062, 0.54986, 0, 0], - 8783: [0.06062, 0.54986, 0, 0], - 8785: [0.08198, 0.58198, 0, 0], - 8786: [0.08198, 0.58198, 0, 0], - 8787: [0.08198, 0.58198, 0, 0], - 8790: [0, 0.69224, 0, 0], - 8791: [0.22958, 0.72958, 0, 0], - 8796: [0.08198, 0.91667, 0, 0], - 8806: [0.25583, 0.75583, 0, 0], - 8807: [0.25583, 0.75583, 0, 0], - 8808: [0.25142, 0.75726, 0, 0], - 8809: [0.25142, 0.75726, 0, 0], - 8812: [0.25583, 0.75583, 0, 0], - 8814: [0.20576, 0.70576, 0, 0], - 8815: [0.20576, 0.70576, 0, 0], - 8816: [0.30274, 0.79383, 0, 0], - 8817: [0.30274, 0.79383, 0, 0], - 8818: [0.22958, 0.72958, 0, 0], - 8819: [0.22958, 0.72958, 0, 0], - 8822: [0.1808, 0.675, 0, 0], - 8823: [0.1808, 0.675, 0, 0], - 8828: [0.13667, 0.63667, 0, 0], - 8829: [0.13667, 0.63667, 0, 0], - 8830: [0.22958, 0.72958, 0, 0], - 8831: [0.22958, 0.72958, 0, 0], - 8832: [0.20576, 0.70576, 0, 0], - 8833: [0.20576, 0.70576, 0, 0], - 8840: [0.30274, 0.79383, 0, 0], - 8841: [0.30274, 0.79383, 0, 0], - 8842: [0.13597, 0.63597, 0, 0], - 8843: [0.13597, 0.63597, 0, 0], - 8847: [0.03517, 0.54986, 0, 0], - 8848: [0.03517, 0.54986, 0, 0], - 8858: [0.08198, 0.58198, 0, 0], - 8859: [0.08198, 0.58198, 0, 0], - 8861: [0.08198, 0.58198, 0, 0], - 8862: [0, 0.675, 0, 0], - 8863: [0, 0.675, 0, 0], - 8864: [0, 0.675, 0, 0], - 8865: [0, 0.675, 0, 0], - 8872: [0, 0.69224, 0, 0], - 8873: [0, 0.69224, 0, 0], - 8874: [0, 0.69224, 0, 0], - 8876: [0, 0.68889, 0, 0], - 8877: [0, 0.68889, 0, 0], - 8878: [0, 0.68889, 0, 0], - 8879: [0, 0.68889, 0, 0], - 8882: [0.03517, 0.54986, 0, 0], - 8883: [0.03517, 0.54986, 0, 0], - 8884: [0.13667, 0.63667, 0, 0], - 8885: [0.13667, 0.63667, 0, 0], - 8888: [0, 0.54986, 0, 0], - 8890: [0.19444, 0.43056, 0, 0], - 8891: [0.19444, 0.69224, 0, 0], - 8892: [0.19444, 0.69224, 0, 0], - 8901: [0, 0.54986, 0, 0], - 8903: [0.08167, 0.58167, 0, 0], - 8905: [0.08167, 0.58167, 0, 0], - 8906: [0.08167, 0.58167, 0, 0], - 8907: [0, 0.69224, 0, 0], - 8908: [0, 0.69224, 0, 0], - 8909: [-0.03598, 0.46402, 0, 0], - 8910: [0, 0.54986, 0, 0], - 8911: [0, 0.54986, 0, 0], - 8912: [0.03517, 0.54986, 0, 0], - 8913: [0.03517, 0.54986, 0, 0], - 8914: [0, 0.54986, 0, 0], - 8915: [0, 0.54986, 0, 0], - 8916: [0, 0.69224, 0, 0], - 8918: [0.0391, 0.5391, 0, 0], - 8919: [0.0391, 0.5391, 0, 0], - 8920: [0.03517, 0.54986, 0, 0], - 8921: [0.03517, 0.54986, 0, 0], - 8922: [0.38569, 0.88569, 0, 0], - 8923: [0.38569, 0.88569, 0, 0], - 8926: [0.13667, 0.63667, 0, 0], - 8927: [0.13667, 0.63667, 0, 0], - 8928: [0.30274, 0.79383, 0, 0], - 8929: [0.30274, 0.79383, 0, 0], - 8934: [0.23222, 0.74111, 0, 0], - 8935: [0.23222, 0.74111, 0, 0], - 8936: [0.23222, 0.74111, 0, 0], - 8937: [0.23222, 0.74111, 0, 0], - 8938: [0.20576, 0.70576, 0, 0], - 8939: [0.20576, 0.70576, 0, 0], - 8940: [0.30274, 0.79383, 0, 0], - 8941: [0.30274, 0.79383, 0, 0], - 8994: [0.19444, 0.69224, 0, 0], - 8995: [0.19444, 0.69224, 0, 0], - 9416: [0.15559, 0.69224, 0, 0], - 9484: [0, 0.69224, 0, 0], - 9488: [0, 0.69224, 0, 0], - 9492: [0, 0.37788, 0, 0], - 9496: [0, 0.37788, 0, 0], - 9585: [0.19444, 0.68889, 0, 0], - 9586: [0.19444, 0.74111, 0, 0], - 9632: [0, 0.675, 0, 0], - 9633: [0, 0.675, 0, 0], - 9650: [0, 0.54986, 0, 0], - 9651: [0, 0.54986, 0, 0], - 9654: [0.03517, 0.54986, 0, 0], - 9660: [0, 0.54986, 0, 0], - 9661: [0, 0.54986, 0, 0], - 9664: [0.03517, 0.54986, 0, 0], - 9674: [0.11111, 0.69224, 0, 0], - 9733: [0.19444, 0.69224, 0, 0], - 10003: [0, 0.69224, 0, 0], - 10016: [0, 0.69224, 0, 0], - 10731: [0.11111, 0.69224, 0, 0], - 10846: [0.19444, 0.75583, 0, 0], - 10877: [0.13667, 0.63667, 0, 0], - 10878: [0.13667, 0.63667, 0, 0], - 10885: [0.25583, 0.75583, 0, 0], - 10886: [0.25583, 0.75583, 0, 0], - 10887: [0.13597, 0.63597, 0, 0], - 10888: [0.13597, 0.63597, 0, 0], - 10889: [0.26167, 0.75726, 0, 0], - 10890: [0.26167, 0.75726, 0, 0], - 10891: [0.48256, 0.98256, 0, 0], - 10892: [0.48256, 0.98256, 0, 0], - 10901: [0.13667, 0.63667, 0, 0], - 10902: [0.13667, 0.63667, 0, 0], - 10933: [0.25142, 0.75726, 0, 0], - 10934: [0.25142, 0.75726, 0, 0], - 10935: [0.26167, 0.75726, 0, 0], - 10936: [0.26167, 0.75726, 0, 0], - 10937: [0.26167, 0.75726, 0, 0], - 10938: [0.26167, 0.75726, 0, 0], - 10949: [0.25583, 0.75583, 0, 0], - 10950: [0.25583, 0.75583, 0, 0], - 10955: [0.28481, 0.79383, 0, 0], - 10956: [0.28481, 0.79383, 0, 0], - 57350: [0.08167, 0.58167, 0, 0], - 57351: [0.08167, 0.58167, 0, 0], - 57352: [0.08167, 0.58167, 0, 0], - 57353: [0, 0.43056, 0.04028, 0], - 57356: [0.25142, 0.75726, 0, 0], - 57357: [0.25142, 0.75726, 0, 0], - 57358: [0.41951, 0.91951, 0, 0], - 57359: [0.30274, 0.79383, 0, 0], - 57360: [0.30274, 0.79383, 0, 0], - 57361: [0.41951, 0.91951, 0, 0], - 57366: [0.25142, 0.75726, 0, 0], - 57367: [0.25142, 0.75726, 0, 0], - 57368: [0.25142, 0.75726, 0, 0], - 57369: [0.25142, 0.75726, 0, 0], - 57370: [0.13597, 0.63597, 0, 0], - 57371: [0.13597, 0.63597, 0, 0], - }, - 'Caligraphic-Regular': { - 48: [0, 0.43056, 0, 0], - 49: [0, 0.43056, 0, 0], - 50: [0, 0.43056, 0, 0], - 51: [0.19444, 0.43056, 0, 0], - 52: [0.19444, 0.43056, 0, 0], - 53: [0.19444, 0.43056, 0, 0], - 54: [0, 0.64444, 0, 0], - 55: [0.19444, 0.43056, 0, 0], - 56: [0, 0.64444, 0, 0], - 57: [0.19444, 0.43056, 0, 0], - 65: [0, 0.68333, 0, 0.19445], - 66: [0, 0.68333, 0.03041, 0.13889], - 67: [0, 0.68333, 0.05834, 0.13889], - 68: [0, 0.68333, 0.02778, 0.08334], - 69: [0, 0.68333, 0.08944, 0.11111], - 70: [0, 0.68333, 0.09931, 0.11111], - 71: [0.09722, 0.68333, 0.0593, 0.11111], - 72: [0, 0.68333, 0.00965, 0.11111], - 73: [0, 0.68333, 0.07382, 0], - 74: [0.09722, 0.68333, 0.18472, 0.16667], - 75: [0, 0.68333, 0.01445, 0.05556], - 76: [0, 0.68333, 0, 0.13889], - 77: [0, 0.68333, 0, 0.13889], - 78: [0, 0.68333, 0.14736, 0.08334], - 79: [0, 0.68333, 0.02778, 0.11111], - 80: [0, 0.68333, 0.08222, 0.08334], - 81: [0.09722, 0.68333, 0, 0.11111], - 82: [0, 0.68333, 0, 0.08334], - 83: [0, 0.68333, 0.075, 0.13889], - 84: [0, 0.68333, 0.25417, 0], - 85: [0, 0.68333, 0.09931, 0.08334], - 86: [0, 0.68333, 0.08222, 0], - 87: [0, 0.68333, 0.08222, 0.08334], - 88: [0, 0.68333, 0.14643, 0.13889], - 89: [0.09722, 0.68333, 0.08222, 0.08334], - 90: [0, 0.68333, 0.07944, 0.13889], - }, - 'Fraktur-Regular': { - 33: [0, 0.69141, 0, 0], - 34: [0, 0.69141, 0, 0], - 38: [0, 0.69141, 0, 0], - 39: [0, 0.69141, 0, 0], - 40: [0.24982, 0.74947, 0, 0], - 41: [0.24982, 0.74947, 0, 0], - 42: [0, 0.62119, 0, 0], - 43: [0.08319, 0.58283, 0, 0], - 44: [0, 0.10803, 0, 0], - 45: [0.08319, 0.58283, 0, 0], - 46: [0, 0.10803, 0, 0], - 47: [0.24982, 0.74947, 0, 0], - 48: [0, 0.47534, 0, 0], - 49: [0, 0.47534, 0, 0], - 50: [0, 0.47534, 0, 0], - 51: [0.18906, 0.47534, 0, 0], - 52: [0.18906, 0.47534, 0, 0], - 53: [0.18906, 0.47534, 0, 0], - 54: [0, 0.69141, 0, 0], - 55: [0.18906, 0.47534, 0, 0], - 56: [0, 0.69141, 0, 0], - 57: [0.18906, 0.47534, 0, 0], - 58: [0, 0.47534, 0, 0], - 59: [0.12604, 0.47534, 0, 0], - 61: [-0.13099, 0.36866, 0, 0], - 63: [0, 0.69141, 0, 0], - 65: [0, 0.69141, 0, 0], - 66: [0, 0.69141, 0, 0], - 67: [0, 0.69141, 0, 0], - 68: [0, 0.69141, 0, 0], - 69: [0, 0.69141, 0, 0], - 70: [0.12604, 0.69141, 0, 0], - 71: [0, 0.69141, 0, 0], - 72: [0.06302, 0.69141, 0, 0], - 73: [0, 0.69141, 0, 0], - 74: [0.12604, 0.69141, 0, 0], - 75: [0, 0.69141, 0, 0], - 76: [0, 0.69141, 0, 0], - 77: [0, 0.69141, 0, 0], - 78: [0, 0.69141, 0, 0], - 79: [0, 0.69141, 0, 0], - 80: [0.18906, 0.69141, 0, 0], - 81: [0.03781, 0.69141, 0, 0], - 82: [0, 0.69141, 0, 0], - 83: [0, 0.69141, 0, 0], - 84: [0, 0.69141, 0, 0], - 85: [0, 0.69141, 0, 0], - 86: [0, 0.69141, 0, 0], - 87: [0, 0.69141, 0, 0], - 88: [0, 0.69141, 0, 0], - 89: [0.18906, 0.69141, 0, 0], - 90: [0.12604, 0.69141, 0, 0], - 91: [0.24982, 0.74947, 0, 0], - 93: [0.24982, 0.74947, 0, 0], - 94: [0, 0.69141, 0, 0], - 97: [0, 0.47534, 0, 0], - 98: [0, 0.69141, 0, 0], - 99: [0, 0.47534, 0, 0], - 100: [0, 0.62119, 0, 0], - 101: [0, 0.47534, 0, 0], - 102: [0.18906, 0.69141, 0, 0], - 103: [0.18906, 0.47534, 0, 0], - 104: [0.18906, 0.69141, 0, 0], - 105: [0, 0.69141, 0, 0], - 106: [0, 0.69141, 0, 0], - 107: [0, 0.69141, 0, 0], - 108: [0, 0.69141, 0, 0], - 109: [0, 0.47534, 0, 0], - 110: [0, 0.47534, 0, 0], - 111: [0, 0.47534, 0, 0], - 112: [0.18906, 0.52396, 0, 0], - 113: [0.18906, 0.47534, 0, 0], - 114: [0, 0.47534, 0, 0], - 115: [0, 0.47534, 0, 0], - 116: [0, 0.62119, 0, 0], - 117: [0, 0.47534, 0, 0], - 118: [0, 0.52396, 0, 0], - 119: [0, 0.52396, 0, 0], - 120: [0.18906, 0.47534, 0, 0], - 121: [0.18906, 0.47534, 0, 0], - 122: [0.18906, 0.47534, 0, 0], - 8216: [0, 0.69141, 0, 0], - 8217: [0, 0.69141, 0, 0], - 58112: [0, 0.62119, 0, 0], - 58113: [0, 0.62119, 0, 0], - 58114: [0.18906, 0.69141, 0, 0], - 58115: [0.18906, 0.69141, 0, 0], - 58116: [0.18906, 0.47534, 0, 0], - 58117: [0, 0.69141, 0, 0], - 58118: [0, 0.62119, 0, 0], - 58119: [0, 0.47534, 0, 0], - }, - 'Main-Bold': { - 33: [0, 0.69444, 0, 0], - 34: [0, 0.69444, 0, 0], - 35: [0.19444, 0.69444, 0, 0], - 36: [0.05556, 0.75, 0, 0], - 37: [0.05556, 0.75, 0, 0], - 38: [0, 0.69444, 0, 0], - 39: [0, 0.69444, 0, 0], - 40: [0.25, 0.75, 0, 0], - 41: [0.25, 0.75, 0, 0], - 42: [0, 0.75, 0, 0], - 43: [0.13333, 0.63333, 0, 0], - 44: [0.19444, 0.15556, 0, 0], - 45: [0, 0.44444, 0, 0], - 46: [0, 0.15556, 0, 0], - 47: [0.25, 0.75, 0, 0], - 48: [0, 0.64444, 0, 0], - 49: [0, 0.64444, 0, 0], - 50: [0, 0.64444, 0, 0], - 51: [0, 0.64444, 0, 0], - 52: [0, 0.64444, 0, 0], - 53: [0, 0.64444, 0, 0], - 54: [0, 0.64444, 0, 0], - 55: [0, 0.64444, 0, 0], - 56: [0, 0.64444, 0, 0], - 57: [0, 0.64444, 0, 0], - 58: [0, 0.44444, 0, 0], - 59: [0.19444, 0.44444, 0, 0], - 60: [0.08556, 0.58556, 0, 0], - 61: [-0.10889, 0.39111, 0, 0], - 62: [0.08556, 0.58556, 0, 0], - 63: [0, 0.69444, 0, 0], - 64: [0, 0.69444, 0, 0], - 65: [0, 0.68611, 0, 0], - 66: [0, 0.68611, 0, 0], - 67: [0, 0.68611, 0, 0], - 68: [0, 0.68611, 0, 0], - 69: [0, 0.68611, 0, 0], - 70: [0, 0.68611, 0, 0], - 71: [0, 0.68611, 0, 0], - 72: [0, 0.68611, 0, 0], - 73: [0, 0.68611, 0, 0], - 74: [0, 0.68611, 0, 0], - 75: [0, 0.68611, 0, 0], - 76: [0, 0.68611, 0, 0], - 77: [0, 0.68611, 0, 0], - 78: [0, 0.68611, 0, 0], - 79: [0, 0.68611, 0, 0], - 80: [0, 0.68611, 0, 0], - 81: [0.19444, 0.68611, 0, 0], - 82: [0, 0.68611, 0, 0], - 83: [0, 0.68611, 0, 0], - 84: [0, 0.68611, 0, 0], - 85: [0, 0.68611, 0, 0], - 86: [0, 0.68611, 0.01597, 0], - 87: [0, 0.68611, 0.01597, 0], - 88: [0, 0.68611, 0, 0], - 89: [0, 0.68611, 0.02875, 0], - 90: [0, 0.68611, 0, 0], - 91: [0.25, 0.75, 0, 0], - 92: [0.25, 0.75, 0, 0], - 93: [0.25, 0.75, 0, 0], - 94: [0, 0.69444, 0, 0], - 95: [0.31, 0.13444, 0.03194, 0], - 96: [0, 0.69444, 0, 0], - 97: [0, 0.44444, 0, 0], - 98: [0, 0.69444, 0, 0], - 99: [0, 0.44444, 0, 0], - 100: [0, 0.69444, 0, 0], - 101: [0, 0.44444, 0, 0], - 102: [0, 0.69444, 0.10903, 0], - 103: [0.19444, 0.44444, 0.01597, 0], - 104: [0, 0.69444, 0, 0], - 105: [0, 0.69444, 0, 0], - 106: [0.19444, 0.69444, 0, 0], - 107: [0, 0.69444, 0, 0], - 108: [0, 0.69444, 0, 0], - 109: [0, 0.44444, 0, 0], - 110: [0, 0.44444, 0, 0], - 111: [0, 0.44444, 0, 0], - 112: [0.19444, 0.44444, 0, 0], - 113: [0.19444, 0.44444, 0, 0], - 114: [0, 0.44444, 0, 0], - 115: [0, 0.44444, 0, 0], - 116: [0, 0.63492, 0, 0], - 117: [0, 0.44444, 0, 0], - 118: [0, 0.44444, 0.01597, 0], - 119: [0, 0.44444, 0.01597, 0], - 120: [0, 0.44444, 0, 0], - 121: [0.19444, 0.44444, 0.01597, 0], - 122: [0, 0.44444, 0, 0], - 123: [0.25, 0.75, 0, 0], - 124: [0.25, 0.75, 0, 0], - 125: [0.25, 0.75, 0, 0], - 126: [0.35, 0.34444, 0, 0], - 168: [0, 0.69444, 0, 0], - 172: [0, 0.44444, 0, 0], - 175: [0, 0.59611, 0, 0], - 176: [0, 0.69444, 0, 0], - 177: [0.13333, 0.63333, 0, 0], - 180: [0, 0.69444, 0, 0], - 215: [0.13333, 0.63333, 0, 0], - 247: [0.13333, 0.63333, 0, 0], - 305: [0, 0.44444, 0, 0], - 567: [0.19444, 0.44444, 0, 0], - 710: [0, 0.69444, 0, 0], - 711: [0, 0.63194, 0, 0], - 713: [0, 0.59611, 0, 0], - 714: [0, 0.69444, 0, 0], - 715: [0, 0.69444, 0, 0], - 728: [0, 0.69444, 0, 0], - 729: [0, 0.69444, 0, 0], - 730: [0, 0.69444, 0, 0], - 732: [0, 0.69444, 0, 0], - 768: [0, 0.69444, 0, 0], - 769: [0, 0.69444, 0, 0], - 770: [0, 0.69444, 0, 0], - 771: [0, 0.69444, 0, 0], - 772: [0, 0.59611, 0, 0], - 774: [0, 0.69444, 0, 0], - 775: [0, 0.69444, 0, 0], - 776: [0, 0.69444, 0, 0], - 778: [0, 0.69444, 0, 0], - 779: [0, 0.69444, 0, 0], - 780: [0, 0.63194, 0, 0], - 824: [0.19444, 0.69444, 0, 0], - 915: [0, 0.68611, 0, 0], - 916: [0, 0.68611, 0, 0], - 920: [0, 0.68611, 0, 0], - 923: [0, 0.68611, 0, 0], - 926: [0, 0.68611, 0, 0], - 928: [0, 0.68611, 0, 0], - 931: [0, 0.68611, 0, 0], - 933: [0, 0.68611, 0, 0], - 934: [0, 0.68611, 0, 0], - 936: [0, 0.68611, 0, 0], - 937: [0, 0.68611, 0, 0], - 8211: [0, 0.44444, 0.03194, 0], - 8212: [0, 0.44444, 0.03194, 0], - 8216: [0, 0.69444, 0, 0], - 8217: [0, 0.69444, 0, 0], - 8220: [0, 0.69444, 0, 0], - 8221: [0, 0.69444, 0, 0], - 8224: [0.19444, 0.69444, 0, 0], - 8225: [0.19444, 0.69444, 0, 0], - 8242: [0, 0.55556, 0, 0], - 8407: [0, 0.72444, 0.15486, 0], - 8463: [0, 0.69444, 0, 0], - 8465: [0, 0.69444, 0, 0], - 8467: [0, 0.69444, 0, 0], - 8472: [0.19444, 0.44444, 0, 0], - 8476: [0, 0.69444, 0, 0], - 8501: [0, 0.69444, 0, 0], - 8592: [-0.10889, 0.39111, 0, 0], - 8593: [0.19444, 0.69444, 0, 0], - 8594: [-0.10889, 0.39111, 0, 0], - 8595: [0.19444, 0.69444, 0, 0], - 8596: [-0.10889, 0.39111, 0, 0], - 8597: [0.25, 0.75, 0, 0], - 8598: [0.19444, 0.69444, 0, 0], - 8599: [0.19444, 0.69444, 0, 0], - 8600: [0.19444, 0.69444, 0, 0], - 8601: [0.19444, 0.69444, 0, 0], - 8636: [-0.10889, 0.39111, 0, 0], - 8637: [-0.10889, 0.39111, 0, 0], - 8640: [-0.10889, 0.39111, 0, 0], - 8641: [-0.10889, 0.39111, 0, 0], - 8656: [-0.10889, 0.39111, 0, 0], - 8657: [0.19444, 0.69444, 0, 0], - 8658: [-0.10889, 0.39111, 0, 0], - 8659: [0.19444, 0.69444, 0, 0], - 8660: [-0.10889, 0.39111, 0, 0], - 8661: [0.25, 0.75, 0, 0], - 8704: [0, 0.69444, 0, 0], - 8706: [0, 0.69444, 0.06389, 0], - 8707: [0, 0.69444, 0, 0], - 8709: [0.05556, 0.75, 0, 0], - 8711: [0, 0.68611, 0, 0], - 8712: [0.08556, 0.58556, 0, 0], - 8715: [0.08556, 0.58556, 0, 0], - 8722: [0.13333, 0.63333, 0, 0], - 8723: [0.13333, 0.63333, 0, 0], - 8725: [0.25, 0.75, 0, 0], - 8726: [0.25, 0.75, 0, 0], - 8727: [-0.02778, 0.47222, 0, 0], - 8728: [-0.02639, 0.47361, 0, 0], - 8729: [-0.02639, 0.47361, 0, 0], - 8730: [0.18, 0.82, 0, 0], - 8733: [0, 0.44444, 0, 0], - 8734: [0, 0.44444, 0, 0], - 8736: [0, 0.69224, 0, 0], - 8739: [0.25, 0.75, 0, 0], - 8741: [0.25, 0.75, 0, 0], - 8743: [0, 0.55556, 0, 0], - 8744: [0, 0.55556, 0, 0], - 8745: [0, 0.55556, 0, 0], - 8746: [0, 0.55556, 0, 0], - 8747: [0.19444, 0.69444, 0.12778, 0], - 8764: [-0.10889, 0.39111, 0, 0], - 8768: [0.19444, 0.69444, 0, 0], - 8771: [0.00222, 0.50222, 0, 0], - 8776: [0.02444, 0.52444, 0, 0], - 8781: [0.00222, 0.50222, 0, 0], - 8801: [0.00222, 0.50222, 0, 0], - 8804: [0.19667, 0.69667, 0, 0], - 8805: [0.19667, 0.69667, 0, 0], - 8810: [0.08556, 0.58556, 0, 0], - 8811: [0.08556, 0.58556, 0, 0], - 8826: [0.08556, 0.58556, 0, 0], - 8827: [0.08556, 0.58556, 0, 0], - 8834: [0.08556, 0.58556, 0, 0], - 8835: [0.08556, 0.58556, 0, 0], - 8838: [0.19667, 0.69667, 0, 0], - 8839: [0.19667, 0.69667, 0, 0], - 8846: [0, 0.55556, 0, 0], - 8849: [0.19667, 0.69667, 0, 0], - 8850: [0.19667, 0.69667, 0, 0], - 8851: [0, 0.55556, 0, 0], - 8852: [0, 0.55556, 0, 0], - 8853: [0.13333, 0.63333, 0, 0], - 8854: [0.13333, 0.63333, 0, 0], - 8855: [0.13333, 0.63333, 0, 0], - 8856: [0.13333, 0.63333, 0, 0], - 8857: [0.13333, 0.63333, 0, 0], - 8866: [0, 0.69444, 0, 0], - 8867: [0, 0.69444, 0, 0], - 8868: [0, 0.69444, 0, 0], - 8869: [0, 0.69444, 0, 0], - 8900: [-0.02639, 0.47361, 0, 0], - 8901: [-0.02639, 0.47361, 0, 0], - 8902: [-0.02778, 0.47222, 0, 0], - 8968: [0.25, 0.75, 0, 0], - 8969: [0.25, 0.75, 0, 0], - 8970: [0.25, 0.75, 0, 0], - 8971: [0.25, 0.75, 0, 0], - 8994: [-0.13889, 0.36111, 0, 0], - 8995: [-0.13889, 0.36111, 0, 0], - 9651: [0.19444, 0.69444, 0, 0], - 9657: [-0.02778, 0.47222, 0, 0], - 9661: [0.19444, 0.69444, 0, 0], - 9667: [-0.02778, 0.47222, 0, 0], - 9711: [0.19444, 0.69444, 0, 0], - 9824: [0.12963, 0.69444, 0, 0], - 9825: [0.12963, 0.69444, 0, 0], - 9826: [0.12963, 0.69444, 0, 0], - 9827: [0.12963, 0.69444, 0, 0], - 9837: [0, 0.75, 0, 0], - 9838: [0.19444, 0.69444, 0, 0], - 9839: [0.19444, 0.69444, 0, 0], - 10216: [0.25, 0.75, 0, 0], - 10217: [0.25, 0.75, 0, 0], - 10815: [0, 0.68611, 0, 0], - 10927: [0.19667, 0.69667, 0, 0], - 10928: [0.19667, 0.69667, 0, 0], - }, - 'Main-Italic': { - 33: [0, 0.69444, 0.12417, 0], - 34: [0, 0.69444, 0.06961, 0], - 35: [0.19444, 0.69444, 0.06616, 0], - 37: [0.05556, 0.75, 0.13639, 0], - 38: [0, 0.69444, 0.09694, 0], - 39: [0, 0.69444, 0.12417, 0], - 40: [0.25, 0.75, 0.16194, 0], - 41: [0.25, 0.75, 0.03694, 0], - 42: [0, 0.75, 0.14917, 0], - 43: [0.05667, 0.56167, 0.03694, 0], - 44: [0.19444, 0.10556, 0, 0], - 45: [0, 0.43056, 0.02826, 0], - 46: [0, 0.10556, 0, 0], - 47: [0.25, 0.75, 0.16194, 0], - 48: [0, 0.64444, 0.13556, 0], - 49: [0, 0.64444, 0.13556, 0], - 50: [0, 0.64444, 0.13556, 0], - 51: [0, 0.64444, 0.13556, 0], - 52: [0.19444, 0.64444, 0.13556, 0], - 53: [0, 0.64444, 0.13556, 0], - 54: [0, 0.64444, 0.13556, 0], - 55: [0.19444, 0.64444, 0.13556, 0], - 56: [0, 0.64444, 0.13556, 0], - 57: [0, 0.64444, 0.13556, 0], - 58: [0, 0.43056, 0.0582, 0], - 59: [0.19444, 0.43056, 0.0582, 0], - 61: [-0.13313, 0.36687, 0.06616, 0], - 63: [0, 0.69444, 0.1225, 0], - 64: [0, 0.69444, 0.09597, 0], - 65: [0, 0.68333, 0, 0], - 66: [0, 0.68333, 0.10257, 0], - 67: [0, 0.68333, 0.14528, 0], - 68: [0, 0.68333, 0.09403, 0], - 69: [0, 0.68333, 0.12028, 0], - 70: [0, 0.68333, 0.13305, 0], - 71: [0, 0.68333, 0.08722, 0], - 72: [0, 0.68333, 0.16389, 0], - 73: [0, 0.68333, 0.15806, 0], - 74: [0, 0.68333, 0.14028, 0], - 75: [0, 0.68333, 0.14528, 0], - 76: [0, 0.68333, 0, 0], - 77: [0, 0.68333, 0.16389, 0], - 78: [0, 0.68333, 0.16389, 0], - 79: [0, 0.68333, 0.09403, 0], - 80: [0, 0.68333, 0.10257, 0], - 81: [0.19444, 0.68333, 0.09403, 0], - 82: [0, 0.68333, 0.03868, 0], - 83: [0, 0.68333, 0.11972, 0], - 84: [0, 0.68333, 0.13305, 0], - 85: [0, 0.68333, 0.16389, 0], - 86: [0, 0.68333, 0.18361, 0], - 87: [0, 0.68333, 0.18361, 0], - 88: [0, 0.68333, 0.15806, 0], - 89: [0, 0.68333, 0.19383, 0], - 90: [0, 0.68333, 0.14528, 0], - 91: [0.25, 0.75, 0.1875, 0], - 93: [0.25, 0.75, 0.10528, 0], - 94: [0, 0.69444, 0.06646, 0], - 95: [0.31, 0.12056, 0.09208, 0], - 97: [0, 0.43056, 0.07671, 0], - 98: [0, 0.69444, 0.06312, 0], - 99: [0, 0.43056, 0.05653, 0], - 100: [0, 0.69444, 0.10333, 0], - 101: [0, 0.43056, 0.07514, 0], - 102: [0.19444, 0.69444, 0.21194, 0], - 103: [0.19444, 0.43056, 0.08847, 0], - 104: [0, 0.69444, 0.07671, 0], - 105: [0, 0.65536, 0.1019, 0], - 106: [0.19444, 0.65536, 0.14467, 0], - 107: [0, 0.69444, 0.10764, 0], - 108: [0, 0.69444, 0.10333, 0], - 109: [0, 0.43056, 0.07671, 0], - 110: [0, 0.43056, 0.07671, 0], - 111: [0, 0.43056, 0.06312, 0], - 112: [0.19444, 0.43056, 0.06312, 0], - 113: [0.19444, 0.43056, 0.08847, 0], - 114: [0, 0.43056, 0.10764, 0], - 115: [0, 0.43056, 0.08208, 0], - 116: [0, 0.61508, 0.09486, 0], - 117: [0, 0.43056, 0.07671, 0], - 118: [0, 0.43056, 0.10764, 0], - 119: [0, 0.43056, 0.10764, 0], - 120: [0, 0.43056, 0.12042, 0], - 121: [0.19444, 0.43056, 0.08847, 0], - 122: [0, 0.43056, 0.12292, 0], - 126: [0.35, 0.31786, 0.11585, 0], - 163: [0, 0.69444, 0, 0], - 305: [0, 0.43056, 0, 0.02778], - 567: [0.19444, 0.43056, 0, 0.08334], - 768: [0, 0.69444, 0, 0], - 769: [0, 0.69444, 0.09694, 0], - 770: [0, 0.69444, 0.06646, 0], - 771: [0, 0.66786, 0.11585, 0], - 772: [0, 0.56167, 0.10333, 0], - 774: [0, 0.69444, 0.10806, 0], - 775: [0, 0.66786, 0.11752, 0], - 776: [0, 0.66786, 0.10474, 0], - 778: [0, 0.69444, 0, 0], - 779: [0, 0.69444, 0.1225, 0], - 780: [0, 0.62847, 0.08295, 0], - 915: [0, 0.68333, 0.13305, 0], - 916: [0, 0.68333, 0, 0], - 920: [0, 0.68333, 0.09403, 0], - 923: [0, 0.68333, 0, 0], - 926: [0, 0.68333, 0.15294, 0], - 928: [0, 0.68333, 0.16389, 0], - 931: [0, 0.68333, 0.12028, 0], - 933: [0, 0.68333, 0.11111, 0], - 934: [0, 0.68333, 0.05986, 0], - 936: [0, 0.68333, 0.11111, 0], - 937: [0, 0.68333, 0.10257, 0], - 8211: [0, 0.43056, 0.09208, 0], - 8212: [0, 0.43056, 0.09208, 0], - 8216: [0, 0.69444, 0.12417, 0], - 8217: [0, 0.69444, 0.12417, 0], - 8220: [0, 0.69444, 0.1685, 0], - 8221: [0, 0.69444, 0.06961, 0], - 8463: [0, 0.68889, 0, 0], - }, - 'Main-Regular': { - 32: [0, 0, 0, 0], - 33: [0, 0.69444, 0, 0], - 34: [0, 0.69444, 0, 0], - 35: [0.19444, 0.69444, 0, 0], - 36: [0.05556, 0.75, 0, 0], - 37: [0.05556, 0.75, 0, 0], - 38: [0, 0.69444, 0, 0], - 39: [0, 0.69444, 0, 0], - 40: [0.25, 0.75, 0, 0], - 41: [0.25, 0.75, 0, 0], - 42: [0, 0.75, 0, 0], - 43: [0.08333, 0.58333, 0, 0], - 44: [0.19444, 0.10556, 0, 0], - 45: [0, 0.43056, 0, 0], - 46: [0, 0.10556, 0, 0], - 47: [0.25, 0.75, 0, 0], - 48: [0, 0.64444, 0, 0], - 49: [0, 0.64444, 0, 0], - 50: [0, 0.64444, 0, 0], - 51: [0, 0.64444, 0, 0], - 52: [0, 0.64444, 0, 0], - 53: [0, 0.64444, 0, 0], - 54: [0, 0.64444, 0, 0], - 55: [0, 0.64444, 0, 0], - 56: [0, 0.64444, 0, 0], - 57: [0, 0.64444, 0, 0], - 58: [0, 0.43056, 0, 0], - 59: [0.19444, 0.43056, 0, 0], - 60: [0.0391, 0.5391, 0, 0], - 61: [-0.13313, 0.36687, 0, 0], - 62: [0.0391, 0.5391, 0, 0], - 63: [0, 0.69444, 0, 0], - 64: [0, 0.69444, 0, 0], - 65: [0, 0.68333, 0, 0], - 66: [0, 0.68333, 0, 0], - 67: [0, 0.68333, 0, 0], - 68: [0, 0.68333, 0, 0], - 69: [0, 0.68333, 0, 0], - 70: [0, 0.68333, 0, 0], - 71: [0, 0.68333, 0, 0], - 72: [0, 0.68333, 0, 0], - 73: [0, 0.68333, 0, 0], - 74: [0, 0.68333, 0, 0], - 75: [0, 0.68333, 0, 0], - 76: [0, 0.68333, 0, 0], - 77: [0, 0.68333, 0, 0], - 78: [0, 0.68333, 0, 0], - 79: [0, 0.68333, 0, 0], - 80: [0, 0.68333, 0, 0], - 81: [0.19444, 0.68333, 0, 0], - 82: [0, 0.68333, 0, 0], - 83: [0, 0.68333, 0, 0], - 84: [0, 0.68333, 0, 0], - 85: [0, 0.68333, 0, 0], - 86: [0, 0.68333, 0.01389, 0], - 87: [0, 0.68333, 0.01389, 0], - 88: [0, 0.68333, 0, 0], - 89: [0, 0.68333, 0.025, 0], - 90: [0, 0.68333, 0, 0], - 91: [0.25, 0.75, 0, 0], - 92: [0.25, 0.75, 0, 0], - 93: [0.25, 0.75, 0, 0], - 94: [0, 0.69444, 0, 0], - 95: [0.31, 0.12056, 0.02778, 0], - 96: [0, 0.69444, 0, 0], - 97: [0, 0.43056, 0, 0], - 98: [0, 0.69444, 0, 0], - 99: [0, 0.43056, 0, 0], - 100: [0, 0.69444, 0, 0], - 101: [0, 0.43056, 0, 0], - 102: [0, 0.69444, 0.07778, 0], - 103: [0.19444, 0.43056, 0.01389, 0], - 104: [0, 0.69444, 0, 0], - 105: [0, 0.66786, 0, 0], - 106: [0.19444, 0.66786, 0, 0], - 107: [0, 0.69444, 0, 0], - 108: [0, 0.69444, 0, 0], - 109: [0, 0.43056, 0, 0], - 110: [0, 0.43056, 0, 0], - 111: [0, 0.43056, 0, 0], - 112: [0.19444, 0.43056, 0, 0], - 113: [0.19444, 0.43056, 0, 0], - 114: [0, 0.43056, 0, 0], - 115: [0, 0.43056, 0, 0], - 116: [0, 0.61508, 0, 0], - 117: [0, 0.43056, 0, 0], - 118: [0, 0.43056, 0.01389, 0], - 119: [0, 0.43056, 0.01389, 0], - 120: [0, 0.43056, 0, 0], - 121: [0.19444, 0.43056, 0.01389, 0], - 122: [0, 0.43056, 0, 0], - 123: [0.25, 0.75, 0, 0], - 124: [0.25, 0.75, 0, 0], - 125: [0.25, 0.75, 0, 0], - 126: [0.35, 0.31786, 0, 0], - 160: [0, 0, 0, 0], - 168: [0, 0.66786, 0, 0], - 172: [0, 0.43056, 0, 0], - 175: [0, 0.56778, 0, 0], - 176: [0, 0.69444, 0, 0], - 177: [0.08333, 0.58333, 0, 0], - 180: [0, 0.69444, 0, 0], - 215: [0.08333, 0.58333, 0, 0], - 247: [0.08333, 0.58333, 0, 0], - 305: [0, 0.43056, 0, 0], - 567: [0.19444, 0.43056, 0, 0], - 710: [0, 0.69444, 0, 0], - 711: [0, 0.62847, 0, 0], - 713: [0, 0.56778, 0, 0], - 714: [0, 0.69444, 0, 0], - 715: [0, 0.69444, 0, 0], - 728: [0, 0.69444, 0, 0], - 729: [0, 0.66786, 0, 0], - 730: [0, 0.69444, 0, 0], - 732: [0, 0.66786, 0, 0], - 768: [0, 0.69444, 0, 0], - 769: [0, 0.69444, 0, 0], - 770: [0, 0.69444, 0, 0], - 771: [0, 0.66786, 0, 0], - 772: [0, 0.56778, 0, 0], - 774: [0, 0.69444, 0, 0], - 775: [0, 0.66786, 0, 0], - 776: [0, 0.66786, 0, 0], - 778: [0, 0.69444, 0, 0], - 779: [0, 0.69444, 0, 0], - 780: [0, 0.62847, 0, 0], - 824: [0.19444, 0.69444, 0, 0], - 915: [0, 0.68333, 0, 0], - 916: [0, 0.68333, 0, 0], - 920: [0, 0.68333, 0, 0], - 923: [0, 0.68333, 0, 0], - 926: [0, 0.68333, 0, 0], - 928: [0, 0.68333, 0, 0], - 931: [0, 0.68333, 0, 0], - 933: [0, 0.68333, 0, 0], - 934: [0, 0.68333, 0, 0], - 936: [0, 0.68333, 0, 0], - 937: [0, 0.68333, 0, 0], - 8211: [0, 0.43056, 0.02778, 0], - 8212: [0, 0.43056, 0.02778, 0], - 8216: [0, 0.69444, 0, 0], - 8217: [0, 0.69444, 0, 0], - 8220: [0, 0.69444, 0, 0], - 8221: [0, 0.69444, 0, 0], - 8224: [0.19444, 0.69444, 0, 0], - 8225: [0.19444, 0.69444, 0, 0], - 8230: [0, 0.12, 0, 0], - 8242: [0, 0.55556, 0, 0], - 8407: [0, 0.71444, 0.15382, 0], - 8463: [0, 0.68889, 0, 0], - 8465: [0, 0.69444, 0, 0], - 8467: [0, 0.69444, 0, 0.11111], - 8472: [0.19444, 0.43056, 0, 0.11111], - 8476: [0, 0.69444, 0, 0], - 8501: [0, 0.69444, 0, 0], - 8592: [-0.13313, 0.36687, 0, 0], - 8593: [0.19444, 0.69444, 0, 0], - 8594: [-0.13313, 0.36687, 0, 0], - 8595: [0.19444, 0.69444, 0, 0], - 8596: [-0.13313, 0.36687, 0, 0], - 8597: [0.25, 0.75, 0, 0], - 8598: [0.19444, 0.69444, 0, 0], - 8599: [0.19444, 0.69444, 0, 0], - 8600: [0.19444, 0.69444, 0, 0], - 8601: [0.19444, 0.69444, 0, 0], - 8614: [0.011, 0.511, 0, 0], - 8617: [0.011, 0.511, 0, 0], - 8618: [0.011, 0.511, 0, 0], - 8636: [-0.13313, 0.36687, 0, 0], - 8637: [-0.13313, 0.36687, 0, 0], - 8640: [-0.13313, 0.36687, 0, 0], - 8641: [-0.13313, 0.36687, 0, 0], - 8652: [0.011, 0.671, 0, 0], - 8656: [-0.13313, 0.36687, 0, 0], - 8657: [0.19444, 0.69444, 0, 0], - 8658: [-0.13313, 0.36687, 0, 0], - 8659: [0.19444, 0.69444, 0, 0], - 8660: [-0.13313, 0.36687, 0, 0], - 8661: [0.25, 0.75, 0, 0], - 8704: [0, 0.69444, 0, 0], - 8706: [0, 0.69444, 0.05556, 0.08334], - 8707: [0, 0.69444, 0, 0], - 8709: [0.05556, 0.75, 0, 0], - 8711: [0, 0.68333, 0, 0], - 8712: [0.0391, 0.5391, 0, 0], - 8715: [0.0391, 0.5391, 0, 0], - 8722: [0.08333, 0.58333, 0, 0], - 8723: [0.08333, 0.58333, 0, 0], - 8725: [0.25, 0.75, 0, 0], - 8726: [0.25, 0.75, 0, 0], - 8727: [-0.03472, 0.46528, 0, 0], - 8728: [-0.05555, 0.44445, 0, 0], - 8729: [-0.05555, 0.44445, 0, 0], - 8730: [0.2, 0.8, 0, 0], - 8733: [0, 0.43056, 0, 0], - 8734: [0, 0.43056, 0, 0], - 8736: [0, 0.69224, 0, 0], - 8739: [0.25, 0.75, 0, 0], - 8741: [0.25, 0.75, 0, 0], - 8743: [0, 0.55556, 0, 0], - 8744: [0, 0.55556, 0, 0], - 8745: [0, 0.55556, 0, 0], - 8746: [0, 0.55556, 0, 0], - 8747: [0.19444, 0.69444, 0.11111, 0], - 8764: [-0.13313, 0.36687, 0, 0], - 8768: [0.19444, 0.69444, 0, 0], - 8771: [-0.03625, 0.46375, 0, 0], - 8773: [-0.022, 0.589, 0, 0], - 8776: [-0.01688, 0.48312, 0, 0], - 8781: [-0.03625, 0.46375, 0, 0], - 8784: [-0.133, 0.67, 0, 0], - 8800: [0.215, 0.716, 0, 0], - 8801: [-0.03625, 0.46375, 0, 0], - 8804: [0.13597, 0.63597, 0, 0], - 8805: [0.13597, 0.63597, 0, 0], - 8810: [0.0391, 0.5391, 0, 0], - 8811: [0.0391, 0.5391, 0, 0], - 8826: [0.0391, 0.5391, 0, 0], - 8827: [0.0391, 0.5391, 0, 0], - 8834: [0.0391, 0.5391, 0, 0], - 8835: [0.0391, 0.5391, 0, 0], - 8838: [0.13597, 0.63597, 0, 0], - 8839: [0.13597, 0.63597, 0, 0], - 8846: [0, 0.55556, 0, 0], - 8849: [0.13597, 0.63597, 0, 0], - 8850: [0.13597, 0.63597, 0, 0], - 8851: [0, 0.55556, 0, 0], - 8852: [0, 0.55556, 0, 0], - 8853: [0.08333, 0.58333, 0, 0], - 8854: [0.08333, 0.58333, 0, 0], - 8855: [0.08333, 0.58333, 0, 0], - 8856: [0.08333, 0.58333, 0, 0], - 8857: [0.08333, 0.58333, 0, 0], - 8866: [0, 0.69444, 0, 0], - 8867: [0, 0.69444, 0, 0], - 8868: [0, 0.69444, 0, 0], - 8869: [0, 0.69444, 0, 0], - 8872: [0.249, 0.75, 0, 0], - 8900: [-0.05555, 0.44445, 0, 0], - 8901: [-0.05555, 0.44445, 0, 0], - 8902: [-0.03472, 0.46528, 0, 0], - 8904: [0.005, 0.505, 0, 0], - 8942: [0.03, 0.9, 0, 0], - 8943: [-0.19, 0.31, 0, 0], - 8945: [-0.1, 0.82, 0, 0], - 8968: [0.25, 0.75, 0, 0], - 8969: [0.25, 0.75, 0, 0], - 8970: [0.25, 0.75, 0, 0], - 8971: [0.25, 0.75, 0, 0], - 8994: [-0.14236, 0.35764, 0, 0], - 8995: [-0.14236, 0.35764, 0, 0], - 9136: [0.244, 0.744, 0, 0], - 9137: [0.244, 0.744, 0, 0], - 9651: [0.19444, 0.69444, 0, 0], - 9657: [-0.03472, 0.46528, 0, 0], - 9661: [0.19444, 0.69444, 0, 0], - 9667: [-0.03472, 0.46528, 0, 0], - 9711: [0.19444, 0.69444, 0, 0], - 9824: [0.12963, 0.69444, 0, 0], - 9825: [0.12963, 0.69444, 0, 0], - 9826: [0.12963, 0.69444, 0, 0], - 9827: [0.12963, 0.69444, 0, 0], - 9837: [0, 0.75, 0, 0], - 9838: [0.19444, 0.69444, 0, 0], - 9839: [0.19444, 0.69444, 0, 0], - 10216: [0.25, 0.75, 0, 0], - 10217: [0.25, 0.75, 0, 0], - 10222: [0.244, 0.744, 0, 0], - 10223: [0.244, 0.744, 0, 0], - 10229: [0.011, 0.511, 0, 0], - 10230: [0.011, 0.511, 0, 0], - 10231: [0.011, 0.511, 0, 0], - 10232: [0.024, 0.525, 0, 0], - 10233: [0.024, 0.525, 0, 0], - 10234: [0.024, 0.525, 0, 0], - 10236: [0.011, 0.511, 0, 0], - 10815: [0, 0.68333, 0, 0], - 10927: [0.13597, 0.63597, 0, 0], - 10928: [0.13597, 0.63597, 0, 0], - }, - 'Math-BoldItalic': { - 47: [0.19444, 0.69444, 0, 0], - 65: [0, 0.68611, 0, 0], - 66: [0, 0.68611, 0.04835, 0], - 67: [0, 0.68611, 0.06979, 0], - 68: [0, 0.68611, 0.03194, 0], - 69: [0, 0.68611, 0.05451, 0], - 70: [0, 0.68611, 0.15972, 0], - 71: [0, 0.68611, 0, 0], - 72: [0, 0.68611, 0.08229, 0], - 73: [0, 0.68611, 0.07778, 0], - 74: [0, 0.68611, 0.10069, 0], - 75: [0, 0.68611, 0.06979, 0], - 76: [0, 0.68611, 0, 0], - 77: [0, 0.68611, 0.11424, 0], - 78: [0, 0.68611, 0.11424, 0], - 79: [0, 0.68611, 0.03194, 0], - 80: [0, 0.68611, 0.15972, 0], - 81: [0.19444, 0.68611, 0, 0], - 82: [0, 0.68611, 0.00421, 0], - 83: [0, 0.68611, 0.05382, 0], - 84: [0, 0.68611, 0.15972, 0], - 85: [0, 0.68611, 0.11424, 0], - 86: [0, 0.68611, 0.25555, 0], - 87: [0, 0.68611, 0.15972, 0], - 88: [0, 0.68611, 0.07778, 0], - 89: [0, 0.68611, 0.25555, 0], - 90: [0, 0.68611, 0.06979, 0], - 97: [0, 0.44444, 0, 0], - 98: [0, 0.69444, 0, 0], - 99: [0, 0.44444, 0, 0], - 100: [0, 0.69444, 0, 0], - 101: [0, 0.44444, 0, 0], - 102: [0.19444, 0.69444, 0.11042, 0], - 103: [0.19444, 0.44444, 0.03704, 0], - 104: [0, 0.69444, 0, 0], - 105: [0, 0.69326, 0, 0], - 106: [0.19444, 0.69326, 0.0622, 0], - 107: [0, 0.69444, 0.01852, 0], - 108: [0, 0.69444, 0.0088, 0], - 109: [0, 0.44444, 0, 0], - 110: [0, 0.44444, 0, 0], - 111: [0, 0.44444, 0, 0], - 112: [0.19444, 0.44444, 0, 0], - 113: [0.19444, 0.44444, 0.03704, 0], - 114: [0, 0.44444, 0.03194, 0], - 115: [0, 0.44444, 0, 0], - 116: [0, 0.63492, 0, 0], - 117: [0, 0.44444, 0, 0], - 118: [0, 0.44444, 0.03704, 0], - 119: [0, 0.44444, 0.02778, 0], - 120: [0, 0.44444, 0, 0], - 121: [0.19444, 0.44444, 0.03704, 0], - 122: [0, 0.44444, 0.04213, 0], - 915: [0, 0.68611, 0.15972, 0], - 916: [0, 0.68611, 0, 0], - 920: [0, 0.68611, 0.03194, 0], - 923: [0, 0.68611, 0, 0], - 926: [0, 0.68611, 0.07458, 0], - 928: [0, 0.68611, 0.08229, 0], - 931: [0, 0.68611, 0.05451, 0], - 933: [0, 0.68611, 0.15972, 0], - 934: [0, 0.68611, 0, 0], - 936: [0, 0.68611, 0.11653, 0], - 937: [0, 0.68611, 0.04835, 0], - 945: [0, 0.44444, 0, 0], - 946: [0.19444, 0.69444, 0.03403, 0], - 947: [0.19444, 0.44444, 0.06389, 0], - 948: [0, 0.69444, 0.03819, 0], - 949: [0, 0.44444, 0, 0], - 950: [0.19444, 0.69444, 0.06215, 0], - 951: [0.19444, 0.44444, 0.03704, 0], - 952: [0, 0.69444, 0.03194, 0], - 953: [0, 0.44444, 0, 0], - 954: [0, 0.44444, 0, 0], - 955: [0, 0.69444, 0, 0], - 956: [0.19444, 0.44444, 0, 0], - 957: [0, 0.44444, 0.06898, 0], - 958: [0.19444, 0.69444, 0.03021, 0], - 959: [0, 0.44444, 0, 0], - 960: [0, 0.44444, 0.03704, 0], - 961: [0.19444, 0.44444, 0, 0], - 962: [0.09722, 0.44444, 0.07917, 0], - 963: [0, 0.44444, 0.03704, 0], - 964: [0, 0.44444, 0.13472, 0], - 965: [0, 0.44444, 0.03704, 0], - 966: [0.19444, 0.44444, 0, 0], - 967: [0.19444, 0.44444, 0, 0], - 968: [0.19444, 0.69444, 0.03704, 0], - 969: [0, 0.44444, 0.03704, 0], - 977: [0, 0.69444, 0, 0], - 981: [0.19444, 0.69444, 0, 0], - 982: [0, 0.44444, 0.03194, 0], - 1009: [0.19444, 0.44444, 0, 0], - 1013: [0, 0.44444, 0, 0], - }, - 'Math-Italic': { - 47: [0.19444, 0.69444, 0, 0], - 65: [0, 0.68333, 0, 0.13889], - 66: [0, 0.68333, 0.05017, 0.08334], - 67: [0, 0.68333, 0.07153, 0.08334], - 68: [0, 0.68333, 0.02778, 0.05556], - 69: [0, 0.68333, 0.05764, 0.08334], - 70: [0, 0.68333, 0.13889, 0.08334], - 71: [0, 0.68333, 0, 0.08334], - 72: [0, 0.68333, 0.08125, 0.05556], - 73: [0, 0.68333, 0.07847, 0.11111], - 74: [0, 0.68333, 0.09618, 0.16667], - 75: [0, 0.68333, 0.07153, 0.05556], - 76: [0, 0.68333, 0, 0.02778], - 77: [0, 0.68333, 0.10903, 0.08334], - 78: [0, 0.68333, 0.10903, 0.08334], - 79: [0, 0.68333, 0.02778, 0.08334], - 80: [0, 0.68333, 0.13889, 0.08334], - 81: [0.19444, 0.68333, 0, 0.08334], - 82: [0, 0.68333, 0.00773, 0.08334], - 83: [0, 0.68333, 0.05764, 0.08334], - 84: [0, 0.68333, 0.13889, 0.08334], - 85: [0, 0.68333, 0.10903, 0.02778], - 86: [0, 0.68333, 0.22222, 0], - 87: [0, 0.68333, 0.13889, 0], - 88: [0, 0.68333, 0.07847, 0.08334], - 89: [0, 0.68333, 0.22222, 0], - 90: [0, 0.68333, 0.07153, 0.08334], - 97: [0, 0.43056, 0, 0], - 98: [0, 0.69444, 0, 0], - 99: [0, 0.43056, 0, 0.05556], - 100: [0, 0.69444, 0, 0.16667], - 101: [0, 0.43056, 0, 0.05556], - 102: [0.19444, 0.69444, 0.10764, 0.16667], - 103: [0.19444, 0.43056, 0.03588, 0.02778], - 104: [0, 0.69444, 0, 0], - 105: [0, 0.65952, 0, 0], - 106: [0.19444, 0.65952, 0.05724, 0], - 107: [0, 0.69444, 0.03148, 0], - 108: [0, 0.69444, 0.01968, 0.08334], - 109: [0, 0.43056, 0, 0], - 110: [0, 0.43056, 0, 0], - 111: [0, 0.43056, 0, 0.05556], - 112: [0.19444, 0.43056, 0, 0.08334], - 113: [0.19444, 0.43056, 0.03588, 0.08334], - 114: [0, 0.43056, 0.02778, 0.05556], - 115: [0, 0.43056, 0, 0.05556], - 116: [0, 0.61508, 0, 0.08334], - 117: [0, 0.43056, 0, 0.02778], - 118: [0, 0.43056, 0.03588, 0.02778], - 119: [0, 0.43056, 0.02691, 0.08334], - 120: [0, 0.43056, 0, 0.02778], - 121: [0.19444, 0.43056, 0.03588, 0.05556], - 122: [0, 0.43056, 0.04398, 0.05556], - 915: [0, 0.68333, 0.13889, 0.08334], - 916: [0, 0.68333, 0, 0.16667], - 920: [0, 0.68333, 0.02778, 0.08334], - 923: [0, 0.68333, 0, 0.16667], - 926: [0, 0.68333, 0.07569, 0.08334], - 928: [0, 0.68333, 0.08125, 0.05556], - 931: [0, 0.68333, 0.05764, 0.08334], - 933: [0, 0.68333, 0.13889, 0.05556], - 934: [0, 0.68333, 0, 0.08334], - 936: [0, 0.68333, 0.11, 0.05556], - 937: [0, 0.68333, 0.05017, 0.08334], - 945: [0, 0.43056, 0.0037, 0.02778], - 946: [0.19444, 0.69444, 0.05278, 0.08334], - 947: [0.19444, 0.43056, 0.05556, 0], - 948: [0, 0.69444, 0.03785, 0.05556], - 949: [0, 0.43056, 0, 0.08334], - 950: [0.19444, 0.69444, 0.07378, 0.08334], - 951: [0.19444, 0.43056, 0.03588, 0.05556], - 952: [0, 0.69444, 0.02778, 0.08334], - 953: [0, 0.43056, 0, 0.05556], - 954: [0, 0.43056, 0, 0], - 955: [0, 0.69444, 0, 0], - 956: [0.19444, 0.43056, 0, 0.02778], - 957: [0, 0.43056, 0.06366, 0.02778], - 958: [0.19444, 0.69444, 0.04601, 0.11111], - 959: [0, 0.43056, 0, 0.05556], - 960: [0, 0.43056, 0.03588, 0], - 961: [0.19444, 0.43056, 0, 0.08334], - 962: [0.09722, 0.43056, 0.07986, 0.08334], - 963: [0, 0.43056, 0.03588, 0], - 964: [0, 0.43056, 0.1132, 0.02778], - 965: [0, 0.43056, 0.03588, 0.02778], - 966: [0.19444, 0.43056, 0, 0.08334], - 967: [0.19444, 0.43056, 0, 0.05556], - 968: [0.19444, 0.69444, 0.03588, 0.11111], - 969: [0, 0.43056, 0.03588, 0], - 977: [0, 0.69444, 0, 0.08334], - 981: [0.19444, 0.69444, 0, 0.08334], - 982: [0, 0.43056, 0.02778, 0], - 1009: [0.19444, 0.43056, 0, 0.08334], - 1013: [0, 0.43056, 0, 0.05556], - }, - 'Math-Regular': { - 65: [0, 0.68333, 0, 0.13889], - 66: [0, 0.68333, 0.05017, 0.08334], - 67: [0, 0.68333, 0.07153, 0.08334], - 68: [0, 0.68333, 0.02778, 0.05556], - 69: [0, 0.68333, 0.05764, 0.08334], - 70: [0, 0.68333, 0.13889, 0.08334], - 71: [0, 0.68333, 0, 0.08334], - 72: [0, 0.68333, 0.08125, 0.05556], - 73: [0, 0.68333, 0.07847, 0.11111], - 74: [0, 0.68333, 0.09618, 0.16667], - 75: [0, 0.68333, 0.07153, 0.05556], - 76: [0, 0.68333, 0, 0.02778], - 77: [0, 0.68333, 0.10903, 0.08334], - 78: [0, 0.68333, 0.10903, 0.08334], - 79: [0, 0.68333, 0.02778, 0.08334], - 80: [0, 0.68333, 0.13889, 0.08334], - 81: [0.19444, 0.68333, 0, 0.08334], - 82: [0, 0.68333, 0.00773, 0.08334], - 83: [0, 0.68333, 0.05764, 0.08334], - 84: [0, 0.68333, 0.13889, 0.08334], - 85: [0, 0.68333, 0.10903, 0.02778], - 86: [0, 0.68333, 0.22222, 0], - 87: [0, 0.68333, 0.13889, 0], - 88: [0, 0.68333, 0.07847, 0.08334], - 89: [0, 0.68333, 0.22222, 0], - 90: [0, 0.68333, 0.07153, 0.08334], - 97: [0, 0.43056, 0, 0], - 98: [0, 0.69444, 0, 0], - 99: [0, 0.43056, 0, 0.05556], - 100: [0, 0.69444, 0, 0.16667], - 101: [0, 0.43056, 0, 0.05556], - 102: [0.19444, 0.69444, 0.10764, 0.16667], - 103: [0.19444, 0.43056, 0.03588, 0.02778], - 104: [0, 0.69444, 0, 0], - 105: [0, 0.65952, 0, 0], - 106: [0.19444, 0.65952, 0.05724, 0], - 107: [0, 0.69444, 0.03148, 0], - 108: [0, 0.69444, 0.01968, 0.08334], - 109: [0, 0.43056, 0, 0], - 110: [0, 0.43056, 0, 0], - 111: [0, 0.43056, 0, 0.05556], - 112: [0.19444, 0.43056, 0, 0.08334], - 113: [0.19444, 0.43056, 0.03588, 0.08334], - 114: [0, 0.43056, 0.02778, 0.05556], - 115: [0, 0.43056, 0, 0.05556], - 116: [0, 0.61508, 0, 0.08334], - 117: [0, 0.43056, 0, 0.02778], - 118: [0, 0.43056, 0.03588, 0.02778], - 119: [0, 0.43056, 0.02691, 0.08334], - 120: [0, 0.43056, 0, 0.02778], - 121: [0.19444, 0.43056, 0.03588, 0.05556], - 122: [0, 0.43056, 0.04398, 0.05556], - 915: [0, 0.68333, 0.13889, 0.08334], - 916: [0, 0.68333, 0, 0.16667], - 920: [0, 0.68333, 0.02778, 0.08334], - 923: [0, 0.68333, 0, 0.16667], - 926: [0, 0.68333, 0.07569, 0.08334], - 928: [0, 0.68333, 0.08125, 0.05556], - 931: [0, 0.68333, 0.05764, 0.08334], - 933: [0, 0.68333, 0.13889, 0.05556], - 934: [0, 0.68333, 0, 0.08334], - 936: [0, 0.68333, 0.11, 0.05556], - 937: [0, 0.68333, 0.05017, 0.08334], - 945: [0, 0.43056, 0.0037, 0.02778], - 946: [0.19444, 0.69444, 0.05278, 0.08334], - 947: [0.19444, 0.43056, 0.05556, 0], - 948: [0, 0.69444, 0.03785, 0.05556], - 949: [0, 0.43056, 0, 0.08334], - 950: [0.19444, 0.69444, 0.07378, 0.08334], - 951: [0.19444, 0.43056, 0.03588, 0.05556], - 952: [0, 0.69444, 0.02778, 0.08334], - 953: [0, 0.43056, 0, 0.05556], - 954: [0, 0.43056, 0, 0], - 955: [0, 0.69444, 0, 0], - 956: [0.19444, 0.43056, 0, 0.02778], - 957: [0, 0.43056, 0.06366, 0.02778], - 958: [0.19444, 0.69444, 0.04601, 0.11111], - 959: [0, 0.43056, 0, 0.05556], - 960: [0, 0.43056, 0.03588, 0], - 961: [0.19444, 0.43056, 0, 0.08334], - 962: [0.09722, 0.43056, 0.07986, 0.08334], - 963: [0, 0.43056, 0.03588, 0], - 964: [0, 0.43056, 0.1132, 0.02778], - 965: [0, 0.43056, 0.03588, 0.02778], - 966: [0.19444, 0.43056, 0, 0.08334], - 967: [0.19444, 0.43056, 0, 0.05556], - 968: [0.19444, 0.69444, 0.03588, 0.11111], - 969: [0, 0.43056, 0.03588, 0], - 977: [0, 0.69444, 0, 0.08334], - 981: [0.19444, 0.69444, 0, 0.08334], - 982: [0, 0.43056, 0.02778, 0], - 1009: [0.19444, 0.43056, 0, 0.08334], - 1013: [0, 0.43056, 0, 0.05556], - }, - 'SansSerif-Regular': { - 33: [0, 0.69444, 0, 0], - 34: [0, 0.69444, 0, 0], - 35: [0.19444, 0.69444, 0, 0], - 36: [0.05556, 0.75, 0, 0], - 37: [0.05556, 0.75, 0, 0], - 38: [0, 0.69444, 0, 0], - 39: [0, 0.69444, 0, 0], - 40: [0.25, 0.75, 0, 0], - 41: [0.25, 0.75, 0, 0], - 42: [0, 0.75, 0, 0], - 43: [0.08333, 0.58333, 0, 0], - 44: [0.125, 0.08333, 0, 0], - 45: [0, 0.44444, 0, 0], - 46: [0, 0.08333, 0, 0], - 47: [0.25, 0.75, 0, 0], - 48: [0, 0.65556, 0, 0], - 49: [0, 0.65556, 0, 0], - 50: [0, 0.65556, 0, 0], - 51: [0, 0.65556, 0, 0], - 52: [0, 0.65556, 0, 0], - 53: [0, 0.65556, 0, 0], - 54: [0, 0.65556, 0, 0], - 55: [0, 0.65556, 0, 0], - 56: [0, 0.65556, 0, 0], - 57: [0, 0.65556, 0, 0], - 58: [0, 0.44444, 0, 0], - 59: [0.125, 0.44444, 0, 0], - 61: [-0.13, 0.37, 0, 0], - 63: [0, 0.69444, 0, 0], - 64: [0, 0.69444, 0, 0], - 65: [0, 0.69444, 0, 0], - 66: [0, 0.69444, 0, 0], - 67: [0, 0.69444, 0, 0], - 68: [0, 0.69444, 0, 0], - 69: [0, 0.69444, 0, 0], - 70: [0, 0.69444, 0, 0], - 71: [0, 0.69444, 0, 0], - 72: [0, 0.69444, 0, 0], - 73: [0, 0.69444, 0, 0], - 74: [0, 0.69444, 0, 0], - 75: [0, 0.69444, 0, 0], - 76: [0, 0.69444, 0, 0], - 77: [0, 0.69444, 0, 0], - 78: [0, 0.69444, 0, 0], - 79: [0, 0.69444, 0, 0], - 80: [0, 0.69444, 0, 0], - 81: [0.125, 0.69444, 0, 0], - 82: [0, 0.69444, 0, 0], - 83: [0, 0.69444, 0, 0], - 84: [0, 0.69444, 0, 0], - 85: [0, 0.69444, 0, 0], - 86: [0, 0.69444, 0.01389, 0], - 87: [0, 0.69444, 0.01389, 0], - 88: [0, 0.69444, 0, 0], - 89: [0, 0.69444, 0.025, 0], - 90: [0, 0.69444, 0, 0], - 91: [0.25, 0.75, 0, 0], - 93: [0.25, 0.75, 0, 0], - 94: [0, 0.69444, 0, 0], - 95: [0.35, 0.09444, 0.02778, 0], - 97: [0, 0.44444, 0, 0], - 98: [0, 0.69444, 0, 0], - 99: [0, 0.44444, 0, 0], - 100: [0, 0.69444, 0, 0], - 101: [0, 0.44444, 0, 0], - 102: [0, 0.69444, 0.06944, 0], - 103: [0.19444, 0.44444, 0.01389, 0], - 104: [0, 0.69444, 0, 0], - 105: [0, 0.67937, 0, 0], - 106: [0.19444, 0.67937, 0, 0], - 107: [0, 0.69444, 0, 0], - 108: [0, 0.69444, 0, 0], - 109: [0, 0.44444, 0, 0], - 110: [0, 0.44444, 0, 0], - 111: [0, 0.44444, 0, 0], - 112: [0.19444, 0.44444, 0, 0], - 113: [0.19444, 0.44444, 0, 0], - 114: [0, 0.44444, 0.01389, 0], - 115: [0, 0.44444, 0, 0], - 116: [0, 0.57143, 0, 0], - 117: [0, 0.44444, 0, 0], - 118: [0, 0.44444, 0.01389, 0], - 119: [0, 0.44444, 0.01389, 0], - 120: [0, 0.44444, 0, 0], - 121: [0.19444, 0.44444, 0.01389, 0], - 122: [0, 0.44444, 0, 0], - 126: [0.35, 0.32659, 0, 0], - 305: [0, 0.44444, 0, 0], - 567: [0.19444, 0.44444, 0, 0], - 768: [0, 0.69444, 0, 0], - 769: [0, 0.69444, 0, 0], - 770: [0, 0.69444, 0, 0], - 771: [0, 0.67659, 0, 0], - 772: [0, 0.60889, 0, 0], - 774: [0, 0.69444, 0, 0], - 775: [0, 0.67937, 0, 0], - 776: [0, 0.67937, 0, 0], - 778: [0, 0.69444, 0, 0], - 779: [0, 0.69444, 0, 0], - 780: [0, 0.63194, 0, 0], - 915: [0, 0.69444, 0, 0], - 916: [0, 0.69444, 0, 0], - 920: [0, 0.69444, 0, 0], - 923: [0, 0.69444, 0, 0], - 926: [0, 0.69444, 0, 0], - 928: [0, 0.69444, 0, 0], - 931: [0, 0.69444, 0, 0], - 933: [0, 0.69444, 0, 0], - 934: [0, 0.69444, 0, 0], - 936: [0, 0.69444, 0, 0], - 937: [0, 0.69444, 0, 0], - 8211: [0, 0.44444, 0.02778, 0], - 8212: [0, 0.44444, 0.02778, 0], - 8216: [0, 0.69444, 0, 0], - 8217: [0, 0.69444, 0, 0], - 8220: [0, 0.69444, 0, 0], - 8221: [0, 0.69444, 0, 0], - }, - 'Script-Regular': { - 65: [0, 0.7, 0.22925, 0], - 66: [0, 0.7, 0.04087, 0], - 67: [0, 0.7, 0.1689, 0], - 68: [0, 0.7, 0.09371, 0], - 69: [0, 0.7, 0.18583, 0], - 70: [0, 0.7, 0.13634, 0], - 71: [0, 0.7, 0.17322, 0], - 72: [0, 0.7, 0.29694, 0], - 73: [0, 0.7, 0.19189, 0], - 74: [0.27778, 0.7, 0.19189, 0], - 75: [0, 0.7, 0.31259, 0], - 76: [0, 0.7, 0.19189, 0], - 77: [0, 0.7, 0.15981, 0], - 78: [0, 0.7, 0.3525, 0], - 79: [0, 0.7, 0.08078, 0], - 80: [0, 0.7, 0.08078, 0], - 81: [0, 0.7, 0.03305, 0], - 82: [0, 0.7, 0.06259, 0], - 83: [0, 0.7, 0.19189, 0], - 84: [0, 0.7, 0.29087, 0], - 85: [0, 0.7, 0.25815, 0], - 86: [0, 0.7, 0.27523, 0], - 87: [0, 0.7, 0.27523, 0], - 88: [0, 0.7, 0.26006, 0], - 89: [0, 0.7, 0.2939, 0], - 90: [0, 0.7, 0.24037, 0], - }, - 'Size1-Regular': { - 40: [0.35001, 0.85, 0, 0], - 41: [0.35001, 0.85, 0, 0], - 47: [0.35001, 0.85, 0, 0], - 91: [0.35001, 0.85, 0, 0], - 92: [0.35001, 0.85, 0, 0], - 93: [0.35001, 0.85, 0, 0], - 123: [0.35001, 0.85, 0, 0], - 125: [0.35001, 0.85, 0, 0], - 710: [0, 0.72222, 0, 0], - 732: [0, 0.72222, 0, 0], - 770: [0, 0.72222, 0, 0], - 771: [0, 0.72222, 0, 0], - 8214: [-99e-5, 0.601, 0, 0], - 8593: [1e-5, 0.6, 0, 0], - 8595: [1e-5, 0.6, 0, 0], - 8657: [1e-5, 0.6, 0, 0], - 8659: [1e-5, 0.6, 0, 0], - 8719: [0.25001, 0.75, 0, 0], - 8720: [0.25001, 0.75, 0, 0], - 8721: [0.25001, 0.75, 0, 0], - 8730: [0.35001, 0.85, 0, 0], - 8739: [-0.00599, 0.606, 0, 0], - 8741: [-0.00599, 0.606, 0, 0], - 8747: [0.30612, 0.805, 0.19445, 0], - 8748: [0.306, 0.805, 0.19445, 0], - 8749: [0.306, 0.805, 0.19445, 0], - 8750: [0.30612, 0.805, 0.19445, 0], - 8896: [0.25001, 0.75, 0, 0], - 8897: [0.25001, 0.75, 0, 0], - 8898: [0.25001, 0.75, 0, 0], - 8899: [0.25001, 0.75, 0, 0], - 8968: [0.35001, 0.85, 0, 0], - 8969: [0.35001, 0.85, 0, 0], - 8970: [0.35001, 0.85, 0, 0], - 8971: [0.35001, 0.85, 0, 0], - 9168: [-99e-5, 0.601, 0, 0], - 10216: [0.35001, 0.85, 0, 0], - 10217: [0.35001, 0.85, 0, 0], - 10752: [0.25001, 0.75, 0, 0], - 10753: [0.25001, 0.75, 0, 0], - 10754: [0.25001, 0.75, 0, 0], - 10756: [0.25001, 0.75, 0, 0], - 10758: [0.25001, 0.75, 0, 0], - }, - 'Size2-Regular': { - 40: [0.65002, 1.15, 0, 0], - 41: [0.65002, 1.15, 0, 0], - 47: [0.65002, 1.15, 0, 0], - 91: [0.65002, 1.15, 0, 0], - 92: [0.65002, 1.15, 0, 0], - 93: [0.65002, 1.15, 0, 0], - 123: [0.65002, 1.15, 0, 0], - 125: [0.65002, 1.15, 0, 0], - 710: [0, 0.75, 0, 0], - 732: [0, 0.75, 0, 0], - 770: [0, 0.75, 0, 0], - 771: [0, 0.75, 0, 0], - 8719: [0.55001, 1.05, 0, 0], - 8720: [0.55001, 1.05, 0, 0], - 8721: [0.55001, 1.05, 0, 0], - 8730: [0.65002, 1.15, 0, 0], - 8747: [0.86225, 1.36, 0.44445, 0], - 8748: [0.862, 1.36, 0.44445, 0], - 8749: [0.862, 1.36, 0.44445, 0], - 8750: [0.86225, 1.36, 0.44445, 0], - 8896: [0.55001, 1.05, 0, 0], - 8897: [0.55001, 1.05, 0, 0], - 8898: [0.55001, 1.05, 0, 0], - 8899: [0.55001, 1.05, 0, 0], - 8968: [0.65002, 1.15, 0, 0], - 8969: [0.65002, 1.15, 0, 0], - 8970: [0.65002, 1.15, 0, 0], - 8971: [0.65002, 1.15, 0, 0], - 10216: [0.65002, 1.15, 0, 0], - 10217: [0.65002, 1.15, 0, 0], - 10752: [0.55001, 1.05, 0, 0], - 10753: [0.55001, 1.05, 0, 0], - 10754: [0.55001, 1.05, 0, 0], - 10756: [0.55001, 1.05, 0, 0], - 10758: [0.55001, 1.05, 0, 0], - }, - 'Size3-Regular': { - 40: [0.95003, 1.45, 0, 0], - 41: [0.95003, 1.45, 0, 0], - 47: [0.95003, 1.45, 0, 0], - 91: [0.95003, 1.45, 0, 0], - 92: [0.95003, 1.45, 0, 0], - 93: [0.95003, 1.45, 0, 0], - 123: [0.95003, 1.45, 0, 0], - 125: [0.95003, 1.45, 0, 0], - 710: [0, 0.75, 0, 0], - 732: [0, 0.75, 0, 0], - 770: [0, 0.75, 0, 0], - 771: [0, 0.75, 0, 0], - 8730: [0.95003, 1.45, 0, 0], - 8968: [0.95003, 1.45, 0, 0], - 8969: [0.95003, 1.45, 0, 0], - 8970: [0.95003, 1.45, 0, 0], - 8971: [0.95003, 1.45, 0, 0], - 10216: [0.95003, 1.45, 0, 0], - 10217: [0.95003, 1.45, 0, 0], - }, - 'Size4-Regular': { - 40: [1.25003, 1.75, 0, 0], - 41: [1.25003, 1.75, 0, 0], - 47: [1.25003, 1.75, 0, 0], - 91: [1.25003, 1.75, 0, 0], - 92: [1.25003, 1.75, 0, 0], - 93: [1.25003, 1.75, 0, 0], - 123: [1.25003, 1.75, 0, 0], - 125: [1.25003, 1.75, 0, 0], - 710: [0, 0.825, 0, 0], - 732: [0, 0.825, 0, 0], - 770: [0, 0.825, 0, 0], - 771: [0, 0.825, 0, 0], - 8730: [1.25003, 1.75, 0, 0], - 8968: [1.25003, 1.75, 0, 0], - 8969: [1.25003, 1.75, 0, 0], - 8970: [1.25003, 1.75, 0, 0], - 8971: [1.25003, 1.75, 0, 0], - 9115: [0.64502, 1.155, 0, 0], - 9116: [1e-5, 0.6, 0, 0], - 9117: [0.64502, 1.155, 0, 0], - 9118: [0.64502, 1.155, 0, 0], - 9119: [1e-5, 0.6, 0, 0], - 9120: [0.64502, 1.155, 0, 0], - 9121: [0.64502, 1.155, 0, 0], - 9122: [-99e-5, 0.601, 0, 0], - 9123: [0.64502, 1.155, 0, 0], - 9124: [0.64502, 1.155, 0, 0], - 9125: [-99e-5, 0.601, 0, 0], - 9126: [0.64502, 1.155, 0, 0], - 9127: [1e-5, 0.9, 0, 0], - 9128: [0.65002, 1.15, 0, 0], - 9129: [0.90001, 0, 0, 0], - 9130: [0, 0.3, 0, 0], - 9131: [1e-5, 0.9, 0, 0], - 9132: [0.65002, 1.15, 0, 0], - 9133: [0.90001, 0, 0, 0], - 9143: [0.88502, 0.915, 0, 0], - 10216: [1.25003, 1.75, 0, 0], - 10217: [1.25003, 1.75, 0, 0], - 57344: [-0.00499, 0.605, 0, 0], - 57345: [-0.00499, 0.605, 0, 0], - 57680: [0, 0.12, 0, 0], - 57681: [0, 0.12, 0, 0], - 57682: [0, 0.12, 0, 0], - 57683: [0, 0.12, 0, 0], - }, - 'Typewriter-Regular': { - 33: [0, 0.61111, 0, 0], - 34: [0, 0.61111, 0, 0], - 35: [0, 0.61111, 0, 0], - 36: [0.08333, 0.69444, 0, 0], - 37: [0.08333, 0.69444, 0, 0], - 38: [0, 0.61111, 0, 0], - 39: [0, 0.61111, 0, 0], - 40: [0.08333, 0.69444, 0, 0], - 41: [0.08333, 0.69444, 0, 0], - 42: [0, 0.52083, 0, 0], - 43: [-0.08056, 0.53055, 0, 0], - 44: [0.13889, 0.125, 0, 0], - 45: [-0.08056, 0.53055, 0, 0], - 46: [0, 0.125, 0, 0], - 47: [0.08333, 0.69444, 0, 0], - 48: [0, 0.61111, 0, 0], - 49: [0, 0.61111, 0, 0], - 50: [0, 0.61111, 0, 0], - 51: [0, 0.61111, 0, 0], - 52: [0, 0.61111, 0, 0], - 53: [0, 0.61111, 0, 0], - 54: [0, 0.61111, 0, 0], - 55: [0, 0.61111, 0, 0], - 56: [0, 0.61111, 0, 0], - 57: [0, 0.61111, 0, 0], - 58: [0, 0.43056, 0, 0], - 59: [0.13889, 0.43056, 0, 0], - 60: [-0.05556, 0.55556, 0, 0], - 61: [-0.19549, 0.41562, 0, 0], - 62: [-0.05556, 0.55556, 0, 0], - 63: [0, 0.61111, 0, 0], - 64: [0, 0.61111, 0, 0], - 65: [0, 0.61111, 0, 0], - 66: [0, 0.61111, 0, 0], - 67: [0, 0.61111, 0, 0], - 68: [0, 0.61111, 0, 0], - 69: [0, 0.61111, 0, 0], - 70: [0, 0.61111, 0, 0], - 71: [0, 0.61111, 0, 0], - 72: [0, 0.61111, 0, 0], - 73: [0, 0.61111, 0, 0], - 74: [0, 0.61111, 0, 0], - 75: [0, 0.61111, 0, 0], - 76: [0, 0.61111, 0, 0], - 77: [0, 0.61111, 0, 0], - 78: [0, 0.61111, 0, 0], - 79: [0, 0.61111, 0, 0], - 80: [0, 0.61111, 0, 0], - 81: [0.13889, 0.61111, 0, 0], - 82: [0, 0.61111, 0, 0], - 83: [0, 0.61111, 0, 0], - 84: [0, 0.61111, 0, 0], - 85: [0, 0.61111, 0, 0], - 86: [0, 0.61111, 0, 0], - 87: [0, 0.61111, 0, 0], - 88: [0, 0.61111, 0, 0], - 89: [0, 0.61111, 0, 0], - 90: [0, 0.61111, 0, 0], - 91: [0.08333, 0.69444, 0, 0], - 92: [0.08333, 0.69444, 0, 0], - 93: [0.08333, 0.69444, 0, 0], - 94: [0, 0.61111, 0, 0], - 95: [0.09514, 0, 0, 0], - 96: [0, 0.61111, 0, 0], - 97: [0, 0.43056, 0, 0], - 98: [0, 0.61111, 0, 0], - 99: [0, 0.43056, 0, 0], - 100: [0, 0.61111, 0, 0], - 101: [0, 0.43056, 0, 0], - 102: [0, 0.61111, 0, 0], - 103: [0.22222, 0.43056, 0, 0], - 104: [0, 0.61111, 0, 0], - 105: [0, 0.61111, 0, 0], - 106: [0.22222, 0.61111, 0, 0], - 107: [0, 0.61111, 0, 0], - 108: [0, 0.61111, 0, 0], - 109: [0, 0.43056, 0, 0], - 110: [0, 0.43056, 0, 0], - 111: [0, 0.43056, 0, 0], - 112: [0.22222, 0.43056, 0, 0], - 113: [0.22222, 0.43056, 0, 0], - 114: [0, 0.43056, 0, 0], - 115: [0, 0.43056, 0, 0], - 116: [0, 0.55358, 0, 0], - 117: [0, 0.43056, 0, 0], - 118: [0, 0.43056, 0, 0], - 119: [0, 0.43056, 0, 0], - 120: [0, 0.43056, 0, 0], - 121: [0.22222, 0.43056, 0, 0], - 122: [0, 0.43056, 0, 0], - 123: [0.08333, 0.69444, 0, 0], - 124: [0.08333, 0.69444, 0, 0], - 125: [0.08333, 0.69444, 0, 0], - 126: [0, 0.61111, 0, 0], - 127: [0, 0.61111, 0, 0], - 305: [0, 0.43056, 0, 0], - 567: [0.22222, 0.43056, 0, 0], - 768: [0, 0.61111, 0, 0], - 769: [0, 0.61111, 0, 0], - 770: [0, 0.61111, 0, 0], - 771: [0, 0.61111, 0, 0], - 772: [0, 0.56555, 0, 0], - 774: [0, 0.61111, 0, 0], - 776: [0, 0.61111, 0, 0], - 778: [0, 0.61111, 0, 0], - 780: [0, 0.56597, 0, 0], - 915: [0, 0.61111, 0, 0], - 916: [0, 0.61111, 0, 0], - 920: [0, 0.61111, 0, 0], - 923: [0, 0.61111, 0, 0], - 926: [0, 0.61111, 0, 0], - 928: [0, 0.61111, 0, 0], - 931: [0, 0.61111, 0, 0], - 933: [0, 0.61111, 0, 0], - 934: [0, 0.61111, 0, 0], - 936: [0, 0.61111, 0, 0], - 937: [0, 0.61111, 0, 0], - 2018: [0, 0.61111, 0, 0], - 2019: [0, 0.61111, 0, 0], - 8242: [0, 0.61111, 0, 0], - }, - }; - const l = /[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/, - c = { - slant: [0.25, 0.25, 0.25], - space: [0, 0, 0], - stretch: [0, 0, 0], - shrink: [0, 0, 0], - xHeight: [0.431, 0.431, 0.431], - quad: [1, 1.171, 1.472], - extraSpace: [0, 0, 0], - num1: [0.677, 0.732, 0.925], - num2: [0.394, 0.384, 0.387], - num3: [0.444, 0.471, 0.504], - denom1: [0.686, 0.752, 1.025], - denom2: [0.345, 0.344, 0.532], - sup1: [0.413, 0.503, 0.504], - sup2: [0.363, 0.431, 0.404], - sup3: [0.289, 0.286, 0.294], - sub1: [0.15, 0.143, 0.2], - sub2: [0.247, 0.286, 0.4], - supDrop: [0.386, 0.353, 0.494], - subDrop: [0.05, 0.071, 0.1], - delim1: [2.39, 1.7, 1.98], - delim2: [1.01, 1.157, 1.42], - axisHeight: [0.25, 0.25, 0.25], - }, - h = { - defaultRuleThickness: 0.04, - bigOpSpacing1: 0.111, - bigOpSpacing2: 0.166, - bigOpSpacing3: 0.2, - bigOpSpacing4: 0.6, - bigOpSpacing5: 0.1, - ptPerEm: 10, - pxPerEm: 40 / 3, - doubleRuleSep: 0.2, - arraycolsep: 0.5, - baselineskip: 1.2, - arrayrulewidth: 0.04, - fboxsep: 0.3, - fboxrule: 0.04, - }, - d = { - ' ': ' ', - '​': ' ', - Å: 'A', - Ç: 'C', - Ð: 'D', - Þ: 'o', - å: 'a', - ç: 'c', - ð: 'd', - þ: 'o', - А: 'A', - Б: 'B', - В: 'B', - Г: 'F', - Д: 'A', - Е: 'E', - Ж: 'K', - З: '3', - И: 'N', - Й: 'N', - К: 'K', - Л: 'N', - М: 'M', - Н: 'H', - О: 'O', - П: 'N', - Р: 'P', - С: 'C', - Т: 'T', - У: 'y', - Ф: 'O', - Х: 'X', - Ц: 'U', - Ч: 'h', - Ш: 'W', - Щ: 'W', - Ъ: 'B', - Ы: 'X', - Ь: 'B', - Э: '3', - Ю: 'X', - Я: 'R', - а: 'a', - б: 'b', - в: 'a', - г: 'r', - д: 'y', - е: 'e', - ж: 'm', - з: 'e', - и: 'n', - й: 'n', - к: 'n', - л: 'n', - м: 'm', - н: 'n', - о: 'o', - п: 'n', - р: 'p', - с: 'c', - т: 'o', - у: 'y', - ф: 'b', - х: 'x', - ц: 'n', - ч: 'n', - ш: 'w', - щ: 'w', - ъ: 'a', - ы: 'm', - ь: 'a', - э: 'e', - ю: 'm', - я: 'r', - }; - function p(t, e, i) { - if ('string' == typeof t) { - const i = t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/); - i - ? ((t = parseFloat(i[1])), (e = i[2].toLowerCase())) - : (t = parseFloat(t)); - } - const s = - { - pt: 1, - mm: 7227 / 2540, - cm: 7227 / 254, - ex: 35271 / 8192, - px: 0.75, - em: h.ptPerEm, - bp: 1.00375, - dd: 1238 / 1157, - pc: 12, - in: 72.27, - mu: 10 / 18, - }[e] || 1; - if (isFinite(i)) { - const e = Math.pow(10, i); - return Math.round((t / h.ptPerEm) * s * e) / e; - } - return (t / h.ptPerEm) * s; - } - var m = { - toEm: p, - toPx: function(t, e) { - return p(t, e) * (4 / 3) * h.ptPerEm; - }, - METRICS: h, - SIGMAS: c, - getCharacterMetrics: function(t, e) { - const i = - { - cal: 'Caligraphic-Regular', - ams: 'AMS-Regular', - frak: 'Fraktur-Regular', - bb: 'AMS-Regular', - scr: 'Script-Regular', - cmr: 'Main-Regular', - cmtt: 'Typewriter-Regular', - cmss: 'SansSerif-Regular', - }[e] || e; - let s = t.charCodeAt(0); - t[0] in d - ? (s = d[t[0]].charCodeAt(0)) - : l.test(t[0]) && (s = 77); - const a = r[i][s]; - return a - ? a - ? { - depth: a[0], - height: a[1], - italic: a[2], - skew: a[3], - } - : null - : { - defaultMetrics: !0, - depth: 0.2, - height: 0.7, - italic: 0, - skew: 0, - }; - }, - }; - const u = [{}, {}, {}]; - let f; - for (const t in c) - if (Object.prototype.hasOwnProperty.call(c, t)) - for (f = 0; f < 3; f++) u[f][t] = c[t][f]; - for (f = 0; f < 3; f++) u[f].emPerEx = c.xHeight[f] / c.quad[f]; - class g { - constructor(t, e, i, s) { - (this.id = t), - (this.size = e), - (this.cramped = s), - (this.sizeMultiplier = i), - (this.metrics = u[e > 0 ? e - 1 : 0]); - } - sup() { - return y[k[this.id]]; - } - sub() { - return y[v[this.id]]; - } - fracNum() { - return y[w[this.id]]; - } - fracDen() { - return y[S[this.id]]; - } - cramp() { - return y[A[this.id]]; - } - cls() { - return b[this.size]; - } - adjustTo(t) { - let e = x[this.size][t.size]; - return e.length > 0 && (e = ' ' + e), e; - } - isTight() { - return this.size >= 2; - } - } - const y = [ - new g(0, 0, 1, !1), - new g(1, 0, 1, !0), - new g(2, 1, 1, !1), - new g(3, 1, 1, !0), - new g(4, 2, 0.7, !1), - new g(5, 2, 0.7, !0), - new g(6, 3, 0.5, !1), - new g(7, 3, 0.5, !0), - ], - b = [ - 'displaystyle textstyle', - 'textstyle', - 'scriptstyle', - 'scriptscriptstyle', - ], - x = [ - [ - '', - '', - 'reset-textstyle scriptstyle', - 'reset-textstyle scriptscriptstyle', - ], - [ - 'reset-textstyle displaystyle textstyle', - '', - 'reset-textstyle scriptstyle', - 'reset-textstyle scriptscriptstyle', - ], - [ - 'reset-scriptstyle textstyle displaystyle', - 'reset-scriptstyle textstyle', - '', - 'reset-scriptstyle scriptscriptstyle', - ], - [ - 'reset-scriptscriptstyle textstyle displaystyle', - 'reset-scriptscriptstyle textstyle', - 'reset-scriptscriptstyle scriptstyle', - '', - ], - ], - k = [4, 5, 4, 5, 6, 7, 6, 7], - v = [5, 5, 5, 5, 7, 7, 7, 7], - w = [2, 3, 4, 5, 6, 7, 6, 7], - S = [3, 3, 5, 5, 7, 7, 7, 7], - A = [1, 1, 3, 3, 5, 5, 7, 7]; - var M = { - DISPLAY: y[0], - TEXT: y[2], - SCRIPT: y[4], - SCRIPTSCRIPT: y[6], - toMathstyle: function(t) { - return t - ? 'object' == typeof t - ? t - : { - displaystyle: y[0], - textstyle: y[2], - scriptstyle: y[4], - scriptscriptstyle: y[6], - }[t] - : t; - }, - }; - class C { - constructor(t) { - (this.macros = t.macros || {}), - (this.generateID = !!t.generateID && t.generateID), - (this.mathstyle = M.toMathstyle( - t.mathstyle || 'displaystyle' - )), - (this.size = t.size || 'size5'), - (this.parentMathstyle = - t.parentMathstyle || this.mathstyle), - (this.parentSize = t.parentSize || this.size), - (this.opacity = t.opacity); - } - clone(t) { - const e = new C(this); - return ( - (e.parentMathstyle = this.mathstyle), - (e.parentSize = this.size), - (e.macros = this.macros), - t && - (('auto' !== t.mathstyle && t.mathstyle) || - delete t.mathstyle, - Object.assign(e, t), - 'string' == typeof t.mathstyle && - (e.mathstyle = M.toMathstyle(t.mathstyle))), - e - ); - } - setMathstyle(t) { - t && 'auto' !== t && (this.mathstyle = M.toMathstyle(t)); - } - cramp() { - return this.clone({ mathstyle: this.mathstyle.cramp() }); - } - sup() { - return this.clone({ mathstyle: this.mathstyle.sup() }); - } - sub() { - return this.clone({ mathstyle: this.mathstyle.sup() }); - } - } - var _ = C; - function T(t) { - let e = ''; - if ('number' == typeof t) e += Math.floor(100 * t) / 100; - else if ('string' == typeof t) e += t; - else if (Array.isArray(t)) for (const i of t) e += T(i); - else t && (e += t.toString()); - return e; - } - class L { - constructor(t, e) { - (this.classes = e || ''), - Array.isArray(t) - ? (this.children = [].concat.apply([], t)) - : 'string' == typeof t - ? (this.body = t) - : t && 'object' == typeof t && (this.children = [t]), - (this.style = null), - this.updateDimensions(); - } - updateDimensions() { - let t = 0, - e = 0, - i = 1; - this.children && - this.children.forEach(s => { - s.height > t && (t = s.height), - s.depth > e && (e = s.depth), - s.maxFontSize > i && (i = s.maxFontSize); - }), - (this.height = t), - (this.depth = e), - (this.maxFontSize = i); - } - selected(t) { - t && - !/ML__selected/.test(this.classes) && - (this.classes.length > 0 && (this.classes += ' '), - (this.classes += 'ML__selected')), - !t && - /ML__selected/.test(this.classes) && - (this.classes = this.classes.replace( - 'ML__selected', - '' - )), - this.children && this.children.forEach(e => e.selected(t)); - } - applyStyle(t) { - if (!t) return; - if ( - (t.color && - ('none' !== t.color - ? this.setStyle('color', t.color) - : this.setStyle('color', '')), - t.backgroundColor && - ('none' !== t.backgroundColor - ? this.setStyle( - 'background-color', - t.backgroundColor - ) - : this.setStyle('background-color', '')), - t.cssClass && (this.classes += ' ' + t.cssClass), - !this.body) - ) - return; - let e = t.fontFamily; - 'math' === e && 'n' === t.fontShape && (e = 'cmr'); - let i = 'Main-Regular'; - if ( - (e && - (i = (function(t, e) { - if ( - 'string' != typeof t || - t.length > 1 || - '​' === t - ) - return R[e]; - if ('bb' === e || 'scr' === e) { - if (!/^[A-Z ]$/.test(t)) return null; - } else if ('cal' === e) { - if (!/^[0-9A-Z ]$/.test(t)) return null; - } else if ('frak' === e) { - if ( - !/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test( - t - ) - ) - return null; - } else if ( - ('cmtt' === e || 'cmss' === e) && - !/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test( - t - ) - ) - return null; - return R[e]; - })(this.body, e)), - t.fontShape && - (this.classes += - ' ' + - ({ - it: 'ML__it', - sl: 'ML__shape_sl', - sc: 'ML__shape_sc', - ol: 'ML__shape_ol', - }[t.fontShape] || '')), - t.fontSeries) - ) { - const e = t.fontSeries.match(/(.?[lbm])?(.?[cx])?/); - e && - ((this.classes += - ' ' + - ({ - ul: 'ML__series_ul', - el: 'ML__series_el', - l: 'ML__series_l', - sl: 'ML__series_sl', - m: '', - sb: 'ML__series_sb', - b: 'ML__bold', - eb: 'ML__series_eb', - ub: 'ML__series_ub', - }[e[1] || ''] || '')), - (this.classes += - ' ' + - ({ - uc: 'ML__series_uc', - ec: 'ML__series_ec', - c: 'ML__series_c', - sc: 'ML__series_sc', - n: '', - sx: 'ML__series_sx', - x: 'ML__series_x', - ex: 'ML__series_ex', - ux: 'ML__series_ux', - }[e[2] || ''] || ''))); - } - if ( - (K[e] - ? (this.classes += ' ' + K[e]) - : e && this.setStyle('font-family', e), - this.body && this.body.length > 0 && i) - ) { - (this.height = 0), - (this.depth = 0), - (this.maxFontSize = - { - size1: 0.5, - size2: 0.7, - size3: 0.8, - size4: 0.9, - size5: 1, - size6: 1.2, - size7: 1.44, - size8: 1.73, - size9: 2.07, - size10: 2.49, - }[t.fontSize] || 1), - (this.skew = 0), - (this.italic = 0); - for (let t = 0; t < this.body.length; t++) { - const e = m.getCharacterMetrics(this.body.charAt(t), i); - e && - ((this.height = Math.max(this.height, e.height)), - (this.depth = Math.max(this.depth, e.depth)), - (this.skew = e.skew), - (this.italic = e.italic)); - } - } - } - setStyle(t, ...e) { - const i = T(e); - i.length > 0 && - (this.style || (this.style = {}), (this.style[t] = i)); - } - setTop(t) { - t && - 0 !== t && - (this.style || (this.style = {}), - (this.style.top = T(t) + 'em'), - (this.height -= t), - (this.depth += t)); - } - setLeft(t) { - t && - 0 !== t && - (this.style || (this.style = {}), - (this.style['margin-left'] = T(t) + 'em')); - } - setRight(t) { - t && - 0 !== t && - (this.style || (this.style = {}), - (this.style['margin-right'] = T(t) + 'em')); - } - setWidth(t) { - t && - 0 !== t && - (this.style || (this.style = {}), - (this.style.width = T(t) + 'em')); - } - addMarginRight(t) { - if (t && 0 !== t) { - if ( - !this.style && - !/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test( - this.classes - ) - ) { - const e = { - 2: 'qquad', - 1: 'quad', - '.5': 'enspace', - 0.277778: 'thickspace', - 0.222222: 'mediumspace', - 0.166667: 'thinspace', - '-0.166667': 'negativethinspace', - }[t.toString()]; - if (e) return void (this.classes += ' rspace ' + e); - } - this.style || (this.style = {}); - const e = parseFloat(this.style['margin-right'] || '0'); - this.style['margin-right'] = T(e + t) + 'em'; - } - } - toMarkup(t, e) { - (t = t || 0), (e = e || 1); - let i = '', - s = this.body || ''; - if (this.children) { - let t = 'none'; - for (const i of this.children) { - let a = 0; - if (t) { - let s = i.type; - s && - ('textord' === s && (s = 'mord'), - 'first' === s && (s = 'none'), - (a = i.isTight - ? E[t + '+' + s] || 0 - : F[t + '+' + s] || 0), - (a = Math.floor(e * a))); - } - (s += i.toMarkup(a, e)), (t = q(i)); - } - } - if ( - ('​' !== s && s) || - (this.classes && 'ML__selected' !== this.classes) - ) { - if ( - ((i = ' 1 - ? e - .filter(function(t, e, i) { - return ( - t.length > 0 && i.indexOf(t) === e - ); - }) - .join(' ') - : e[0]), - a.length > 0 && (i += ' class="' + a + '"'), - t && - (this.style && this.style['margin-left'] - ? (this.style['margin-left'] = - T( - parseFloat( - this.style['margin-left'] - ) + - t / 18 - ) + 'em') - : t < 0 && z[-t] - ? (s = z[-t] + s) - : D[t] - ? (s = D[t] + s) - : (this.style || (this.style = {}), - (this.style['margin-left'] = - T(t / 18) + 'em'))), - this.style) - ) { - let t = ''; - const e = /ML__selected/.test(this.classes); - for (const i in this.style) - Object.prototype.hasOwnProperty.call( - this.style, - i - ) && - (('background-color' === i && e) || - (t += i + ':' + this.style[i] + ';')); - t.length > 0 && (i += ' style="' + t + '"'); - } - (i += '>'), - this.svgOverlay - ? ((i += ''), - (i += s), - (i += ''), - (i += ' 0, - i = t.children && t.children.length > 0; - if (e || i) return !1; - if ( - (this.style ? this.style.length : 0) !== - (t.style ? t.style.length : 0) - ) - return !1; - const s = this.classes - .trim() - .replace(/\s+/g, ' ') - .split(' '), - a = t.classes - .trim() - .replace(/\s+/g, ' ') - .split(' '); - if (s.length !== a.length) return !1; - s.sort(), a.sort(); - for (let t = 0; t < s.length; t++) { - if ('vertical-separator' === s[t]) return !1; - if (s[t] !== a[t]) return !1; - } - if (this.style && t.style) - for (const e in this.style) - if ( - Object.prototype.hasOwnProperty.call( - this.style, - e - ) && - Object.prototype.hasOwnProperty.call(t.style, e) && - this.style[e] !== t.style[e] - ) - return !1; - return ( - (this.body += t.body), - (this.height = Math.max(this.height, t.height)), - (this.depth = Math.max(this.depth, t.depth)), - (this.maxFontSize = Math.max( - this.maxFontSize, - t.maxFontSize - )), - (this.italic = t.italic), - !0 - ); - } - } - const F = { - 'mord+mop': 3, - 'mord+mbin': 4, - 'mord+mrel': 5, - 'mord+minner': 3, - 'mop+mord': 3, - 'mop+mop': 3, - 'mop+mbin': 5, - 'mop+minner': 3, - 'mbin+mord': 4, - 'mbin+mop': 4, - 'mbin+mopen': 4, - 'mbin+minner': 4, - 'mrel+mord': 5, - 'mrel+mop': 5, - 'mrel+mopen': 5, - 'mrel+minner': 5, - 'mclose+mop': 3, - 'mclose+mbin': 4, - 'mclose+mrel': 5, - 'mclose+minner': 3, - 'mpunct+mord': 3, - 'mpunct+mop': 3, - 'mpunct+mbin': 4, - 'mpunct+mrel': 5, - 'mpunct+mopen': 3, - 'mpunct+mpunct': 3, - 'mpunct+minner': 3, - }, - D = ['​', ' ', '  ', ' ', ' ', '  ', ' ', '', '', ' '], - z = ['', ' ⁣', '', ' ⁣', ' ⁣', ' ⁣'], - E = { - 'mord+mop': 3, - 'mop+mord': 3, - 'mop+mop': 3, - 'mclose+mop': 3, - 'minner+mop': 3, - }; - function q(t) { - const e = t.type; - return 'first' === e ? 'none' : 'textord' === e ? 'mord' : e; - } - function I(t) { - return t - ? Array.isArray(t) - ? t.reduce((t, e) => Math.max(t, e.height), 0) - : t.height - : 0; - } - function P(t) { - return t - ? Array.isArray(t) - ? t.reduce((t, e) => Math.max(t, e.depth), 0) - : t.depth - : 0; - } - function O(t, e) { - if (Array.isArray(t)) { - const i = []; - for (const e of t) e && i.push(e); - if (1 === i.length) return O(i[0], e); - } - return new L(t, e); - } - function B(t, e, i) { - const s = O(e, i); - return (s.type = t), s; - } - function $(t, e) { - if (!e || 0 === e.length) { - if (t instanceof L) return t; - if (Array.isArray(t) && 1 === t.length) return t[0]; - } - const i = new L(t, e); - let s = 1; - return ( - (s = - t instanceof L - ? t.maxFontSize - : t.reduce((t, e) => Math.max(t, e.maxFontSize), 0)), - (i.height *= s), - (i.depth *= s), - i - ); - } - const R = { - ams: 'AMS-Regular', - bb: 'AMS-Regular', - cal: 'Caligraphic-Regular', - frak: 'Fraktur-Regular', - scr: 'Script-Regular', - cmr: 'Main-Regular', - cmss: 'SansSerif-Regular', - cmtt: 'Typewriter-Regular', - math: 'Math-Regular', - mainit: 'Main-Italic', - }, - K = { - ams: 'ML__ams', - bb: 'ML__bb', - cal: 'ML__cal', - frak: 'ML__frak', - scr: 'ML__script', - cmr: 'ML__mathrm', - cmss: 'ML__sans', - cmtt: 'ML__tt', - math: 'ML__mathit', - mainit: 'ML__mainit', - }; - var N = { - coalesce: function t(e) { - if (!e || 0 === e.length) return []; - e[0].children = t(e[0].children); - const i = [e[0]]; - for (let s = 1; s < e.length; s++) - i[i.length - 1].tryCoalesceWith(e[s]) || - ((e[s].children = t(e[s].children)), i.push(e[s])); - return i; - }, - makeSpan: O, - makeOp: function(t, e) { - return B('mop', t, e); - }, - makeOrd: function(t, e) { - return B('mord', t, e); - }, - makeRel: function(t, e) { - return B('mrel', t, e); - }, - makeClose: function(t, e) { - return B('mclose', t, e); - }, - makeOpen: function(t, e) { - return B('mopen', t, e); - }, - makeInner: function(t, e) { - return B('minner', t, e); - }, - makePunct: function(t, e) { - return B('mpunct', t, e); - }, - makeSpanOfType: B, - makeSymbol: function(t, e, i) { - const s = new L(e, i), - a = m.getCharacterMetrics(e, t); - return ( - (s.height = a.height), - (s.depth = a.depth), - (s.skew = a.skew), - (s.italic = a.italic), - s.setRight(s.italic), - s - ); - }, - makeVlist: function(t, e, i, s) { - let a = 0, - o = 0; - (i = i || 'shift'), (s = s || 0); - for (let t = 0; t < e.length; t++) - Array.isArray(e[t]) && - (1 === e[t].length - ? (e[t] = e[t][0]) - : (e[t] = O(e[t]))); - if ('shift' === i) a = -e[0].depth - s; - else if ('bottom' === i) a = -s; - else if ('top' === i) { - let t = s; - for (const i of e) - t -= i instanceof L ? i.height + i.depth : i; - a = t; - } else if ('individualShift' === i) { - const t = e; - (e = [t[0]]), (a = -t[1] - t[0].depth), (o = a); - for (let i = 2; i < t.length; i += 2) { - const s = -t[i + 1] - o - t[i].depth; - o += s; - const a = s - (t[i - 2].height + t[i - 2].depth); - e.push(a), e.push(t[i]); - } - } - let n = 1; - for (const t of e) - t instanceof L && (n = Math.max(n, t.maxFontSize)); - const r = (function(t, e) { - const i = e ? e / t.mathstyle.sizeMultiplier : 0, - s = new L('​'); - return ( - 1 !== i && - (s.setStyle('font-size', i, i > 0 ? 'em' : ''), - (s.attributes = { 'aria-hidden': !0 })), - 'size5' !== t.size - ? new L( - s, - 'fontsize-ensurer reset-' + - t.size + - ' size5' - ) - : 0 !== i - ? s - : null - ); - })(t, n), - l = []; - o = a; - for (const t of e) - if ('number' == typeof t) o += t; - else { - const e = O([r, t]); - e.setTop(-t.depth - o), - l.push(e), - (o += t.height + t.depth); - } - const c = O(l, 'vlist'); - return ( - (c.depth = Math.max(a, P(c) || 0)), - (c.height = Math.max(-o, I(c) || 0)), - c - ); - }, - makeHlist: $, - makeStyleWrap: function(t, e, i, s, a) { - a = a || ''; - const o = $(e, (a += ' style-wrap ') + i.adjustTo(s)); - o.type = t; - const n = s.sizeMultiplier / i.sizeMultiplier; - return ( - (o.height *= n), - (o.depth *= n), - (o.maxFontSize = s.sizeMultiplier), - o - ); - }, - makeSVG: function(t, e, i) { - return (t.svgOverlay = e), (t.svgStyle = i), t; - }, - height: I, - depth: P, - skew: function(t) { - if (!t) return 0; - if (Array.isArray(t)) { - let e = 0; - for (const i of t) e += i.skew || 0; - return e; - } - return t.skew; - }, - italic: function(t) { - return t - ? Array.isArray(t) - ? t[t.length - 1].italic - : t.italic - : 0; - }, - }; - let W = ''; - const H = {}, - V = {}, - U = {}, - j = 'CRYPTIC', - G = 'COMMON', - Z = 'SUPERCOMMON', - X = { - CRYPTIC: 0, - ARCANE: 200, - VERY_RARE: 600, - RARE: 1200, - UNCOMMON: 2e3, - COMMON: 3e3, - SUPERCOMMON: 4e3, - }; - function J(t, ...e) { - const i = 'string' == typeof t ? X[t] : t; - for (const t of e) - H[t] && (H[t].frequency = i), - V[t] && - ((V[t] = Object.assign({}, V[t])), - (V[t].frequency = i)); - } - function Y(t, e, i, s, a) { - e && /^(ams|cmr|bb|cal|frak|scr)$/.test(e), - 'string' == typeof a && (a = X[a]), - (H[t] = { - type: i === rt ? lt : i, - baseFontFamily: e, - value: s, - category: W, - frequency: a, - }); - } - function Q(t, e) { - for (let i = t; i <= e; i++) { - const t = String.fromCodePoint(i); - Y(t, '', 'mord', t); - } - } - const tt = { - 8739: '|', - 183: '\\cdot', - 188: '\\frac{1}{4}', - 189: '\\frac{1}{2}', - 190: '\\frac{3}{4}', - 8304: '^{0}', - 8305: '^{i}', - 185: '^{1}', - 178: '^{2}', - 179: '^{3}', - 8308: '^{4}', - 8309: '^{5}', - 8310: '^{6}', - 8311: '^{7}', - 8312: '^{8}', - 8313: '^{9}', - 8314: '^{+}', - 8315: '^{-}', - 8316: '^{=}', - 8319: '^{n}', - 8320: '_{0}', - 8321: '_{1}', - 8322: '_{2}', - 8323: '_{3}', - 8324: '_{4}', - 8325: '_{5}', - 8326: '_{6}', - 8327: '_{7}', - 8328: '_{8}', - 8329: '_{9}', - 8330: '_{+}', - 8331: '_{-}', - 8332: '_{=}', - 8336: '_{a}', - 8337: '_{e}', - 8338: '_{o}', - 8339: '_{x}', - 8242: '\\prime', - 8243: '\\doubleprime', - 8736: '\\angle', - 8450: '\\C', - 8469: '\\N', - 8473: '\\P', - 8474: '\\Q', - 8477: '\\R', - 8484: '\\Z', - }; - function et(t, e) { - const i = String.fromCodePoint(e); - if ('math' === t && tt[i]) return tt[i]; - if (e > 32 && e < 127) return i; - let s = ''; - if ('math' === t) { - for (const t in H) - if ( - Object.prototype.hasOwnProperty.call(H, t) && - H[t].value === i - ) { - s = t; - break; - } - } else - for (const t in vt) - if ( - Object.prototype.hasOwnProperty.call(vt, t) && - vt[t] === i - ) { - s = t; - break; - } - return s || i; - } - const it = { - 119893: 8462, - 119965: 8492, - 119968: 8496, - 119969: 8497, - 119971: 8459, - 119972: 8464, - 119975: 8466, - 119976: 8499, - 119981: 8475, - 119994: 8495, - 119996: 8458, - 120004: 8500, - 120070: 8493, - 120075: 8460, - 120076: 8465, - 120085: 8476, - 120093: 8488, - 120122: 8450, - 120127: 8461, - 120133: 8469, - 120135: 8473, - 120136: 8474, - 120137: 8477, - 120145: 8484, - }, - st = [ - { start: 119808, len: 26, offset: 65, style: 'bold' }, - { start: 119834, len: 26, offset: 97, style: 'bold' }, - { start: 119860, len: 26, offset: 65, style: 'italic' }, - { start: 119886, len: 26, offset: 97, style: 'italic' }, - { start: 119912, len: 26, offset: 65, style: 'bolditalic' }, - { start: 119938, len: 26, offset: 97, style: 'bolditalic' }, - { start: 119964, len: 26, offset: 65, variant: 'script' }, - { start: 119990, len: 26, offset: 97, variant: 'script' }, - { - start: 120016, - len: 26, - offset: 65, - variant: 'script', - style: 'bold', - }, - { - start: 120042, - len: 26, - offset: 97, - variant: 'script', - style: 'bold', - }, - { start: 120068, len: 26, offset: 65, variant: 'fraktur' }, - { start: 120094, len: 26, offset: 97, variant: 'fraktur' }, - { - start: 120172, - len: 26, - offset: 65, - variant: 'fraktur', - style: 'bold', - }, - { - start: 120198, - len: 26, - offset: 97, - variant: 'fraktur', - style: 'bold', - }, - { - start: 120120, - len: 26, - offset: 65, - variant: 'double-struck', - }, - { - start: 120146, - len: 26, - offset: 97, - variant: 'double-struck', - }, - { start: 120224, len: 26, offset: 65, variant: 'sans-serif' }, - { start: 120250, len: 26, offset: 97, variant: 'sans-serif' }, - { - start: 120276, - len: 26, - offset: 65, - variant: 'sans-serif', - style: 'bold', - }, - { - start: 120302, - len: 26, - offset: 97, - variant: 'sans-serif', - style: 'bold', - }, - { - start: 120328, - len: 26, - offset: 65, - variant: 'sans-serif', - style: 'italic', - }, - { - start: 120354, - len: 26, - offset: 97, - variant: 'sans-serif', - style: 'italic', - }, - { - start: 120380, - len: 26, - offset: 65, - variant: 'sans-serif', - style: 'bolditalic', - }, - { - start: 120406, - len: 26, - offset: 97, - variant: 'sans-serif', - style: 'bolditalic', - }, - { start: 120432, len: 26, offset: 65, variant: 'monospace' }, - { start: 120458, len: 26, offset: 97, variant: 'monospace' }, - { start: 120488, len: 25, offset: 913, style: 'bold' }, - { start: 120514, len: 25, offset: 945, style: 'bold' }, - { start: 120546, len: 25, offset: 913, style: 'italic' }, - { start: 120572, len: 25, offset: 945, style: 'italic' }, - { start: 120604, len: 25, offset: 913, style: 'bolditalic' }, - { start: 120630, len: 25, offset: 945, style: 'bolditalic' }, - { - start: 120662, - len: 25, - offset: 913, - variant: 'sans-serif', - style: 'bold', - }, - { - start: 120688, - len: 25, - offset: 945, - variant: 'sans-serif', - style: 'bold', - }, - { - start: 120720, - len: 25, - offset: 913, - variant: 'sans-serif', - style: 'bolditalic', - }, - { - start: 120746, - len: 25, - offset: 945, - variant: 'sans-serif', - style: 'bolditalic', - }, - { - start: 120782, - len: 10, - offset: 48, - variant: '', - style: 'bold', - }, - { - start: 120792, - len: 10, - offset: 48, - variant: 'double-struck', - }, - { start: 120803, len: 10, offset: 48, variant: 'sans-serif' }, - { - start: 120812, - len: 10, - offset: 48, - variant: 'sans-serif', - style: 'bold', - }, - { start: 120822, len: 10, offset: 48, variant: 'monospace' }, - ]; - function at(t) { - let e = t; - if ( - ('string' == typeof t && (e = t.codePointAt(0)), - (e < 119808 || e > 120831) && (e < 8448 || e > 8527)) - ) - return { char: t }; - for (const t in it) - if ( - Object.prototype.hasOwnProperty.call(it, t) && - it[t] === e - ) { - e = t; - break; - } - for (let t = 0; t < st.length; t++) - if (e >= st[t].start && e < st[t].start + st[t].len) - return { - char: String.fromCodePoint( - e - st[t].start + st[t].offset - ), - variant: st[t].variant, - style: st[t].style, - }; - return { char: t }; - } - function ot(t, e) { - if ('text' === t) return String.fromCodePoint(e); - let i; - if (tt[e]) return tt[e]; - const s = at(e); - return s.style || s.variant - ? ((i = s.char), - s.variant && (i = '\\' + s.variant + '{' + i + '}'), - 'bold' === s.style - ? (i = '\\mathbf{' + i + '}') - : 'italic' === s.style - ? (i = '\\mathit{' + i + '}') - : 'bolditalic' === s.style && - (i = '\\mathbf{\\mathit{' + i + '}}'), - '\\mathord{' + i + '}') - : et(t, e); - } - const nt = 'ams', - rt = 'mord', - lt = 'mord', - ct = 'mbin', - ht = 'mrel', - dt = 'mopen', - pt = 'mclose', - mt = 'spacing'; - function ut(t, e) { - let i = t.match(/=(.+)/), - s = '{}', - a = 'auto', - o = null; - return ( - i && (s = i[1]), - (i = t.match(/:([^=]+)/)), - i && (a = i[1].trim()), - (i = t.match(/^([^:=]+)/)), - i && (o = i[1].trim()), - { optional: e, type: a, defaultValue: s, placeholder: o } - ); - } - function ft(t) { - if (!t || 0 === t.length) return []; - let e = [], - i = t.split(']'); - if ('[' === i[0].charAt(0)) { - e.push(ut(i[0].slice(1), !0)); - for (let t = 1; t <= i.length; t++) e = e.concat(ft(i[t])); - } else if (((i = t.split('}')), '{' === i[0].charAt(0))) { - e.push(ut(i[0].slice(1), !1)); - for (let t = 1; t <= i.length; t++) e = e.concat(ft(i[t])); - } - return e; - } - function gt(t) { - return t.map(t => t.body).join(''); - } - function yt(t, e, i, s) { - 'string' == typeof t && (t = [t]), i || (i = {}); - const a = ft(e), - o = { - category: W, - params: a, - parser: s, - mathstyle: 'displaystyle', - tabular: i.tabular || !0, - colFormat: i.colFormat || [], - }; - for (const e of t) U[e] = o; - } - function bt(t, e, i, s) { - 'string' == typeof t && (t = [t]), i || (i = {}); - const a = { - category: W, - baseFontFamily: i.fontFamily, - params: ft(e), - allowedInText: !!i.allowedInText, - infix: !!i.infix, - parse: s, - }; - for (const e of t) V[e] = a; - } - (W = 'Environments'), - yt('math', '', { frequency: 0 }, function() { - return { mathstyle: 'textstyle' }; - }), - yt('displaymath', '', { frequency: 8 }, function() { - return { mathstyle: 'displaystyle' }; - }), - yt('array', '{columns:colspec}', { frequency: G }, function(t, e) { - return { colFormat: e[0], mathstyle: 'textstyle' }; - }), - yt('eqnarray', '', {}, function() { - return {}; - }), - yt('equation', '', {}, function() { - return { colFormat: [{ align: 'c' }] }; - }), - yt('subequations', '', {}, function() { - return { colFormat: [{ align: 'c' }] }; - }), - yt('multline', '', {}, function() { - return { - firstRowFormat: [{ align: 'l' }], - colFormat: [{ align: 'c' }], - lastRowFormat: [{ align: 'r' }], - }; - }), - yt(['align', 'aligned'], '', {}, function(t, e, i) { - let s = 0; - for (const t of i) s = Math.max(s, t.length); - const a = [ - { gap: 0 }, - { align: 'r' }, - { gap: 0 }, - { align: 'l' }, - ]; - let o = 2; - for (; o < s; ) - a.push({ gap: 1 }), - a.push({ align: 'r' }), - a.push({ gap: 0 }), - a.push({ align: 'l' }), - (o += 2); - return a.push({ gap: 0 }), { colFormat: a, jot: 0.3 }; - }), - yt('split', '', {}, function() { - return {}; - }), - yt(['gather', 'gathered'], '', {}, function() { - return { - colFormat: [{ gap: 0.25 }, { align: 'c' }, { gap: 0 }], - jot: 0.3, - }; - }), - yt( - [ - 'matrix', - 'pmatrix', - 'bmatrix', - 'Bmatrix', - 'vmatrix', - 'Vmatrix', - 'smallmatrix', - 'matrix*', - 'pmatrix*', - 'bmatrix*', - 'Bmatrix*', - 'vmatrix*', - 'Vmatrix*', - 'smallmatrix*', - ], - '[columns:colspec]', - {}, - function(t, e) { - const i = { mathstyle: 'textstyle' }; - switch (t) { - case 'pmatrix': - case 'pmatrix*': - (i.lFence = '('), (i.rFence = ')'); - break; - case 'bmatrix': - case 'bmatrix*': - (i.lFence = '['), (i.rFence = ']'); - break; - case 'Bmatrix': - case 'Bmatrix*': - (i.lFence = '\\lbrace'), (i.rFence = '\\rbrace'); - break; - case 'vmatrix': - case 'vmatrix*': - (i.lFence = '\\vert'), (i.rFence = '\\vert'); - break; - case 'Vmatrix': - case 'Vmatrix*': - (i.lFence = '\\Vert'), (i.rFence = '\\Vert'); - break; - case 'smallmatrix': - case 'smallmatrix*': - i.mathstyle = 'scriptstyle'; - break; - case 'matrix': - case 'matrix*': - (i.lFence = '.'), (i.rFence = '.'); - } - return ( - (i.colFormat = e[0] || [ - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - ]), - i - ); - } - ), - yt('cases', '', {}, function() { - return { - arraystretch: 1.2, - lFence: '\\lbrace', - rFence: '.', - colFormat: [{ align: 'l' }, { gap: 1 }, { align: 'l' }], - }; - }), - yt('theorem', '', {}, function() { - return {}; - }), - yt('center', '', {}, function() { - return { colFormat: [{ align: 'c' }] }; - }), - (W = ''), - (function(t) { - for (let t = 0; t < '0123456789/@.'.length; t++) { - const e = '0123456789/@.'.charAt(t); - Y(e, '', lt, e); - } - })(), - Q(65, 90), - Q(97, 122), - (W = 'Trigonometry'), - bt( - [ - '\\arcsin', - '\\arccos', - '\\arctan', - '\\arctg', - '\\arcctg', - '\\arg', - '\\ch', - '\\cos', - '\\cosec', - '\\cosh', - '\\cot', - '\\cotg', - '\\coth', - '\\csc', - '\\ctg', - '\\cth', - '\\sec', - '\\sin', - '\\sinh', - '\\sh', - '\\tan', - '\\tanh', - '\\tg', - '\\th', - ], - '', - null, - function(t) { - return { - type: 'mop', - limits: 'nolimits', - symbol: !1, - isFunction: !0, - body: t.slice(1), - baseFontFamily: 'cmr', - }; - } - ), - J(Z, '\\cos', '\\sin', '\\tan'), - J( - 'UNCOMMON', - '\\arcsin', - '\\arccos', - '\\arctan', - '\\arctg', - '\\arcctg', - '\\arcsec', - '\\arccsc' - ), - J( - 'UNCOMMON', - '\\arsinh', - '\\arccosh', - '\\arctanh', - '\\arcsech', - '\\arccsch' - ), - J( - 'UNCOMMON', - '\\arg', - '\\ch', - '\\cosec', - '\\cosh', - '\\cot', - '\\cotg', - '\\coth', - '\\csc', - '\\ctg', - '\\cth', - '\\lg', - '\\lb', - '\\sec', - '\\sinh', - '\\sh', - '\\tanh', - '\\tg', - '\\th' - ), - (W = 'Functions'), - bt( - [ - '\\deg', - '\\dim', - '\\exp', - '\\hom', - '\\ker', - '\\lb', - '\\lg', - '\\ln', - '\\log', - ], - '', - null, - function(t) { - return { - type: 'mop', - limits: 'nolimits', - symbol: !1, - isFunction: !0, - body: t.slice(1), - baseFontFamily: 'cmr', - }; - } - ), - J(Z, '\\ln', '\\log', '\\exp'), - J(292, '\\hom'), - J(G, '\\dim'), - J(G, '\\ker', '\\deg'), - bt(['\\lim', '\\mod'], '', null, function(t) { - return { - type: 'mop', - limits: 'limits', - symbol: !1, - body: t.slice(1), - baseFontFamily: 'cmr', - }; - }), - bt(['\\det', '\\max', '\\min'], '', null, function(t) { - return { - type: 'mop', - limits: 'limits', - symbol: !1, - isFunction: !0, - body: t.slice(1), - baseFontFamily: 'cmr', - }; - }), - J(Z, '\\lim'), - J(G, '\\det'), - J(G, '\\mod'), - J(G, '\\min'), - J(G, '\\max'), - (W = 'Decoration'), - bt( - '\\rule', - '[raise:dimen]{width:dimen}{thickness:dimen}', - null, - function(t, e) { - return { - type: 'rule', - shift: e[0], - width: e[1], - height: e[2], - }; - } - ), - bt('\\color', '{:color}', { allowedInText: !0 }, (t, e) => ({ - color: e[0], - })), - bt( - '\\textcolor', - '{:color}{content:auto*}', - { allowedInText: !0 }, - (t, e) => ({ color: e[0] }) - ), - J(3, '\\textcolor'), - bt('\\overline', '{:auto}', null, function(t, e) { - return { - type: 'line', - position: 'overline', - skipBoundary: !0, - body: e[0], - }; - }), - J(G, '\\overline'), - bt('\\underline', '{:auto}', null, function(t, e) { - return { - type: 'line', - position: 'underline', - skipBoundary: !0, - body: e[0], - }; - }), - J(G, '\\underline'), - bt('\\overset', '{annotation:auto}{symbol:auto}', null, function( - t, - e - ) { - return { - type: 'overunder', - overscript: e[0], - skipBoundary: !0, - body: e[1], - }; - }), - J(G, '\\overset'), - bt('\\underset', '{annotation:auto}{symbol:auto}', null, function( - t, - e - ) { - return { - type: 'overunder', - underscript: e[0], - skipBoundary: !0, - body: e[1], - }; - }), - J(G, '\\underset'), - bt( - ['\\stackrel', '\\stackbin'], - '{annotation:auto}{symbol:auto}', - null, - function(t, e) { - return { - type: 'overunder', - overscript: e[0], - skipBoundary: !0, - body: e[1], - mathtype: '\\stackrel' === t ? 'mrel' : 'mbin', - }; - } - ), - J(G, '\\stackrel'), - J(0, '\\stackbin'), - bt('\\rlap', '{:auto}', null, function(t, e) { - return { - type: 'overlap', - align: 'right', - skipBoundary: !0, - body: e[0], - }; - }), - J(270, '\\rlap'), - bt('\\llap', '{:auto}', null, function(t, e) { - return { - type: 'overlap', - align: 'left', - skipBoundary: !0, - body: e[0], - }; - }), - J(18, '\\llap'), - bt('\\mathrlap', '{:auto}', null, function(t, e) { - return { - type: 'overlap', - mode: 'math', - align: 'right', - skipBoundary: !0, - body: e[0], - }; - }), - J(j, '\\mathrlap'), - bt('\\mathllap', '{:auto}', null, function(t, e) { - return { - type: 'overlap', - mode: 'math', - align: 'left', - skipBoundary: !0, - body: e[0], - }; - }), - J(j, '\\mathllap'), - bt('\\boxed', '{content:math}', null, function(t, e) { - return { - type: 'box', - framecolor: 'black', - skipBoundary: !0, - body: e[0], - }; - }), - J(1236, '\\boxed'), - bt( - '\\colorbox', - '{background-color:color}{content:auto}', - { allowedInText: !0 }, - function(t, e) { - return { - type: 'box', - backgroundcolor: e[0], - skipBoundary: !0, - body: e[1], - }; - } - ), - J(j, '\\colorbox'), - bt( - '\\fcolorbox', - '{frame-color:color}{background-color:color}{content:auto}', - { allowedInText: !0 }, - function(t, e) { - return { - type: 'box', - framecolor: e[0], - backgroundcolor: e[1], - skipBoundary: !0, - body: e[2], - }; - } - ), - J(j, '\\fcolorbox'), - bt('\\bbox', '[:bbox]{body:auto}', { allowedInText: !0 }, function( - t, - e - ) { - return e[0] - ? { - type: 'box', - padding: e[0].padding, - border: e[0].border, - backgroundcolor: e[0].backgroundcolor, - skipBoundary: !0, - body: e[1], - } - : { type: 'box', skipBoundary: !0, body: e[1] }; - }), - J(j, '\\bbox'), - bt( - '\\enclose', - '{notation:string}[style:string]{body:auto}', - null, - function(t, e) { - let i = e[0] || []; - const s = { - type: 'enclose', - strokeColor: 'currentColor', - strokeWidth: 1, - strokeStyle: 'solid', - backgroundcolor: 'transparent', - padding: 'auto', - shadow: 'auto', - captureSelection: !0, - body: e[2], - }; - if (e[1]) { - const t = e[1].split( - /,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/ - ); - for (const e of t) { - const t = e.match(/\s*(\S+)\s+(\S+)\s+(.*)/); - if (t) - (s.strokeWidth = m.toPx(t[1], 'px')), - isFinite(s.strokeWidth) || - (s.strokeWidth = 1), - (s.strokeStyle = t[2]), - (s.strokeColor = t[3]); - else { - const t = e.match(/\s*([a-z]*)\s*=\s*"(.*)"/); - t && - ('mathbackground' === t[1] - ? (s.backgroundcolor = t[2]) - : 'mathcolor' === t[1] - ? (s.strokeColor = t[2]) - : 'padding' === t[1] - ? (s.padding = m.toPx(t[2], 'px')) - : 'shadow' === t[1] && - (s.shadow = t[2])); - } - } - 'dashed' === s.strokeStyle - ? (s.svgStrokeStyle = '5,5') - : 'dotted' === s.strokeStyle && - (s.svgStrokeStyle = '1,5'); - } - (s.borderStyle = - s.strokeWidth + - 'px ' + - s.strokeStyle + - ' ' + - s.strokeColor), - (i = i - .toString() - .split(/[, ]/) - .filter(t => t.length > 0) - .map(t => t.toLowerCase())), - (s.notation = {}); - for (const t of i) s.notation[t] = !0; - return ( - s.notation.updiagonalarrow && - (s.notation.updiagonalstrike = !1), - s.notation.box && - ((s.notation.left = !1), - (s.notation.right = !1), - (s.notation.bottom = !1), - (s.notation.top = !1)), - s - ); - } - ), - J(j, '\\enclose'), - bt('\\cancel', '{body:auto}', null, function(t, e) { - return { - type: 'enclose', - strokeColor: 'currentColor', - strokeWidth: 1, - strokeStyle: 'solid', - borderStyle: '1px solid currentColor', - backgroundcolor: 'transparent', - padding: 'auto', - shadow: 'auto', - notation: { updiagonalstrike: !0 }, - body: e[0], - }; - }), - bt('\\bcancel', '{body:auto}', null, function(t, e) { - return { - type: 'enclose', - strokeColor: 'currentColor', - strokeWidth: 1, - strokeStyle: 'solid', - borderStyle: '1px solid currentColor', - backgroundcolor: 'transparent', - padding: 'auto', - shadow: 'auto', - notation: { downdiagonalstrike: !0 }, - body: e[0], - }; - }), - bt('\\xcancel', '{body:auto}', null, function(t, e) { - return { - type: 'enclose', - strokeColor: 'currentColor', - strokeWidth: 1, - strokeStyle: 'solid', - borderStyle: '1px solid currentColor', - backgroundcolor: 'transparent', - padding: 'auto', - shadow: 'auto', - notation: { updiagonalstrike: !0, downdiagonalstrike: !0 }, - body: e[0], - }; - }), - J(j, '\\cancel', '\\bcancel', '\\xcancel'), - (W = 'Styling'), - bt( - [ - '\\tiny', - '\\scriptsize', - '\\footnotesize', - '\\small', - '\\normalsize', - '\\large', - '\\Large', - '\\LARGE', - '\\huge', - '\\Huge', - ], - '', - { allowedInText: !0 }, - function(t, e) { - return { - fontSize: { - tiny: 'size1', - scriptsize: 'size2', - footnotesize: 'size3', - small: 'size4', - normalsize: 'size5', - large: 'size6', - Large: 'size7', - LARGE: 'size8', - huge: 'size9', - Huge: 'size10', - }[t.slice(1)], - }; - } - ), - bt('\\fontseries', '{:text}', { allowedInText: !0 }, (t, e) => ({ - fontSeries: gt(e[0]), - })), - bt('\\bf', '', { allowedInText: !0 }, (t, e) => ({ - fontSeries: 'b', - })), - bt('\\bm', '{:math*}', { allowedInText: !0 }, (t, e) => ({ - fontSeries: 'b', - })), - bt('\\bold', '', { allowedInText: !0 }, (t, e) => ({ - mode: 'math', - fontSeries: 'b', - })), - bt( - ['\\mathbf', '\\boldsymbol'], - '{:math*}', - { allowedInText: !0 }, - (t, e) => ({ mode: 'math', fontSeries: 'b', fontShape: 'n' }) - ), - bt('\\bfseries', '', { allowedInText: !0 }, (t, e) => ({ - fontSeries: 'b', - })), - bt('\\textbf', '{:text*}', { allowedInText: !0 }, (t, e) => ({ - fontSeries: 'b', - })), - bt('\\mathmd', '{:math*}', { allowedInText: !0 }, (t, e) => ({ - mode: 'math', - fontSeries: 'm', - fontShape: 'n', - })), - bt('\\mdseries', '', { allowedInText: !0 }, (t, e) => ({ - fontSeries: 'm', - })), - bt('\\textmd', '{:math*}', { allowedInText: !0 }, (t, e) => ({ - fontSeries: 'm', - })), - bt('\\fontshape', '{:text}', { allowedInText: !0 }, (t, e) => ({ - fontShape: gt(e[0]), - })), - bt('\\it', '', { allowedInText: !0 }, (t, e) => ({ - fontShape: 'it', - })), - bt('\\mathit', '{:math*}', { allowedInText: !0 }, (t, e) => ({ - mode: 'math', - fontSeries: 'm', - fontShape: 'it', - })), - bt('\\upshape', '', { allowedInText: !0 }, (t, e) => ({ - fontShape: 'n', - })), - bt('\\textup', '{:text*}', { allowedInText: !0 }, (t, e) => ({ - fontShape: 'n', - })), - bt('\\textit', '{:text*}', { allowedInText: !0 }, (t, e) => ({ - fontShape: 'it', - })), - bt('\\slshape', '', { allowedInText: !0 }, (t, e) => ({ - fontShape: 'sl', - })), - bt('\\textsl', '{:text*}', { allowedInText: !0 }, (t, e) => ({ - fontShape: 'sl', - })), - bt('\\scshape', '', { allowedInText: !0 }, (t, e) => ({ - mode: 'text', - fontShape: 'sc', - })), - bt('\\textsc', '{:text*}', { allowedInText: !0 }, (t, e) => ({ - fontShape: 'sc', - })), - bt('\\fontfamily', '{:text}', { allowedInText: !0 }, (t, e) => ({ - fontFamily: gt(e[0]), - })), - bt('\\mathrm', '{:math*}', { allowedInText: !0 }, (t, e) => ({ - mode: 'math', - fontFamily: 'cmr', - fontSeries: 'm', - fontShape: 'n', - })), - bt('\\rmfamily', '', { allowedInText: !0 }, (t, e) => ({ - fontFamily: 'cmr', - })), - bt('\\textrm', '{:text*}', { allowedInText: !0 }, (t, e) => ({ - fontFamily: 'cmr', - })), - bt('\\mathsf', '{:math*}', { allowedInText: !0 }, (t, e) => ({ - mode: 'math', - baseFontFamily: 'cmss', - fontSeries: 'm', - fontShape: 'n', - })), - bt('\\sffamily', '', { allowedInText: !0 }, (t, e) => ({ - fontFamily: 'cmss', - })), - bt('\\textsf', '{:text*}', { allowedInText: !0 }, (t, e) => ({ - fontFamily: 'cmss', - })), - bt('\\mathtt', '{:math*}', { allowedInText: !0 }, (t, e) => ({ - mode: 'math', - baseFontFamily: 'cmtt', - fontSeries: 'm', - fontShape: 'n', - })), - bt('\\ttfamily', '', { allowedInText: !0 }, (t, e) => ({ - fontFamily: 'cmtt', - })), - bt('\\texttt', '{:text*}', { allowedInText: !0 }, (t, e) => ({ - fontFamily: 'cmtt', - })), - bt( - ['\\Bbb', '\\mathbb'], - '{:math*}', - { allowedInText: !0 }, - (t, e) => ({ mode: 'math', baseFontFamily: 'bb' }) - ), - bt( - ['\\frak', '\\mathfrak'], - '{:math*}', - { allowedInText: !0 }, - (t, e) => ({ baseFontFamily: 'frak' }) - ), - bt('\\mathcal', '{:math*}', { allowedInText: !0 }, (t, e) => ({ - mode: 'math', - baseFontFamily: 'cal', - fontSeries: 'm', - fontShape: 'n', - })), - bt('\\mathscr', '{:math*}', { allowedInText: !0 }, (t, e) => ({ - mode: 'math', - baseFontFamily: 'scr', - fontSeries: 'm', - fontShape: 'n', - })), - J(Z, '\\mathbb'), - J(1081, '\\Bbb'), - J(0, '\\mathcal'), - J(G, '\\mathfrak'), - J(271, '\\frak'), - J(G, '\\mathscr'), - J('UNCOMMON', '\\mathsf'), - J(G, '\\mathtt'), - J(G, '\\boldsymbol'), - bt('\\textnormal', '{:text*}', { allowedInText: !0 }, (t, e) => ({ - fontFamily: 'cmr', - fontShape: 'n', - fontSeries: 'n', - })), - bt('\\mbox', '{:text*}', null, (t, e) => ({ fontFamily: 'cmr' })), - bt('\\text', '{:text*}', { allowedInText: !0 }, (t, e) => ({})), - bt( - '\\class', - '{name:text}{content:auto*}', - { allowedInText: !0 }, - (t, e) => ({ cssClass: gt(e[0]) }) - ), - bt( - '\\cssId', - '{id:text}{content:auto}', - { allowedInText: !0 }, - (t, e) => ({ cssId: gt(e[0]), body: e[1], type: 'group' }) - ), - bt('\\em', '', { allowedInText: !0 }, (t, e) => ({ - cssClass: 'ML__emph', - type: 'group', - })), - bt('\\emph', '{:auto}', { allowedInText: !0 }, (t, e) => ({ - cssClass: 'ML__emph', - body: e[0], - type: 'group', - skipBoundary: !0, - })), - J(G, '\\textrm'), - J(G, '\\textit'), - J(G, '\\textsf'), - J(G, '\\texttt'), - J(433, '\\textnormal'), - J(G, '\\textbf'), - J(421, '\\textup'), - J(819, '\\emph'), - J(49, '\\em'), - (W = 'Operators'), - bt('\\sqrt', '[index:auto]{radicand:auto}', null, function(t, e) { - return { type: 'surd', body: e[1], index: e[0] }; - }), - J(Z, '\\sqrt'), - (W = 'Fractions'), - bt( - [ - '\\frac', - '\\dfrac', - '\\tfrac', - '\\cfrac', - '\\binom', - '\\dbinom', - '\\tbinom', - ], - '{numerator}{denominator}', - null, - function(t, e) { - const i = { - type: 'genfrac', - numer: e[0], - denom: e[1], - mathstyle: 'auto', - }; - switch (t) { - case '\\dfrac': - case '\\frac': - case '\\tfrac': - case '\\cfrac': - i.hasBarLine = !0; - break; - case '\\\\atopfrac': - i.hasBarLine = !1; - break; - case '\\dbinom': - case '\\binom': - case '\\tbinom': - (i.hasBarLine = !1), - (i.leftDelim = '('), - (i.rightDelim = ')'); - } - switch (t) { - case '\\dfrac': - case '\\dbinom': - i.mathstyle = 'displaystyle'; - break; - case '\\tfrac': - case '\\tbinom': - i.mathstyle = 'textstyle'; - } - return '\\cfrac' === t && (i.continuousFraction = !0), i; - } - ), - bt(['\\over', '\\atop', '\\choose'], '', { infix: !0 }, function( - t, - e - ) { - const i = e[0], - s = e[1]; - let a = !1, - o = null, - n = null; - switch (t) { - case '\\atop': - break; - case '\\over': - a = !0; - break; - case '\\choose': - (a = !1), (o = '('), (n = ')'); - break; - default: - throw new Error('Unrecognized genfrac command'); - } - return { - type: 'genfrac', - numer: i, - denom: s, - hasBarLine: a, - leftDelim: o, - rightDelim: n, - mathstyle: 'auto', - }; - }), - J(21, '\\over'), - J(12, '\\atop'), - J(1968, '\\choose'), - bt( - ['\\overwithdelims', '\\atopwithdelims'], - '{left-delim:delim}{right-delim:delim}', - { infix: !0 }, - function(t, e) { - return { - type: 'genfrac', - numer: e[0], - denom: e[1], - hasBarLine: !1, - leftDelim: e[2], - rightDelim: e[3], - mathstyle: 'auto', - }; - } - ), - J(15, '\\overwithdelims'), - J(G, '\\atopwithdelims'), - (W = 'Fractions'), - bt('\\pdiff', '{numerator}{denominator}', null, function(t, e) { - return { - type: 'genfrac', - numer: e[0], - denom: e[1], - numerPrefix: '∂', - denomPrefix: '∂', - hasBarLine: !0, - leftDelim: null, - rightDelim: null, - mathstyle: 'auto', - }; - }), - (W = 'Quantifiers'), - Y('\\forall', '', lt, '∀', Z), - Y('\\exists', '', lt, '∃', Z), - Y('\\nexists', nt, lt, '∄', Z), - Y('\\mid', '', ht, '∣', G), - Y('\\top', '', lt, '⊤', 'RARE'), - Y('\\bot', '', lt, '⊥', 'RARE'), - (W = 'Variable Sized Symbols'), - bt( - [ - '\\sum', - '\\prod', - '\\bigcup', - '\\bigcap', - '\\coprod', - '\\bigvee', - '\\bigwedge', - '\\biguplus', - '\\bigotimes', - '\\bigoplus', - '\\bigodot', - '\\bigsqcup', - '\\smallint', - '\\intop', - ], - '', - null, - function(t) { - return { - type: 'mop', - limits: 'auto', - symbol: !0, - baseFontFamily: 'cmr', - body: { - coprod: '∐', - bigvee: '⋁', - bigwedge: '⋀', - biguplus: '⨄', - bigcap: '⋂', - bigcup: '⋃', - intop: '∫', - prod: '∏', - sum: '∑', - bigotimes: '⨂', - bigoplus: '⨁', - bigodot: '⨀', - bigsqcup: '⨆', - smallint: '∫', - }[t.slice(1)], - }; - } - ), - bt( - [ - '\\int', - '\\iint', - '\\iiint', - '\\oint', - '\\oiint', - '\\oiiint', - '\\intclockwise', - '\\varointclockwise', - '\\ointctrclockwise', - '\\intctrclockwise', - ], - '', - null, - function(t) { - return { - type: 'mop', - limits: 'nolimits', - symbol: !0, - body: { - int: '∫', - iint: '∬', - iiint: '∭', - oint: '∮', - oiint: '∯', - oiiint: '∰', - intclockwise: '∱', - varointclockwise: '∲', - ointctrclockwise: '∳', - intctrclockwise: '⨑', - }[t.slice(1)], - }; - } - ), - J(Z, '\\sum', '\\prod', '\\bigcap', '\\bigcup', '\\int'), - J(G, '\\bigoplus', '\\smallint', '\\iint', '\\oint'), - J('RARE', '\\bigwedge', '\\bigvee'), - J(756, '\\coprod'), - J(723, '\\bigsqcup'), - J(1241, '\\bigotimes'), - J(150, '\\bigodot'), - J(174, '\\biguplus'), - J(878, '\\iiint'), - J(97, '\\intop'), - (W = 'Various'), - Y('\\sharp', '', lt, '♯', G), - Y('\\flat', '', lt, '♭', 590), - Y('\\natural', '', lt, '♮', 278), - Y('\\#', '', lt, '#', 'RARE'), - Y('\\&', '', lt, '&', 'RARE'), - Y('\\clubsuit', '', lt, '♣', 172), - Y('\\heartsuit', '', lt, '♡', 'ARCANE'), - Y('\\spadesuit', '', lt, '♠', 'ARCANE'), - Y('\\diamondsuit', '', lt, '♢', j), - Y('\\differencedelta', '', ht, '∆', G), - (W = 'Letters and Letter Like Forms'), - bt('\\unicode', '{charcode:number}', null, function(t, e) { - let i = parseInt(e[0]); - return ( - isFinite(i) || (i = 10067), - { type: 'mord', body: String.fromCodePoint(i) } - ); - }), - Y('\\backslash', '', lt, '\\'), - Y('?', '', lt, '?'), - Y('!', '', lt, '!'), - Y('\\nabla', '', lt, '∇', Z), - Y('\\partial', '', lt, '∂', Z), - Y('\\ell', '', lt, 'ℓ', G), - Y('\\imaginaryI', '', lt, 'i'), - Y('\\imaginaryJ', '', lt, 'j'), - bt(['\\Re', '\\Im'], '', null, function(t) { - return { - type: 'mop', - limits: 'nolimits', - symbol: !1, - isFunction: !0, - body: { '\\Re': 'ℜ', '\\Im': 'ℑ' }[t], - baseFontFamily: 'frak', - }; - }), - Y('\\hbar', '', lt, 'ℏ', G), - Y('\\hslash', nt, lt, 'ℏ', G), - Y('\\differentialD', 'cmr', lt, 'd'), - Y('\\rd', 'cmr', lt, 'd'), - Y('\\capitalDifferentialD', 'cmr', lt, 'D'), - Y('\\rD', 'cmr', lt, 'D'), - Y('\\exponentialE', 'cmr', lt, 'e'), - Y('\\Finv', nt, lt, 'Ⅎ', 3), - Y('\\Game', nt, lt, '⅁', 1), - Y('\\wp', '', lt, '℘', 1306), - Y('\\eth', nt, lt, 'ð', 77), - Y('\\mho', nt, lt, '℧', 138), - Y('\\Bbbk', nt, lt, 'k'), - Y('\\doubleStruckCapitalN', 'bb', lt, 'N'), - Y('\\N', 'bb', lt, 'N'), - Y('\\doubleStruckCapitalR', 'bb', lt, 'R'), - Y('\\R', 'bb', lt, 'R'), - Y('\\doubleStruckCapitalQ', 'bb', lt, 'Q'), - Y('\\Q', 'bb', lt, 'Q'), - Y('\\doubleStruckCapitalC', 'bb', lt, 'C'), - Y('\\C', 'bb', lt, 'C'), - Y('\\doubleStruckCapitalZ', 'bb', lt, 'Z'), - Y('\\Z', 'bb', lt, 'Z'), - Y('\\doubleStruckCapitalP', 'bb', lt, 'P'), - Y('\\P', 'bb', lt, 'P'), - Y('\\scriptCapitalE', 'scr', lt, 'E'), - Y('\\scriptCapitalH', 'scr', lt, 'H'), - Y('\\scriptCapitalL', 'scr', lt, 'L'), - Y('\\gothicCapitalC', 'frak', lt, 'C'), - Y('\\gothicCapitalH', 'frak', lt, 'H'), - Y('\\gothicCapitalI', 'frak', lt, 'I'), - Y('\\gothicCapitalR', 'frak', lt, 'R'), - Y('\\pounds', '', lt, '£', 509), - Y('\\yen', nt, lt, '¥', 57), - Y('\\euro', '', lt, '€', 4), - (W = 'Crosses'), - Y('\\textdagger', '', ct, '†'), - Y('\\dagger', '', ct, '†', G), - Y('\\dag', '', ct, '†', G), - Y('\\ddag', '', ct, '‡', 500), - Y('\\textdaggerdbl', '', ct, '‡'), - Y('\\ddagger', '', ct, '‡', 353), - Y('\\maltese', nt, lt, '✠', 24), - (W = 'Arrows'), - Y('\\longrightarrow', '', ht, '⟶', Z), - Y('\\rightarrow', '', ht, '→', Z), - Y('\\Longrightarrow', '', ht, '⟹', Z), - Y('\\Rightarrow', '', ht, '⇒', Z), - Y('\\longmapsto', '', ht, '⟼', G), - Y('\\mapsto', '', ht, '↦', G), - Y('\\Longleftrightarrow', '', ht, '⟺', G), - Y('\\rightleftarrows', nt, ht, '⇄', G), - Y('\\leftarrow', '', ht, '←', G), - Y('\\curvearrowleft', nt, ht, '↶', G), - Y('\\uparrow', '', ht, '↑', G), - Y('\\downarrow', '', ht, '↓', G), - Y('\\hookrightarrow', '', ht, '↪', G), - Y('\\rightharpoonup', '', ht, '⇀', G), - Y('\\rightleftharpoons', '', ht, '⇌', G), - Y('\\Leftarrow', '', ht, '⇐', 1695), - Y('\\longleftrightarrow', '', ht, '⟷', 1599), - Y('\\longleftarrow', '', ht, '⟵', 878), - Y('\\Longleftarrow', '', ht, '⟸', 296), - Y('\\searrow', '', ht, '↘', 1609), - Y('\\nearrow', '', ht, '↗', 1301), - Y('\\swarrow', '', ht, '↙', 167), - Y('\\nwarrow', '', ht, '↖', 108), - Y('\\Uparrow', '', ht, '⇑', 257), - Y('\\Downarrow', '', ht, '⇓', 556), - Y('\\updownarrow', '', ht, '↕', 192), - Y('\\Updownarrow', '', ht, '⇕', 161), - Y('\\hookleftarrow', '', ht, '↩', 115), - Y('\\leftharpoonup', '', ht, '↼', 93), - Y('\\leftharpoondown', '', ht, '↽', 42), - Y('\\rightharpoondown', '', ht, '⇁', 80), - Y('\\leftrightarrows', nt, ht, '⇆', 765), - Y('\\dashrightarrow', nt, ht, '⇢', 311), - Y('\\dashleftarrow', nt, ht, '⇠', 5), - Y('\\leftleftarrows', nt, ht, '⇇', 8), - Y('\\Lleftarrow', nt, ht, '⇚', 7), - Y('\\twoheadleftarrow', nt, ht, '↞', 32), - Y('\\leftarrowtail', nt, ht, '↢', 25), - Y('\\looparrowleft', nt, ht, '↫', 6), - Y('\\leftrightharpoons', nt, ht, '⇋', 205), - Y('\\circlearrowleft', nt, ht, '↺', 105), - Y('\\Lsh', nt, ht, '↰', 11), - Y('\\upuparrows', nt, ht, '⇈', 15), - Y('\\downharpoonleft', nt, ht, '⇃', 21), - Y('\\multimap', nt, ht, '⊸', 108), - Y('\\leftrightsquigarrow', nt, ht, '↭', 31), - Y('\\twoheadrightarrow', nt, ht, '↠', 835), - Y('\\rightarrowtail', nt, ht, '↣', 195), - Y('\\looparrowright', nt, ht, '↬', 37), - Y('\\curvearrowright', nt, ht, '↷', 209), - Y('\\circlearrowright', nt, ht, '↻', 63), - Y('\\Rsh', nt, ht, '↱', 18), - Y('\\downdownarrows', nt, ht, '⇊', 6), - Y('\\upharpoonright', nt, ht, '↾', 579), - Y('\\downharpoonright', nt, ht, '⇂', 39), - Y('\\rightsquigarrow', nt, ht, '⇝', 674), - Y('\\leadsto', nt, ht, '⇝', 709), - Y('\\Rrightarrow', nt, ht, '⇛', 62), - Y('\\restriction', nt, ht, '↾', 29), - Y('\\upharpoonleft', nt, ht, '↿', j), - Y('\\rightrightarrows', nt, ht, '⇉', j), - (W = 'Negated Arrows'), - Y('\\nrightarrow', nt, ht, '↛', 324), - Y('\\nRightarrow', nt, ht, '⇏', 107), - Y('\\nleftrightarrow', nt, ht, '↮', 36), - Y('\\nLeftrightarrow', nt, ht, '⇎', 20), - Y('\\nleftarrow', nt, ht, '↚', 7), - Y('\\nLeftarrow', nt, ht, '⇍', 5), - (W = 'Negated Relations'), - Y('\\nless', nt, ht, '≮', 146), - Y('\\nleqslant', nt, ht, '', 58), - Y('\\lneq', nt, ht, '⪇', 54), - Y('\\lneqq', nt, ht, '≨', 36), - Y('\\nleqq', nt, ht, '', 18), - Y('\\unlhd', nt, ct, '⊴', 253), - Y('\\unrhd', nt, ct, '⊵', 66), - Y('\\lvertneqq', nt, ht, '', 6), - Y('\\lnsim', nt, ht, '⋦', 4), - Y('\\lnapprox', nt, ht, '⪉', j), - Y('\\nprec', nt, ht, '⊀', 71), - Y('\\npreceq', nt, ht, '⋠', 57), - Y('\\precnsim', nt, ht, '⋨', 4), - Y('\\precnapprox', nt, ht, '⪹', 2), - Y('\\nsim', nt, ht, '≁', 40), - Y('\\nshortmid', nt, ht, '', 1), - Y('\\nmid', nt, ht, '∤', 417), - Y('\\nvdash', nt, ht, '⊬', 266), - Y('\\nvDash', nt, ht, '⊭', 405), - Y('\\ngtr', nt, ht, '≯', 90), - Y('\\ngeqslant', nt, ht, '', 23), - Y('\\ngeqq', nt, ht, '', 12), - Y('\\gneq', nt, ht, '⪈', 29), - Y('\\gneqq', nt, ht, '≩', 35), - Y('\\gvertneqq', nt, ht, '', 6), - Y('\\gnsim', nt, ht, '⋧', 3), - Y('\\gnapprox', nt, ht, '⪊', j), - Y('\\nsucc', nt, ht, '⊁', 44), - Y('\\nsucceq', nt, ht, '⋡', j), - Y('\\succnsim', nt, ht, '⋩', 4), - Y('\\succnapprox', nt, ht, '⪺', j), - Y('\\ncong', nt, ht, '≆', 128), - Y('\\nshortparallel', nt, ht, '', 6), - Y('\\nparallel', nt, ht, '∦', 54), - Y('\\nVDash', nt, ht, '⊯', 5), - Y('\\nsupseteqq', nt, ht, '', 1), - Y('\\supsetneq', nt, ht, '⊋', 286), - Y('\\varsupsetneq', nt, ht, '', 2), - Y('\\supsetneqq', nt, ht, '⫌', 49), - Y('\\varsupsetneqq', nt, ht, '', 3), - Y('\\nVdash', nt, ht, '⊮', 179), - Y('\\precneqq', nt, ht, '⪵', 11), - Y('\\succneqq', nt, ht, '⪶', 3), - Y('\\nsubseteqq', nt, ht, '', 16), - (W = 'Various'), - Y('\\checkmark', nt, lt, '✓', 1025), - Y('\\diagup', nt, lt, '╱', 440), - Y('\\diagdown', nt, lt, '╲', 175), - Y('\\measuredangle', nt, lt, '∡', 271), - Y('\\sphericalangle', nt, lt, '∢', 156), - Y('\\backprime', nt, lt, '‵', 104), - Y('\\backdoubleprime', nt, lt, '‶', j), - (W = 'Shapes'), - Y('\\ast', '', ct, '∗', Z), - Y('\\star', '', ct, '⋆', G), - Y('\\diamond', '', ct, '⋄', 1356), - Y('\\Diamond', nt, lt, '◊', 695), - Y('\\lozenge', nt, lt, '◊', 422), - Y('\\blacklozenge', nt, lt, '⧫', 344), - Y('\\bigstar', nt, lt, '★', 168), - (W = 'Hebrew'), - Y('\\aleph', '', lt, 'ℵ', 1381), - Y('\\beth', nt, lt, 'ℶ', 54), - Y('\\daleth', nt, lt, 'ℸ', 43), - Y('\\gimel', nt, lt, 'ℷ', 36), - (W = 'Fences'), - Y('\\lbrace', '', dt, '{', Z), - Y('\\rbrace', '', pt, '}', Z), - Y('\\langle', '', dt, '⟨', G), - Y('\\rangle', '', pt, '⟩', G), - Y('\\lfloor', '', dt, '⌊', G), - Y('\\rfloor', '', pt, '⌋', G), - Y('\\lceil', '', dt, '⌈', G), - Y('\\rceil', '', pt, '⌉', G), - Y('\\vert', '', lt, '∣', Z), - Y('\\mvert', '', ht, '∣'), - Y('\\lvert', '', dt, '∣', 496), - Y('\\rvert', '', pt, '∣', 496), - Y('\\|', '', lt, '∥'), - Y('\\Vert', '', lt, '∥', Z), - Y('\\mVert', '', lt, '∥'), - Y('\\lVert', '', dt, '∥', 287), - Y('\\rVert', '', pt, '∥', j), - Y('\\lbrack', '', dt, '[', 574), - Y('\\rbrack', '', pt, ']', 213), - Y('\\{', '', dt, '{'), - Y('\\}', '', pt, '}'), - Y('(', '', dt, '('), - Y(')', '', pt, ')'), - Y('[', '', dt, '['), - Y(']', '', pt, ']'), - Y('\\ulcorner', nt, dt, '┌', 296), - Y('\\urcorner', nt, pt, '┐', 310), - Y('\\llcorner', nt, dt, '└', 137), - Y('\\lrcorner', nt, pt, '┘', 199), - Y('\\lgroup', '', dt, '⟮', 24), - Y('\\rgroup', '', pt, '⟯', 24), - Y('\\lmoustache', '', dt, '⎰', j), - Y('\\rmoustache', '', pt, '⎱', j), - bt(['\\middle'], '{:delim}', null, function(t, e) { - return { type: 'delim', delim: e[0] }; - }), - (W = 'Sizing'); - const xt = { - '\\bigl': { mclass: 'mopen', size: 1 }, - '\\Bigl': { mclass: 'mopen', size: 2 }, - '\\biggl': { mclass: 'mopen', size: 3 }, - '\\Biggl': { mclass: 'mopen', size: 4 }, - '\\bigr': { mclass: 'mclose', size: 1 }, - '\\Bigr': { mclass: 'mclose', size: 2 }, - '\\biggr': { mclass: 'mclose', size: 3 }, - '\\Biggr': { mclass: 'mclose', size: 4 }, - '\\bigm': { mclass: 'mrel', size: 1 }, - '\\Bigm': { mclass: 'mrel', size: 2 }, - '\\biggm': { mclass: 'mrel', size: 3 }, - '\\Biggm': { mclass: 'mrel', size: 4 }, - '\\big': { mclass: 'mord', size: 1 }, - '\\Big': { mclass: 'mord', size: 2 }, - '\\bigg': { mclass: 'mord', size: 3 }, - '\\Bigg': { mclass: 'mord', size: 4 }, - }; - function kt(t) { - let e = '', - i = !0; - for (const s of t) - 'string' == typeof s.body ? (e += s.body) : (i = !1); - return i ? e : ''; - } - bt( - [ - '\\bigl', - '\\Bigl', - '\\biggl', - '\\Biggl', - '\\bigr', - '\\Bigr', - '\\biggr', - '\\Biggr', - '\\bigm', - '\\Bigm', - '\\biggm', - '\\Biggm', - '\\big', - '\\Big', - '\\bigg', - '\\Bigg', - ], - '{:delim}', - null, - function(t, e) { - return { - type: 'sizeddelim', - size: xt[t].size, - cls: xt[t].mclass, - delim: e[0], - }; - } - ), - (W = 'Relations'), - Y('=', '', ht, '=', Z), - Y('\\ne', '', ht, '≠', Z), - Y('\\neq', '', ht, '≠', G), - Y('<', '', ht, '<', Z), - Y('\\lt', '', ht, '<', G), - Y('>', '', ht, '>', Z), - Y('\\gt', '', ht, '>', G), - Y('\\le', '', ht, '≤', G), - Y('\\ge', '', ht, '≥', G), - Y('\\leqslant', nt, ht, '⩽', Z), - Y('\\geqslant', nt, ht, '⩾', Z), - Y('\\leq', '', ht, '≤', G), - Y('\\geq', '', ht, '≥', G), - Y('\\ll', '', ht, '≪'), - Y('\\gg', '', ht, '≫', G), - Y('\\coloneq', '', ht, '≔', 5), - Y('\\measeq', '', ht, '≝'), - Y('\\eqdef', '', ht, '≞'), - Y('\\questeq', '', ht, '≟'), - Y(':', '', ht, ':'), - Y('\\cong', '', ht, '≅', G), - Y('\\equiv', '', ht, '≡', G), - Y('\\prec', '', ht, '≺', G), - Y('\\preceq', '', ht, '⪯', G), - Y('\\succ', '', ht, '≻', G), - Y('\\succeq', '', ht, '⪰', 1916), - Y('\\perp', '', ht, '⊥', G), - Y('\\parallel', '', ht, '∥', G), - Y('\\propto', '', ht, '∝', G), - Y('\\Colon', '', ht, '∷'), - Y('\\smile', '', ht, '⌣', G), - Y('\\frown', '', ht, '⌢', G), - Y('\\sim', '', ht, '∼', G), - Y('\\gtrsim', nt, ht, '≳', G), - Y('\\approx', '', ht, '≈', Z), - Y('\\approxeq', nt, ht, '≊', 147), - Y('\\thickapprox', nt, ht, '≈', 377), - Y('\\lessapprox', nt, ht, '⪅', 146), - Y('\\gtrapprox', nt, ht, '⪆', 95), - Y('\\precapprox', nt, ht, '⪷', 50), - Y('\\succapprox', nt, ht, '⪸', j), - Y('\\thicksim', nt, ht, '∼', 779), - Y('\\succsim', nt, ht, '≿', 251), - Y('\\precsim', nt, ht, '≾', 104), - Y('\\backsim', nt, ht, '∽', 251), - Y('\\eqsim', nt, ht, '≂', 62), - Y('\\backsimeq', nt, ht, '⋍', 91), - Y('\\simeq', '', ht, '≃', j), - Y('\\lesssim', nt, ht, '≲', j), - Y('\\nleq', nt, ht, '≰', 369), - Y('\\ngeq', nt, ht, '≱', 164), - Y('\\smallsmile', nt, ht, '⌣', 31), - Y('\\smallfrown', nt, ht, '⌢', 71), - Y('\\bowtie', '', ht, '⋈', 558), - Y('\\asymp', '', ht, '≍', 755), - Y('\\sqsubseteq', '', ht, '⊑', 1255), - Y('\\sqsupseteq', '', ht, '⊒', 183), - Y('\\leqq', nt, ht, '≦', 1356), - Y('\\eqslantless', nt, ht, '⪕', 15), - Y('\\lll', nt, ht, '⋘', 157), - Y('\\lessgtr', nt, ht, '≶', 281), - Y('\\lesseqgtr', nt, ht, '⋚', 134), - Y('\\lesseqqgtr', nt, ht, '⪋', j), - Y('\\risingdotseq', nt, ht, '≓', 8), - Y('\\fallingdotseq', nt, ht, '≒', 99), - Y('\\subseteqq', nt, ht, '⫅', 82), - Y('\\Subset', nt, ht, '⋐'), - Y('\\sqsubset', nt, ht, '⊏', 309), - Y('\\preccurlyeq', nt, ht, '≼', 549), - Y('\\curlyeqprec', nt, ht, '⋞', 14), - Y('\\vDash', nt, ht, '⊨', 646), - Y('\\Vvdash', nt, ht, '⊪', 20), - Y('\\bumpeq', nt, ht, '≏', 13), - Y('\\Bumpeq', nt, ht, '≎', 12), - Y('\\geqq', nt, ht, '≧', 972), - Y('\\eqslantgtr', nt, ht, '⪖', 13), - Y('\\ggg', nt, ht, '⋙', 127), - Y('\\gtrless', nt, ht, '≷', 417), - Y('\\gtreqless', nt, ht, '⋛', 190), - Y('\\gtreqqless', nt, ht, '⪌', 91), - Y('\\supseteqq', nt, ht, '⫆', 6), - Y('\\Supset', nt, ht, '⋑', 34), - Y('\\sqsupset', nt, ht, '⊐', 71), - Y('\\succcurlyeq', nt, ht, '≽', 442), - Y('\\curlyeqsucc', nt, ht, '⋟', 10), - Y('\\Vdash', nt, ht, '⊩', 276), - Y('\\shortmid', nt, ht, '∣', 67), - Y('\\shortparallel', nt, ht, '∥', 17), - Y('\\between', nt, ht, '≬', 110), - Y('\\pitchfork', nt, ht, '⋔', 66), - Y('\\varpropto', nt, ht, '∝', 203), - Y('\\backepsilon', nt, ht, '∍', 176), - Y('\\llless', nt, ht, '⋘', j), - Y('\\gggtr', nt, ht, '⋙', j), - Y('\\lhd', nt, ct, '⊲', 447), - Y('\\rhd', nt, ct, '⊳', 338), - Y('\\Join', '', ht, '⋈', 35), - Y('\\doteq', '', ht, '≐', 1450), - Y('\\doteqdot', nt, ht, '≑', 60), - Y('\\Doteq', nt, ht, '≑', j), - Y('\\eqcirc', nt, ht, '≖', 6), - Y('\\circeq', nt, ht, '≗', 31), - Y('\\lessdot', nt, ct, '⋖', 88), - Y('\\gtrdot', nt, ct, '⋗', 45), - Y('\\~', '', ht, '~'), - (W = 'Logic'), - Y('\\leftrightarrow', '', ht, '↔', Z), - Y('\\Leftrightarrow', '', ht, '⇔', Z), - Y('\\to', '', ht, '→', Z), - Y('\\models', '', ht, '⊨', G), - Y('\\vdash', '', ht, '⊢', G), - Y('\\therefore', nt, ht, '∴', 1129), - Y('\\because', nt, ht, '∵', 388), - Y('\\implies', '', ht, '⟹', 1858), - Y('\\gets', '', ht, '←', 150), - Y('\\dashv', '', ht, '⊣', 299), - Y('\\impliedby', '', ht, '⟸', j), - Y('\\biconditional', '', ht, '⟷', j), - Y('\\roundimplies', '', ht, '⥰', j), - (W = 'Operators'), - Y('+', '', ct, '+', Z), - Y('-', '', ct, '−', Z), - Y('−', '', ct, '−', Z), - Y('\\pm', '', ct, '±', G), - Y('\\mp', '', ct, '∓', G), - Y('*', '', ct, '∗', G), - Y('\\times', '', ct, '×', G), - Y('\\div', '', ct, '÷', G), - Y('\\surd', '', lt, '√', G), - Y('\\divides', '', ct, '∣', j), - Y('\\ltimes', nt, ct, '⋉', 576), - Y('\\rtimes', nt, ct, '⋊', 946), - Y('\\leftthreetimes', nt, ct, '⋋', 34), - Y('\\rightthreetimes', nt, ct, '⋌', 14), - Y('\\intercal', nt, ct, '⊺', 478), - Y('\\dotplus', nt, ct, '∔', 81), - Y('\\centerdot', nt, ct, '⋅', 271), - Y('\\doublebarwedge', nt, ct, '⩞', 5), - Y('\\divideontimes', nt, ct, '⋇', 51), - Y('\\cdot', '', ct, '⋅', j), - (W = 'Others'), - Y('\\infty', '', lt, '∞', Z), - Y('\\prime', '', rt, '′', Z), - Y('\\doubleprime', '', lt, '″'), - Y('\\angle', '', lt, '∠', G), - Y('`', '', lt, '‘'), - Y('\\$', '', lt, '$'), - Y('\\%', '', lt, '%'), - Y('\\_', '', lt, '_'), - (W = 'Greek'), - Y('\\alpha', '', rt, 'α', G), - Y('\\beta', '', rt, 'β', G), - Y('\\gamma', '', rt, 'γ', G), - Y('\\delta', '', rt, 'δ', G), - Y('\\epsilon', '', rt, 'ϵ', G), - Y('\\varepsilon', '', rt, 'ε'), - Y('\\zeta', '', rt, 'ζ', G), - Y('\\eta', '', rt, 'η', G), - Y('\\theta', '', rt, 'θ', G), - Y('\\vartheta', '', rt, 'ϑ', G), - Y('\\iota', '', rt, 'ι', G), - Y('\\kappa', '', rt, 'κ', G), - Y('\\varkappa', nt, rt, 'ϰ', G), - Y('\\lambda', '', rt, 'λ', G), - Y('\\mu', '', rt, 'μ', G), - Y('\\nu', '', rt, 'ν', G), - Y('\\xi', '', rt, 'ξ', G), - Y('\\omicron', '', rt, 'o'), - Y('\\pi', '', rt, 'π', G), - Y('\\varpi', '', rt, 'ϖ', G), - Y('\\rho', '', rt, 'ρ', G), - Y('\\varrho', '', rt, 'ϱ', G), - Y('\\sigma', '', rt, 'σ', G), - Y('\\varsigma', '', rt, 'ς', G), - Y('\\tau', '', rt, 'τ', G), - Y('\\phi', '', rt, 'ϕ', G), - Y('\\varphi', '', rt, 'φ', G), - Y('\\upsilon', '', rt, 'υ', G), - Y('\\chi', '', rt, 'χ', G), - Y('\\psi', '', rt, 'ψ', G), - Y('\\omega', '', rt, 'ω', G), - Y('\\Gamma', '', rt, 'Γ', G), - Y('\\Delta', '', rt, 'Δ', G), - Y('\\Theta', '', rt, 'Θ', G), - Y('\\Lambda', '', rt, 'Λ', G), - Y('\\Xi', '', rt, 'Ξ', G), - Y('\\Pi', '', rt, 'Π', G), - Y('\\Sigma', '', rt, 'Σ', G), - Y('\\Upsilon', '', rt, 'Υ', G), - Y('\\Phi', '', rt, 'Φ', G), - Y('\\Psi', '', rt, 'Ψ', G), - Y('\\Omega', '', rt, 'Ω', G), - Y('\\digamma', nt, rt, 'ϝ', 248), - (W = 'Others'), - Y('\\emptyset', '', lt, '∅', Z), - Y('\\varnothing', nt, lt, '∅', Z), - (W = 'Set Operators'), - Y('\\cap', '', ct, '∩', Z), - Y('\\cup', '', ct, '∪', Z), - Y('\\setminus', '', ct, '∖', G), - Y('\\smallsetminus', nt, ct, '∖', 254), - Y('\\complement', nt, lt, '∁', 200), - (W = 'Set Relations'), - Y('\\in', '', ht, '∈', Z), - Y('\\notin', '', ht, '∉', Z), - Y('\\not', '', ht, '̸', G), - Y('\\ni', '', ht, '∋', G), - Y('\\owns', '', ht, '∋', 18), - Y('\\subset', '', ht, '⊂', Z), - Y('\\supset', '', ht, '⊃', Z), - Y('\\subseteq', '', ht, '⊆', Z), - Y('\\supseteq', '', ht, '⊇', Z), - Y('\\subsetneq', nt, ht, '⊊', 1945), - Y('\\varsubsetneq', nt, ht, '', 198), - Y('\\subsetneqq', nt, ht, '⫋', 314), - Y('\\varsubsetneqq', nt, ht, '', 55), - Y('\\nsubset', nt, ht, '⊄', j), - Y('\\nsupset', nt, ht, '⊅', j), - Y('\\nsubseteq', nt, ht, '⊈', 950), - Y('\\nsupseteq', nt, ht, '⊉', 49), - (W = 'Spacing'), - Y('\\ ', '', mt, ' '), - Y('~', '', mt, ' '), - Y('\\space', '', mt, ' '), - Y('\\!', '', mt, null), - Y('\\,', '', mt, null), - Y('\\:', '', mt, null), - Y('\\;', '', mt, null), - Y('\\enskip', '', mt, null), - Y('\\enspace', '', mt, null, 672), - Y('\\quad', '', mt, null, G), - Y('\\qquad', '', mt, null, G), - bt( - ['\\hspace', '\\hspace*'], - '{width:skip}', - { allowedInText: !0 }, - function(t, e) { - return { type: 'spacing', width: e[0] || 0 }; - } - ), - bt( - [ - '\\mathop', - '\\mathbin', - '\\mathrel', - '\\mathopen', - '\\mathclose', - '\\mathpunct', - '\\mathord', - '\\mathinner', - ], - '{:auto}', - null, - function(t, e) { - const i = { - type: { - '\\mathop': 'mop', - '\\mathbin': 'mbin', - '\\mathrel': 'mrel', - '\\mathopen': 'mopen', - '\\mathclose': 'mclose', - '\\mathpunct': 'mpunct', - '\\mathord': 'mord', - '\\mathinner': 'minner', - }[t], - body: kt(e[0]) || e[0], - captureSelection: !0, - baseFontFamily: '\\mathop' === t ? 'math' : '', - }; - return ( - '\\mathop' === t && - ((i.limits = 'nolimits'), (i.isFunction = !0)), - i - ); - } - ), - bt( - ['\\operatorname', '\\operatorname*'], - '{operator:math}', - null, - function(t, e) { - const i = { - type: 'mop', - skipBoundary: !0, - body: e[0], - isFunction: !0, - }; - return ( - i.body.forEach(t => { - (t.isFunction = !1), (t.autoFontFamily = 'cmr'); - }), - '\\operatorname' === t - ? (i.limits = 'nolimits') - : '\\operatorname*' === t && (i.limits = 'limits'), - i - ); - } - ), - (W = 'Punctuation'), - Y('\\colon', '', 'mpunct', ':', G), - Y('\\cdotp', '', 'mpunct', '⋅', G), - Y('\\ldots', '', 'minner', '…', G), - Y('\\cdots', '', 'minner', '⋯', G), - Y('\\ddots', '', 'minner', '⋱', G), - Y('\\mathellipsis', '', 'minner', '…', 91), - Y('\\vdots', '', lt, '⋮', G), - Y('\\ldotp', '', 'mpunct', '.', 18), - Y(',', '', 'mpunct', ','), - Y(';', '', 'mpunct', ';'), - (W = 'Logical Operators'), - Y('\\wedge', '', ct, '∧', Z), - Y('\\vee', '', ct, '∨', Z), - Y('\\lnot', '', lt, '¬', G), - Y('\\neg', '', lt, '¬', Z), - Y('\\land', '', ct, '∧', 659), - Y('\\lor', '', ct, '∨', 364), - Y('\\barwedge', nt, ct, '⊼', 21), - Y('\\veebar', nt, ct, '⊻', 43), - Y('\\nor', nt, ct, '⊻', 7), - Y('\\curlywedge', nt, ct, '⋏', 58), - Y('\\curlyvee', nt, ct, '⋎', 57), - (W = 'Boxes'), - Y('\\square', nt, lt, '□', G), - Y('\\Box', nt, lt, '□', G), - Y('\\blacksquare', nt, lt, '■', 1679), - Y('\\boxminus', nt, ct, '⊟', 79), - Y('\\boxplus', nt, ct, '⊞', 276), - Y('\\boxtimes', nt, ct, '⊠', 457), - Y('\\boxdot', nt, ct, '⊡', 120), - (W = 'Circles'), - Y('\\circ', '', ct, '∘', Z), - Y('\\bigcirc', '', ct, '◯', 903), - Y('\\bullet', '', ct, '∙', G), - Y('\\circleddash', nt, ct, '⊝', G), - Y('\\circledast', nt, ct, '⊛', 339), - Y('\\oplus', '', ct, '⊕', G), - Y('\\ominus', '', ct, '⊖', 1568), - Y('\\otimes', '', ct, '⊗', G), - Y('\\odot', '', ct, '⊙', G), - Y('\\circledcirc', nt, ct, '⊚', 93), - Y('\\oslash', '', ct, '⊘', 497), - Y('\\circledS', nt, lt, 'Ⓢ', 31), - Y('\\circledR', nt, lt, '®', 1329), - (W = 'Triangles'), - Y('\\triangle', '', lt, '△', G), - Y('\\triangleq', nt, ht, '≜', G), - Y('\\bigtriangleup', '', ct, '△', 1773), - Y('\\vartriangle', nt, ht, '△', 762), - Y('\\triangledown', nt, lt, '▽', 520), - Y('\\bigtriangledown', '', ct, '▽', 661), - Y('\\triangleleft', '', ct, '◃', 534), - Y('\\vartriangleleft', nt, ht, '⊲', 281), - Y('\\trianglelefteq', nt, ht, '⊴', 176), - Y('\\ntriangleleft', nt, ht, '⋪', 13), - Y('\\ntrianglelefteq', nt, ht, '⋬', 22), - Y('\\triangleright', '', ct, '▹', 516), - Y('\\vartriangleright', nt, ht, '⊳', 209), - Y('\\trianglerighteq', nt, ht, '⊵', 45), - Y('\\ntriangleright', nt, ht, '⋫', 15), - Y('\\ntrianglerighteq', nt, ht, '⋭', 6), - Y('\\blacktriangle', nt, lt, '▲', 360), - Y('\\blacktriangledown', nt, lt, '▼', 159), - Y('\\blacktriangleleft', nt, ht, '◀', 101), - Y('\\blacktriangleright', nt, ht, '▶', 271), - (W = 'Others'), - Y('\\/', '', rt, '/'), - Y('|', '', 'textord', '∣'), - (W = 'Big Operators'), - Y('\\sqcup', '', ct, '⊔', 1717), - Y('\\sqcap', '', ct, '⊓', 735), - Y('\\uplus', '', ct, '⊎', 597), - Y('\\wr', '', ct, '≀', 286), - Y('\\Cap', nt, ct, '⋒', 2), - Y('\\Cup', nt, ct, '⋓', 2), - Y('\\doublecap', nt, ct, '⋒', 1), - Y('\\doublecup', nt, ct, '⋓', 1), - Y('\\amalg', '', ct, '⨿', j), - Y('\\And', '', ct, '&'), - (W = 'Accents'), - bt( - [ - '\\acute', - '\\grave', - '\\dot', - '\\ddot', - '\\mathring', - '\\tilde', - '\\bar', - '\\breve', - '\\check', - '\\hat', - '\\vec', - ], - '{body:auto}', - null, - function(t, e) { - return { - type: 'accent', - accent: { - '\\acute': 'ˊ', - '\\grave': 'ˋ', - '\\dot': '˙', - '\\ddot': '¨', - '\\mathring': '˚', - '\\tilde': '~', - '\\bar': 'ˉ', - '\\breve': '˘', - '\\check': 'ˇ', - '\\hat': '^', - '\\vec': '⃗', - }[t], - limits: 'accent', - skipBoundary: !0, - body: e[0], - }; - } - ), - J(G, '\\bar', '\\ddot', '\\acute', '\\tilde', '\\check'), - J(1548, '\\breve'), - J(735, '\\grave'), - J(Z, '\\vec'), - (W = 'Letters and Letter Like Forms'), - Y('\\imath', '', lt, 'ı'), - Y('\\jmath', '', lt, 'ȷ'), - (W = 'Others'), - Y('\\degree', '', lt, '°', 46), - (W = 'Others'), - Y("'", '', lt, '′'), - Y('"', '', lt, '”'), - (W = 'Others'), - bt('\\^', '{:string}', { allowedInText: !0 }, function(t, e) { - return { - type: 'mord', - limits: 'nolimits', - symbol: !0, - isFunction: !1, - body: - (e[0] && - { - a: 'â', - e: 'ê', - i: 'î', - o: 'ô', - u: 'û', - A: 'Â', - E: 'Ê', - I: 'Î', - O: 'Ô', - U: 'Û', - }[e[0]]) || - '^', - baseFontFamily: 'cmr', - }; - }), - bt('\\`', '{:string}', { allowedInText: !0 }, function(t, e) { - return { - type: 'mord', - limits: 'nolimits', - symbol: !0, - isFunction: !1, - body: - (e[0] && - { - a: 'à', - e: 'è', - i: 'ì', - o: 'ò', - u: 'ù', - A: 'À', - E: 'È', - I: 'Ì', - O: 'Ò', - U: 'Ù', - }[e[0]]) || - '`', - baseFontFamily: 'cmr', - }; - }), - bt("\\'", '{:string}', { allowedInText: !0 }, function(t, e) { - return { - type: 'mord', - limits: 'nolimits', - symbol: !0, - isFunction: !1, - body: - (e[0] && - { - a: 'á', - e: 'é', - i: 'í', - o: 'ó', - u: 'ú', - A: 'Á', - E: 'É', - I: 'Í', - O: 'Ó', - U: 'Ú', - }[e[0]]) || - '^', - baseFontFamily: 'cmr', - }; - }), - bt('\\~', '{:string}', { allowedInText: !0 }, function(t, e) { - return { - type: 'mord', - limits: 'nolimits', - symbol: !0, - isFunction: !1, - body: - (e[0] && - { n: 'ñ', N: 'Ñ', a: 'ã', o: 'õ', A: 'Ã', O: 'Õ' }[ - e[0] - ]) || - '´', - baseFontFamily: 'cmr', - }; - }), - bt('\\c', '{:string}', { allowedInText: !0 }, function(t, e) { - return { - type: 'mord', - limits: 'nolimits', - symbol: !0, - isFunction: !1, - body: (e[0] && { c: 'ç', C: 'Ç' }[e[0]]) || '', - baseFontFamily: 'cmr', - }; - }); - const vt = { - '\\#': '#', - '\\&': '&', - '\\$': '$', - '\\%': '%', - '\\_': '_', - '\\euro': '€', - '\\maltese': '✠', - '\\{': '{', - '\\}': '}', - '\\nobreakspace': ' ', - '\\ldots': '…', - '\\textellipsis': '…', - '\\backslash': '\\', - '`': '‘', - "'": '’', - '``': '“', - "''": '”', - '\\degree': '°', - '\\textasciicircum': '^', - '\\textasciitilde': '~', - '\\textasteriskcentered': '*', - '\\textbackslash': '\\', - '\\textbraceleft': '{', - '\\textbraceright': '}', - '\\textbullet': '•', - '\\textdollar': '$', - '\\textsterling': '£', - '–': '–', - '—': '—', - '‘': '‘', - '’': '’', - '“': '“', - '”': '”', - '"': '”', - '\\ss': 'ß', - '\\ae': 'æ', - '\\oe': 'œ', - '\\AE': 'Æ', - '\\OE': 'Œ', - '\\O': 'Ø', - '\\i': 'ı', - '\\j': 'ȷ', - '\\aa': 'å', - '\\AA': 'Å', - }, - wt = - 'undefined' != typeof navigator && - /firefox|edge/i.test(navigator.userAgent) - ? /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/ - : new RegExp('\\p{Letter}', 'u'), - St = - 'undefined' != typeof navigator && - /firefox|edge/i.test(navigator.userAgent) - ? /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/ - : new RegExp('[0-9\\p{Letter}]', 'u'); - var At = { - matchCodepoint: et, - commandAllowed: function(t, e) { - return ( - !(!V[e] || ('text' === t && !V[e].allowedInText)) || - !!{ text: vt, math: H }[t][e] - ); - }, - unicodeToMathVariant: at, - mathVariantToUnicode: function(t, e, i) { - if (!/[A-Za-z0-9]/.test(t)) return t; - if (!e && !i) return t; - const s = t.codePointAt(0); - for (let t = 0; t < st.length; t++) - if ( - (!e || st[t].variant === e) && - (!i || st[t].style === i) && - s >= st[t].offset && - s < st[t].offset + st[t].len - ) { - const e = st[t].start + s - st[t].offset; - return String.fromCodePoint(it[e] || e); - } - return t; - }, - unicodeStringToLatex: function(t, e) { - let i = ''; - for (const s of e) i += ot(t, s.codePointAt(0)); - return i; - }, - getInfo: function(t, e, i) { - if (0 === t.length) return null; - let s = null; - if ('\\' === t.charAt(0)) { - if (((s = V[t]), s)) - return 'math' === e || s.allowedInText ? s : null; - if ( - (s || - ('math' === e - ? (s = H[t]) - : vt[t] && (s = { value: vt[t] })), - !s) - ) { - const e = t.slice(1); - if (i && i[e]) { - let t = i[e]; - 'object' == typeof t && (t = t.def); - let a = 0; - for ( - /(^|[^\\])#1/.test(t) && (a = 1), - /(^|[^\\])#2/.test(t) && (a = 2), - /(^|[^\\])#3/.test(t) && (a = 3), - /(^|[^\\])#4/.test(t) && (a = 4), - /(^|[^\\])#5/.test(t) && (a = 5), - /(^|[^\\])#6/.test(t) && (a = 6), - /(^|[^\\])#7/.test(t) && (a = 7), - /(^|[^\\])#8/.test(t) && (a = 8), - /(^|[^\\])#9/.test(t) && (a = 9), - s = { - type: 'group', - allowedInText: !1, - params: [], - infix: !1, - }; - a >= 1; - - ) - s.params.push({ - optional: !1, - type: 'math', - defaultValue: null, - placeholder: null, - }), - (a -= 1); - } - } - } else - 'math' === e ? (s = H[t]) : vt[t] && (s = { value: vt[t] }); - return ( - !s || - 'mord' !== s.type || - ('f' !== s.value && - 'g' !== s.value && - 'h' !== s.value) || - (s.isFunction = !0), - s - ); - }, - getValue: function(t, e) { - return 'math' === t - ? H[e] && H[e].value - ? H[e].value - : e - : vt[e] - ? vt[e] - : e; - }, - getEnvironmentInfo: function(t) { - let e = U[t]; - return ( - e || - (e = { - params: '', - parser: null, - mathstyle: 'displaystyle', - tabular: !0, - colFormat: [], - lFence: '.', - rFence: '.', - }), - e - ); - }, - suggest: function(t) { - if (t.length <= 1) return []; - const e = []; - for (const i in V) - Object.prototype.hasOwnProperty.call(V, i) && - i.startsWith(t) && - !V[i].infix && - e.push({ match: i, frequency: V[i].frequency }); - for (const i in H) - Object.prototype.hasOwnProperty.call(H, i) && - i.startsWith(t) && - e.push({ match: i, frequency: H[i].frequency }); - return ( - e.sort((t, e) => - t.frequency === e.frequency - ? t.match.length - e.match.length - : (e.frequency || 0) - (t.frequency || 0) - ), - e - ); - }, - FREQUENCY_VALUE: X, - TEXT_SYMBOLS: vt, - MATH_SYMBOLS: H, - ENVIRONMENTS: U, - RIGHT_DELIM: { - '(': ')', - '{': '}', - '[': ']', - '|': '|', - '\\lbrace': '\\rbrace', - '\\{': '\\}', - '\\langle': '\\rangle', - '\\lfloor': '\\rfloor', - '\\lceil': '\\rceil', - '\\vert': '\\vert', - '\\lvert': '\\rvert', - '\\Vert': '\\Vert', - '\\lVert': '\\rVert', - '\\lbrack': '\\rbrack', - '\\ulcorner': '\\urcorner', - '\\llcorner': '\\lrcorner', - '\\lgroup': '\\rgroup', - '\\lmoustache': '\\rmoustache', - }, - FUNCTIONS: V, - MACROS: { - iff: '\\;⟺\\;', - nicefrac: '^{#1}\\!\\!/\\!_{#2}', - bra: '\\mathinner{\\langle{#1}|}', - ket: '\\mathinner{|{#1}\\rangle}', - braket: '\\mathinner{\\langle{#1}\\rangle}', - set: '\\mathinner{\\lbrace #1 \\rbrace}', - Bra: '\\left\\langle #1\\right|', - Ket: '\\left|#1\\right\\rangle', - Braket: '\\left\\langle{#1}\\right\\rangle', - Set: '\\left\\lbrace #1 \\right\\rbrace', - }, - COMMAND_MODE_CHARACTERS: /[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/, - LETTER: wt, - LETTER_AND_DIGITS: St, - }; - const Mt = N.makeSymbol, - Ct = N.makeSpan, - _t = N.makeVlist; - function Tt(t, e, i, s, a, o) { - const n = Mt('Size' + i + '-Regular', At.getValue('math', e)), - r = N.makeStyleWrap( - t, - Ct(n, 'delimsizing size' + i), - a.mathstyle, - M.TEXT, - o - ); - return ( - s && - r.setTop( - (1 - a.mathstyle.sizeMultiplier) * - a.mathstyle.metrics.axisHeight - ), - r.setStyle('color', a.color), - 'number' == typeof a.opacity && - r.setStyle('opacity', a.opacity), - r - ); - } - function Lt(t, e) { - let i = ''; - return ( - 'Size1-Regular' === e - ? (i = ' delim-size1') - : 'Size4-Regular' === e && (i = ' delim-size4'), - Ct(Mt(e, At.getValue('math', t)), 'delimsizinginner' + i) - ); - } - function Ft(t, e, i, s, a, o) { - let n, r, l, c; - (n = l = c = At.getValue('math', e)), (r = null); - let h = 'Size1-Regular'; - '\\vert' === e || - '\\lvert' === e || - '\\rvert' === e || - '\\mvert' === e || - '\\mid' === e - ? (l = n = c = '∣') - : '\\Vert' === e || - '\\lVert' === e || - '\\rVert' === e || - '\\mVert' === e || - '\\|' === e - ? (l = n = c = '∥') - : '\\uparrow' === e - ? (l = c = '⏐') - : '\\Uparrow' === e - ? (l = c = '‖') - : '\\downarrow' === e - ? (n = l = '⏐') - : '\\Downarrow' === e - ? (n = l = '‖') - : '\\updownarrow' === e - ? ((n = '↑'), (l = '⏐'), (c = '↓')) - : '\\Updownarrow' === e - ? ((n = '⇑'), (l = '‖'), (c = '⇓')) - : '[' === e || '\\lbrack' === e - ? ((n = '⎡'), (l = '⎢'), (c = '⎣'), (h = 'Size4-Regular')) - : ']' === e || '\\rbrack' === e - ? ((n = '⎤'), (l = '⎥'), (c = '⎦'), (h = 'Size4-Regular')) - : '\\lfloor' === e - ? ((l = n = '⎢'), (c = '⎣'), (h = 'Size4-Regular')) - : '\\lceil' === e - ? ((n = '⎡'), (l = c = '⎢'), (h = 'Size4-Regular')) - : '\\rfloor' === e - ? ((l = n = '⎥'), (c = '⎦'), (h = 'Size4-Regular')) - : '\\rceil' === e - ? ((n = '⎤'), (l = c = '⎥'), (h = 'Size4-Regular')) - : '(' === e - ? ((n = '⎛'), (l = '⎜'), (c = '⎝'), (h = 'Size4-Regular')) - : ')' === e - ? ((n = '⎞'), (l = '⎟'), (c = '⎠'), (h = 'Size4-Regular')) - : '\\{' === e || '\\lbrace' === e - ? ((n = '⎧'), - (r = '⎨'), - (c = '⎩'), - (l = '⎪'), - (h = 'Size4-Regular')) - : '\\}' === e || '\\rbrace' === e - ? ((n = '⎫'), - (r = '⎬'), - (c = '⎭'), - (l = '⎪'), - (h = 'Size4-Regular')) - : '\\lgroup' === e - ? ((n = '⎧'), (c = '⎩'), (l = '⎪'), (h = 'Size4-Regular')) - : '\\rgroup' === e - ? ((n = '⎫'), (c = '⎭'), (l = '⎪'), (h = 'Size4-Regular')) - : '\\lmoustache' === e - ? ((n = '⎧'), (c = '⎭'), (l = '⎪'), (h = 'Size4-Regular')) - : '\\rmoustache' === e - ? ((n = '⎫'), (c = '⎩'), (l = '⎪'), (h = 'Size4-Regular')) - : '\\surd' === e - ? ((n = ''), (c = '⎷'), (l = ''), (h = 'Size4-Regular')) - : '\\ulcorner' === e - ? ((n = '┌'), (l = c = ' ')) - : '\\urcorner' === e - ? ((n = '┐'), (l = c = ' ')) - : '\\llcorner' === e - ? ((c = '└'), (l = n = ' ')) - : '\\lrcorner' === e && ((n = '┘'), (l = n = ' ')); - const d = m.getCharacterMetrics(At.getValue('math', n), h), - p = d.height + d.depth, - u = m.getCharacterMetrics(At.getValue('math', l), h), - f = u.height + u.depth, - g = m.getCharacterMetrics(At.getValue('math', c), h), - y = g.height + g.depth; - let b = 0, - x = 1; - if (null !== r) { - const t = m.getCharacterMetrics(At.getValue('math', r), h); - (b = t.height + t.depth), (x = 2); - } - const k = p + y + b, - v = Math.ceil((i - k) / (x * f)), - w = k + v * x * f; - let S = a.mathstyle.metrics.axisHeight; - s && (S *= a.mathstyle.sizeMultiplier); - const A = w / 2 - S, - C = []; - if ((C.push(Lt(c, h)), null === r)) - for (let t = 0; t < v; t++) C.push(Lt(l, h)); - else { - for (let t = 0; t < v; t++) C.push(Lt(l, h)); - C.push(Lt(r, h)); - for (let t = 0; t < v; t++) C.push(Lt(l, h)); - } - C.push(Lt(n, h)); - const _ = _t(a, C, 'bottom', A); - return ( - _.setStyle('color', a.color), - 'number' == typeof a.opacity && - _.setStyle('opacity', a.opacity), - N.makeStyleWrap( - t, - Ct(_, 'delimsizing mult'), - a.mathstyle, - M.TEXT, - o - ) - ); - } - const Dt = [ - '(', - ')', - '[', - '\\lbrack', - ']', - '\\rbrack', - '\\{', - '\\lbrace', - '\\}', - '\\rbrace', - '\\lfloor', - '\\rfloor', - '\\lceil', - '\\rceil', - '\\surd', - ], - zt = [ - '\\uparrow', - '\\downarrow', - '\\updownarrow', - '\\Uparrow', - '\\Downarrow', - '\\Updownarrow', - '|', - '\\|', - '\\vert', - '\\Vert', - '\\lvert', - '\\rvert', - '\\lVert', - '\\rVert', - '\\mvert', - '\\mid', - '\\lgroup', - '\\rgroup', - '\\lmoustache', - '\\rmoustache', - ], - Et = [ - '<', - '>', - '\\langle', - '\\rangle', - '/', - '\\backslash', - '\\lt', - '\\gt', - ], - qt = [0, 1.2, 1.8, 2.4, 3], - It = [ - { type: 'small', mathstyle: M.SCRIPTSCRIPT }, - { type: 'small', mathstyle: M.SCRIPT }, - { type: 'small', mathstyle: M.TEXT }, - { type: 'large', size: 1 }, - { type: 'large', size: 2 }, - { type: 'large', size: 3 }, - { type: 'large', size: 4 }, - ], - Pt = [ - { type: 'small', mathstyle: M.SCRIPTSCRIPT }, - { type: 'small', mathstyle: M.SCRIPT }, - { type: 'small', mathstyle: M.TEXT }, - { type: 'stack' }, - ], - Ot = [ - { type: 'small', mathstyle: M.SCRIPTSCRIPT }, - { type: 'small', mathstyle: M.SCRIPT }, - { type: 'small', mathstyle: M.TEXT }, - { type: 'large', size: 1 }, - { type: 'large', size: 2 }, - { type: 'large', size: 3 }, - { type: 'large', size: 4 }, - { type: 'stack' }, - ]; - function Bt(t, e, i, s, a, o) { - if (!e || 0 === e.length || '.' === e) return $t(t, a, t); - let n; - '<' === e || '\\lt' === e - ? (e = '\\langle') - : ('>' !== e && '\\gt' !== e) || (e = '\\rangle'), - (n = Et.includes(e) ? It : Dt.includes(e) ? Ot : Pt); - const r = (function(t, e, i, s) { - for ( - let o = Math.min(2, 3 - s.mathstyle.size); - o < i.length && 'stack' !== i[o].type; - o++ - ) { - const s = m.getCharacterMetrics( - t, - 'small' === (a = i[o]).type - ? 'Main-Regular' - : 'large' === a.type - ? 'Size' + a.size + '-Regular' - : 'Size4-Regular' - ); - if (s.defaultMetrics) - return { type: 'small', mathstyle: M.SCRIPT }; - let n = s.height + s.depth; - if ( - ('small' === i[o].type && - (n *= i[o].mathstyle.sizeMultiplier), - n > e) - ) - return i[o]; - } - var a; - return i[i.length - 1]; - })(At.getValue('math', e), i, n, a); - return 'small' === r.type - ? (function(t, e, i, s, a, o) { - const n = Mt('AMS-Regular', At.getValue('math', e)), - r = N.makeStyleWrap(t, n, a.mathstyle, i, o); - return ( - s && - r.setTop( - (1 - - a.mathstyle.sizeMultiplier / - i.sizeMultiplier) * - a.mathstyle.metrics.axisHeight - ), - r.setStyle('color', a.color), - 'number' == typeof a.opacity && - r.setStyle('opacity', a.opacity), - r - ); - })(t, e, r.mathstyle, s, a, o) - : 'large' === r.type - ? Tt(t, e, r.size, s, a, o) - : Ft(t, e, i, s, a, o); - } - function $t(t, e, i) { - return N.makeSpanOfType( - t, - '', - 'sizing' + - e.mathstyle.adjustTo(M.TEXT) + - ' nulldelimiter ' + - (i || '') - ); - } - var Rt = { - makeSizedDelim: function(t, e, i, s, a) { - return '.' === e - ? $t(t, s, a) - : ('<' === e || '\\lt' === e - ? (e = '\\langle') - : ('>' !== e && '\\gt' !== e) || (e = '\\rangle'), - Dt.includes(e) || Et.includes(e) - ? Tt(t, e, i, !1, s, a) - : zt.includes(e) - ? Ft(t, e, qt[i], !1, s, a) - : null); - }, - makeCustomSizedDelim: Bt, - makeLeftRightDelim: function(t, e, i, s, a, o) { - if ('.' === e) return $t(t, a, o); - const n = - a.mathstyle.metrics.axisHeight * - a.mathstyle.sizeMultiplier, - r = 5 / m.METRICS.ptPerEm; - let l = s + n, - c = i - n; - c = Math.max(l, c); - let h = (901 * c) / 500; - return ( - (l = 2 * c - r), (h = Math.max(h, l)), Bt(t, e, h, !0, a, o) - ); - }, - }; - const Kt = N.makeSpan, - Nt = N.makeOrd, - Wt = N.makeInner, - Ht = N.makeHlist, - Vt = N.makeVlist, - Ut = /\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/, - jt = /^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/, - Gt = { - size1: 0.5, - size2: 0.7, - size3: 0.8, - size4: 0.9, - size5: 1, - size6: 1.2, - size7: 1.44, - size8: 1.73, - size9: 2.07, - size10: 2.49, - }; - class Zt { - constructor(t, e, i, s) { - (this.mode = t), - (this.type = e), - (this.body = i), - this.applyStyle(s); - } - getStyle() { - return { - color: this.phantom ? 'transparent' : this.color, - backgroundColor: this.phantom - ? 'transparent' - : this.backgroundColor, - fontFamily: - this.baseFontFamily || - this.fontFamily || - this.autoFontFamily, - fontShape: this.fontShape, - fontSeries: this.fontSeries, - fontSize: this.fontSize, - cssId: this.cssId, - cssClass: this.cssClass, - }; - } - applyStyle(t) { - if ( - (Object.assign(this, t), - 'none' === this.fontFamily && (this.fontFamily = ''), - 'auto' === this.fontShape && (this.fontShape = ''), - 'auto' === this.fontSeries && (this.fontSeries = ''), - 'none' === this.color && (this.color = ''), - 'none' === this.backgroundColor && - (this.backgroundColor = ''), - 'auto' === this.fontSize && (this.fontSize = ''), - this.fontSize && (this.maxFontSize = Gt[this.fontSize]), - 'math' === this.mode) - ) { - const t = 'string' == typeof this.body ? this.body : ''; - (this.autoFontFamily = 'cmr'), - jt.test(t) - ? (this.autoFontFamily = 'math') - : /\\imath|\\jmath|\\pounds/.test(t) - ? (this.autoFontFamily = 'mainit') - : Ut.test(t) || - 'math' !== this.baseFontFamily || - (this.autoFontFamily = 'cmr'); - } else - 'text' === this.mode && - ('root' !== this.type && (this.type = ''), - delete this.baseFontFamily, - delete this.autoFontFamily); - } - getInitialBaseElement() { - let t = this; - return ( - Array.isArray(this.body) && - this.body.length > 0 && - ('first' !== this.body[0].type - ? (t = this.body[0].getInitialBaseElement()) - : this.body[1] && - (t = this.body[1].getInitialBaseElement())), - t - ); - } - getFinalBaseElement() { - return Array.isArray(this.body) && this.body.length > 0 - ? this.body[this.body.length - 1].getFinalBaseElement() - : this; - } - isCharacterBox() { - const t = this.getInitialBaseElement(); - return /minner|mbin|mrel|mpunct|mopen|mclose|textord/.test( - t.type - ); - } - forEach(t) { - if ((t(this), Array.isArray(this.body))) - for (const e of this.body) e && e.forEach(t); - else this.body && 'object' == typeof this.body && t(this.body); - if (this.superscript) - for (const e of this.superscript) e && e.forEach(t); - if (this.subscript) - for (const e of this.subscript) e && e.forEach(t); - if (this.overscript) - for (const e of this.overscript) e && e.forEach(t); - if (this.underscript) - for (const e of this.underscript) e && e.forEach(t); - if (this.numer) for (const e of this.numer) e && e.forEach(t); - if (this.denom) for (const e of this.denom) e && e.forEach(t); - if (this.index) for (const e of this.index) e && e.forEach(t); - if (this.array) - for (const e of this.array) - for (const i of e) for (const e of i) e.forEach(t); - } - filter(t) { - let e = []; - t(this) && e.push(this); - for (const i of [ - 'body', - 'superscript', - 'subscript', - 'overscript', - 'underscript', - 'numer', - 'denom', - 'index', - ]) - if (Array.isArray(this[i])) - for (const s of this[i]) - s && (e = e.concat(s.filter(t))); - if (Array.isArray(this.array)) - for (const i of this.array) - for (const s of i) s && (e = e.concat(s.filter(t))); - return e; - } - decomposeGroup(t) { - const e = t.clone({ mathstyle: this.mathstyle }), - i = Nt(Qt(e, this.body)); - return ( - this.cssId && (i.cssId = this.cssId), - i.applyStyle({ - backgroundColor: this.backgroundColor, - cssClass: this.cssClass, - }), - i - ); - } - decomposeArray(t) { - let e = this.colFormat; - e && 0 === e.length && (e = [{ align: 'l' }]), - e || - (e = [ - { align: 'l' }, - { align: 'l' }, - { align: 'l' }, - { align: 'l' }, - { align: 'l' }, - { align: 'l' }, - { align: 'l' }, - { align: 'l' }, - { align: 'l' }, - { align: 'l' }, - ]); - const i = []; - let s = 0; - for (const t of e) t.align && s++; - for (const t of this.array) { - let e = 0; - for (; e < t.length; ) { - const a = [], - o = Math.min(t.length, e + s); - for (; e < o; ) a.push(t[e++]); - i.push(a); - } - } - 1 === i[i.length - 1].length && - 0 === i[i.length - 1][0].length && - i.pop(); - const a = M.toMathstyle(this.mathstyle) || t.mathstyle, - o = (this.arraystretch || 1) * h.baselineskip, - n = 0.7 * o, - r = 0.3 * o; - let l = 0, - c = 0; - const d = [], - p = i.length; - for (let e = 0; e < p; ++e) { - const s = i[e]; - c = Math.max(c, s.length); - let a = n, - o = r; - const h = []; - for (let e = 0; e < s.length; ++e) { - const i = - Qt( - t.clone({ mathstyle: this.mathstyle }), - s[e] - ) || [], - n = [Nt(null)].concat(i); - (o = Math.max(o, N.depth(n))), - (a = Math.max(a, N.height(n))), - h.push(n); - } - let m = e === p - 1 ? 0 : this.jot || 0; - this.rowGaps && - this.rowGaps[e] && - ((m = this.rowGaps[e]), - m > 0 && ((m += r), o < m && (o = m), (m = 0))), - (h.height = a), - (h.depth = o), - (l += a), - (h.pos = l), - (l += o + m), - d.push(h); - } - const m = l / 2 + a.metrics.axisHeight, - u = []; - for (let e = 0; e < c; e++) { - const i = []; - for (const t of d) { - const s = t[e]; - s && - ((s.depth = t.depth), - (s.height = t.height), - i.push(s), - i.push(t.pos - m)); - } - i.length > 0 && u.push(Vt(t, i, 'individualShift')); - } - const f = []; - let g = !1, - y = !1, - b = 0, - x = !this.lFence; - for (const i of e) { - if (i.align && b >= u.length) break; - if (i.align && b < u.length) - g - ? f.push(Xt(2 * h.arraycolsep)) - : (y || x) && f.push(Xt(h.arraycolsep)), - f.push(Kt(u[b], 'col-align-' + i.align)), - b++, - (g = !0), - (y = !1), - (x = !1); - else if (void 0 !== i.gap) - 'number' == typeof i.gap - ? f.push(Xt(i.gap)) - : f.push(Jt(t, d, m, i.gap)), - (g = !1), - (y = !1), - (x = !1); - else if (i.rule) { - const e = Kt(null, 'vertical-separator'); - e.setStyle('height', l, 'em'), - e.setStyle( - 'margin-top', - 3 * t.mathstyle.metrics.axisHeight - m, - 'em' - ), - e.setStyle('vertical-align', 'top'); - let i = 0; - y - ? (i = h.doubleRuleSep - h.arrayrulewidth) - : g && (i = h.arraycolsep - h.arrayrulewidth), - e.setLeft(i, 'em'), - f.push(e), - (g = !1), - (y = !0), - (x = !1); - } - } - if ( - (g && !this.rFence && f.push(Xt(h.arraycolsep)), - !( - (this.lFence && '.' !== this.lFence) || - (this.rFence && '.' !== this.rFence) - )) - ) - return Nt(f, 'mtable'); - const k = Kt(f, 'mtable'), - v = N.height(k), - w = N.depth(k); - return Nt([ - this.bind( - t, - Rt.makeLeftRightDelim('mopen', this.lFence, v, w, t) - ), - k, - this.bind( - t, - Rt.makeLeftRightDelim('mclose', this.rFence, v, w, t) - ), - ]); - } - decomposeGenfrac(t) { - const e = - 'auto' === this.mathstyle - ? t.mathstyle - : M.toMathstyle(this.mathstyle), - i = t.clone({ mathstyle: e }); - let s = []; - this.numerPrefix && s.push(Nt(this.numerPrefix)); - const a = this.continuousFraction ? e : e.fracNum(); - s = s.concat(Qt(i.clone({ mathstyle: a }), this.numer)); - const o = Ht(s, t.mathstyle.adjustTo(a)); - let n = []; - this.denomPrefix && n.push(Nt(this.denomPrefix)); - const r = this.continuousFraction ? e : e.fracDen(); - n = n.concat(Qt(i.clone({ mathstyle: r }), this.denom)); - const l = Ht(n, t.mathstyle.adjustTo(r)), - c = this.hasBarLine - ? h.defaultRuleThickness / e.sizeMultiplier - : 0; - let d, p, m; - e.size === M.DISPLAY.size - ? ((d = e.metrics.num1), - (p = c > 0 ? 3 * c : 7 * h.defaultRuleThickness), - (m = e.metrics.denom1)) - : (c > 0 - ? ((d = e.metrics.num2), (p = c)) - : ((d = e.metrics.num3), - (p = 3 * h.defaultRuleThickness)), - (m = e.metrics.denom2)); - const u = o ? o.depth : 0, - f = l ? l.height : 0; - let g; - if (0 === c) { - const t = d - u - (f - m); - t < p && ((d += 0.5 * (p - t)), (m += 0.5 * (p - t))), - (g = Vt(i, [o, -d, l, m], 'individualShift')); - } else { - const t = e.metrics.axisHeight; - d - u - (t + 0.5 * c) < p && - (d += p - (d - u - (t + 0.5 * c))), - t - 0.5 * c - (f - m) < p && - (m += p - (t - 0.5 * c - (f - m))); - const s = Kt(null, ' frac-line'); - s.applyStyle(this.getStyle()), (s.height = c); - const a = []; - o && (a.push(o), a.push(-d)), - a.push(s), - a.push(c / 2 - t), - l && (a.push(l), a.push(m)), - (g = Vt(i, a, 'individualShift')); - } - (g.classes += ' mfrac'), - (g.height *= e.sizeMultiplier / t.mathstyle.sizeMultiplier), - (g.depth *= e.sizeMultiplier / t.mathstyle.sizeMultiplier); - const y = - e.size === M.DISPLAY.size - ? e.metrics.delim1 - : e.metrics.delim2, - b = this.bind( - t, - Rt.makeCustomSizedDelim( - 'mopen', - this.leftDelim, - y, - !0, - t.clone({ mathstyle: e }) - ) - ), - x = this.bind( - t, - Rt.makeCustomSizedDelim( - 'mclose', - this.rightDelim, - y, - !0, - t.clone({ mathstyle: e }) - ) - ); - b.applyStyle(this.getStyle()), x.applyStyle(this.getStyle()); - const k = Nt( - [b, g, x], - t.parentSize !== t.size - ? 'sizing reset-' + t.parentSize + ' ' + t.size - : '' - ); - return this.bind(t, k); - } - decomposeLeftright(t) { - if (!this.body) - return this.leftDelim - ? new Zt('math', 'mopen', this.leftDelim).decompose(t) - : this.rightDelim - ? new Zt('math', 'mclose', this.rightDelim).decompose(t) - : null; - const e = t.clone(), - i = Qt(e, this.body), - s = e.mathstyle; - let a = 0, - o = 0, - n = []; - if ( - ((a = N.height(i) * s.sizeMultiplier), - (o = N.depth(i) * s.sizeMultiplier), - this.leftDelim && - (n.push( - this.bind( - t, - Rt.makeLeftRightDelim( - 'mopen', - this.leftDelim, - a, - o, - e, - 'ML__open' - ) - ) - ), - n[n.length - 1].applyStyle(this.getStyle())), - i) - ) { - for (let s = 0; s < i.length; s++) - if (i[s].delim) { - const n = i[s].caret, - r = /ML__selected/.test(i[s].classes); - (i[s] = this.bind( - t, - Rt.makeLeftRightDelim( - 'minner', - i[s].delim, - a, - o, - e - ) - )), - (i[s].caret = n), - i[s].selected(r); - } - n = n.concat(i); - } - if (this.rightDelim) { - let i, - s = this.rightDelim; - '?' === s && - ((s = { - '(': ')', - '\\{': '\\}', - '\\[': '\\]', - '\\lbrace': '\\rbrace', - '\\langle': '\\rangle', - '\\lfloor': '\\rfloor', - '\\lceil': '\\rceil', - '\\vert': '\\vert', - '\\lvert': '\\rvert', - '\\Vert': '\\Vert', - '\\lVert': '\\rVert', - '\\lbrack': '\\rbrack', - '\\ulcorner': '\\urcorner', - '\\llcorner': '\\lrcorner', - '\\lgroup': '\\rgroup', - '\\lmoustache': '\\rmoustache', - }[this.leftDelim]), - (s = s || this.leftDelim), - (i = 'ML__smart-fence__close')), - n.push( - this.bind( - t, - Rt.makeLeftRightDelim( - 'mclose', - s, - a, - o, - e, - (i || '') + ' ML__close' - ) - ) - ), - n[n.length - 1].applyStyle(this.getStyle()); - } - return this.inner ? Wt(n, s.cls()) : n; - } - decomposeSurd(t) { - const e = t.mathstyle, - i = Qt(t.cramp(), this.body), - s = h.defaultRuleThickness / e.sizeMultiplier; - let a = s; - e.id < M.TEXT.id && (a = e.metrics.xHeight); - let o = s + a / 4; - const n = - Math.max( - 2 * a, - (N.height(i) + N.depth(i)) * e.sizeMultiplier - ) + - (o + s), - r = Kt( - Rt.makeCustomSizedDelim('', '\\surd', n, !1, t), - 'sqrt-sign' - ); - r.applyStyle(this.getStyle()); - const l = r.height + r.depth - s; - l > N.height(i) + N.depth(i) + o && - (o = (o + l - (N.height(i) + N.depth(i))) / 2), - r.setTop(r.height - N.height(i) - (o + s)); - const c = Kt(null, t.mathstyle.adjustTo(M.TEXT) + ' sqrt-line'); - c.applyStyle(this.getStyle()), (c.height = s); - const d = Vt(t, [i, o, c, s]); - if (!this.index) return this.bind(t, Nt([r, d], 'sqrt')); - const p = t.clone({ mathstyle: M.SCRIPTSCRIPT }), - m = Kt(Qt(p, this.index), e.adjustTo(M.SCRIPTSCRIPT)), - u = Math.max(r.height, d.height), - f = Math.max(r.depth, d.depth), - g = Vt(t, [m], 'shift', -0.6 * (u - f)); - return this.bind(t, Nt([Kt(g, 'root'), r, d], 'sqrt')); - } - decomposeAccent(t) { - const e = t.mathstyle; - let i = Qt(t.cramp(), this.body); - (this.superscript || this.subscript) && - (i = this.attachSupsub(t, Nt(i), 'mord')); - let s = 0; - Array.isArray(this.body) && - 1 === this.body.length && - this.body[0].isCharacterBox() && - (s = N.skew(i)); - const a = Math.min(N.height(i), e.metrics.xHeight), - o = N.makeSymbol('Main-Regular', this.accent, 'math'); - o.italic = 0; - const n = '⃗' === this.accent ? ' accent-vec' : ''; - let r = Kt(Kt(o), 'accent-body' + n); - return ( - (r = Vt(t, [i, -a, r])), - r.children[1].setLeft(2 * s), - Nt(r, 'accent') - ); - } - decomposeLine(t) { - const e = t.mathstyle, - i = Qt(t.cramp(), this.body), - s = h.defaultRuleThickness / e.sizeMultiplier, - a = Kt( - null, - t.mathstyle.adjustTo(M.TEXT) + - ' ' + - this.position + - '-line' - ); - let o; - if ( - ((a.height = s), - (a.maxFontSize = 1), - 'overline' === this.position) - ) - o = Vt(t, [i, 3 * s, a, s]); - else { - const e = Kt(i); - o = Vt(t, [s, a, 3 * s, e], 'top', N.height(e)); - } - return Nt(o, this.position); - } - decomposeOverunder(t) { - const e = Qt(t, this.body), - i = t.clone({ mathstyle: 'scriptstyle' }), - s = this.overscript - ? Kt( - Qt(i, this.overscript), - t.mathstyle.adjustTo(i.mathstyle) - ) - : null, - a = this.underscript - ? Kt( - Qt(i, this.underscript), - t.mathstyle.adjustTo(i.mathstyle) - ) - : null; - return Yt(t, e, 0, 0, s, a, this.mathtype || 'mrel'); - } - decomposeOverlap(t) { - const e = Kt(Qt(t, this.body), 'inner'); - return Nt( - [e, Kt(null, 'fix')], - 'left' === this.align ? 'llap' : 'rlap' - ); - } - decomposeRule(t) { - const e = t.mathstyle, - i = Nt('', 'rule'); - let s = this.shift && !isNaN(this.shift) ? this.shift : 0; - s /= e.sizeMultiplier; - const a = this.width / e.sizeMultiplier, - o = this.height / e.sizeMultiplier; - return ( - i.setStyle('border-right-width', a, 'em'), - i.setStyle('border-top-width', o, 'em'), - i.setStyle('margin-top', -(o - s), 'em'), - i.setStyle('border-color', t.color), - (i.width = a), - (i.height = o + s), - (i.depth = -s), - i - ); - } - decomposeOp(t) { - const e = t.mathstyle; - let i, - s = !1; - e.size === M.DISPLAY.size && - 'string' == typeof this.body && - '\\smallint' !== this.body && - (s = !0); - let a = 0, - o = 0; - if (this.symbol) { - const n = s ? 'Size2-Regular' : 'Size1-Regular'; - (i = N.makeSymbol( - n, - this.body, - 'op-symbol ' + (s ? 'large-op' : 'small-op') - )), - (i.type = 'mop'), - (a = - (i.height - i.depth) / 2 - - e.metrics.axisHeight * e.sizeMultiplier), - (o = i.italic), - this.bind(t, i); - } else - Array.isArray(this.body) - ? ((i = N.makeOp(Qt(t, this.body))), this.bind(t, i)) - : (i = this.makeSpan(t, this.body)); - if (this.superscript || this.subscript) { - const s = this.limits || 'auto'; - return this.alwaysHandleSupSub || - 'limits' === s || - ('auto' === s && e.size === M.DISPLAY.size) - ? this.attachLimits(t, i, a, o) - : this.attachSupsub(t, i, 'mop'); - } - return this.symbol && i.setTop(a), i; - } - decomposeBox(t) { - const e = Nt(Qt(t, this.body)), - i = Kt(); - i.setStyle('position', 'absolute'); - const s = - 'number' == typeof this.padding ? this.padding : h.fboxsep; - i.setStyle('height', e.height + e.depth + 2 * s, 'em'), - 0 !== s - ? i.setStyle('width', 'calc(100% + ' + 2 * s + 'em)') - : i.setStyle('width', '100%'), - i.setStyle('top', -s, 'em'), - i.setStyle('left', -s, 'em'), - i.setStyle('z-index', '-1'), - this.backgroundcolor && - i.setStyle('background-color', this.backgroundcolor), - this.framecolor && - i.setStyle( - 'border', - h.fboxrule + 'em solid ' + this.framecolor - ), - this.border && i.setStyle('border', this.border), - e.setStyle('display', 'inline-block'), - e.setStyle('height', e.height + e.depth, 'em'), - e.setStyle('vertical-align', -e.depth + s, 'em'); - const a = Kt([i, e]); - return ( - a.setStyle('position', 'relative'), - a.setStyle('vertical-align', -s + e.depth, 'em'), - (a.height = e.height + s), - (a.depth = e.depth + s), - a.setLeft(s), - a.setRight(s), - a - ); - } - decomposeEnclose(t) { - const e = Nt(Qt(t, this.body)), - i = 'auto' === this.padding ? 0.2 : this.padding; - e.setStyle('padding', i, 'em'), - e.setStyle('display', 'inline-block'), - e.setStyle('height', e.height + e.depth, 'em'), - e.setStyle('left', -i, 'em'), - this.backgroundcolor && - 'transparent' !== this.backgroundcolor && - e.setStyle('background-color', this.backgroundcolor); - let s = ''; - if ( - (this.notation.box && - e.setStyle('border', this.borderStyle), - this.notation.actuarial && - (e.setStyle('border-top', this.borderStyle), - e.setStyle('border-right', this.borderStyle)), - this.notation.madruwb && - (e.setStyle('border-bottom', this.borderStyle), - e.setStyle('border-right', this.borderStyle)), - this.notation.roundedbox && - (e.setStyle( - 'border-radius', - (N.height(e) + N.depth(e)) / 2, - 'em' - ), - e.setStyle('border', this.borderStyle)), - this.notation.circle && - (e.setStyle('border-radius', '50%'), - e.setStyle('border', this.borderStyle)), - this.notation.top && - e.setStyle('border-top', this.borderStyle), - this.notation.left && - e.setStyle('border-left', this.borderStyle), - this.notation.right && - e.setStyle('border-right', this.borderStyle), - this.notation.bottom && - e.setStyle('border-bottom', this.borderStyle), - this.notation.horizontalstrike && - ((s += ' 0 - ? i.setWidth(this.width) - : i.setStyle('margin-left', this.width, 'em'); - else { - const t = - { - qquad: 'qquad', - quad: 'quad', - enspace: 'enspace', - ';': 'thickspace', - ':': 'mediumspace', - ',': 'thinspace', - '!': 'negativethinspace', - }[this.body] || 'quad'; - i = Kt('​', 'mspace ' + t); - } - else - 'mathstyle' === this.type - ? t.setMathstyle(this.mathstyle) - : 'box' === this.type - ? (i = this.decomposeBox(t)) - : 'enclose' === this.type - ? (i = this.decomposeEnclose(t)) - : 'command' === this.type || 'error' === this.type - ? ((i = this.makeSpan(t, this.body)), - (i.classes = ''), - this.error && (i.classes += ' ML__error'), - this.suggestion && (i.classes += ' ML__suggestion')) - : 'placeholder' === this.type - ? (i = this.makeSpan(t, '⬚')) - : 'first' === this.type && (i = this.makeSpan(t, '​')); - if (!i) return i; - if ( - (this.caret && - 'styling' !== this.type && - 'msubsup' !== this.type && - 'command' !== this.type && - 'placeholder' !== this.type && - 'first' !== this.type && - (Array.isArray(i) - ? (i[i.length - 1].caret = this.caret) - : (i.caret = this.caret)), - this.containsCaret && - (Array.isArray(i) - ? ((i[0].classes = - (i[0].classes || '') + ' ML__contains-caret'), - (i[i.length - 1].classes = - (i[i.length - 1].classes || '') + - ' ML__contains-caret')) - : (i.classes = - (i.classes || '') + ' ML__contains-caret')), - !this.limits && (this.superscript || this.subscript)) - ) - if (Array.isArray(i)) { - const e = i[i.length - 1]; - i[i.length - 1] = this.attachSupsub(t, e, e.type); - } else i = [this.attachSupsub(t, i, i.type)]; - return Array.isArray(i) ? i : [i]; - } - attachSupsub(t, e, i) { - if (!this.superscript && !this.subscript) return e; - const s = t.mathstyle; - let a = null, - o = null; - if (this.superscript) { - const e = Qt(t.sup(), this.superscript); - a = Kt(e, s.adjustTo(s.sup())); - } - if (this.subscript) { - const e = Qt(t.sub(), this.subscript); - o = Kt(e, s.adjustTo(s.sub())); - } - let n, - r = 0, - l = 0; - this.isCharacterBox() || - ((r = N.height(e) - s.metrics.supDrop), - (l = N.depth(e) + s.metrics.subDrop)), - (n = - s === M.DISPLAY - ? s.metrics.sup1 - : s.cramped - ? s.metrics.sup3 - : s.metrics.sup2); - const c = M.TEXT.sizeMultiplier * s.sizeMultiplier, - d = 0.5 / h.ptPerEm / c; - let p = null; - if (o && a) { - (r = Math.max(r, n, a.depth + 0.25 * s.metrics.xHeight)), - (l = Math.max(l, s.metrics.sub2)); - const i = h.defaultRuleThickness; - if (r - N.depth(a) - (N.height(o) - l) < 4 * i) { - l = 4 * i - (r - a.depth) + N.height(o); - const t = 0.8 * s.metrics.xHeight - (r - N.depth(a)); - t > 0 && ((r += t), (l -= t)); - } - (p = Vt(t, [o, l, a, -r], 'individualShift')), - this.symbol && p.children[0].setLeft(-N.italic(e)); - } else - o && !a - ? ((l = Math.max( - l, - s.metrics.sub1, - N.height(o) - 0.8 * s.metrics.xHeight - )), - (p = Vt(t, [o], 'shift', l)), - p.children[0].setRight(d), - this.isCharacterBox() && - p.children[0].setLeft(-N.italic(e))) - : !o && - a && - ((r = Math.max( - r, - n, - a.depth + 0.25 * s.metrics.xHeight - )), - (p = Vt(t, [a], 'shift', -r)), - p.children[0].setRight(d)); - const m = Kt(p, 'msubsup'); - return ( - this.caret && (m.caret = this.caret), - N.makeSpanOfType(i, [e, m]) - ); - } - attachLimits(t, e, i, s) { - const a = this.superscript - ? Kt( - Qt(t.sup(), this.superscript), - t.mathstyle.adjustTo(t.mathstyle.sup()) - ) - : null, - o = this.subscript - ? Kt( - Qt(t.sub(), this.subscript), - t.mathstyle.adjustTo(t.mathstyle.sub()) - ) - : null; - return Yt(t, e, i, s, a, o, 'mop'); - } - bind(t, e) { - return ( - 'first' !== this.type && - '​' !== this.body && - ((this.id = (function(t) { - let e; - return ( - 'boolean' == typeof t.generateID && t.generateID - ? (e = - Date.now() - .toString(36) - .slice(-2) + - Math.floor( - 1e5 * Math.random() - ).toString(36)) - : 'object' == typeof t.generateID && - ((e = t.generateID.overrideID - ? t.generateID.overrideID - : t.generateID.seed.toString(36)), - (t.generateID.seed += 1)), - e - ); - })(t)), - this.id && - (e.attributes || (e.attributes = {}), - (e.attributes['data-atom-id'] = this.id))), - e - ); - } - makeSpan(t, e) { - const i = 'textord' === this.type ? 'mord' : this.type, - s = N.makeSpanOfType(i, e), - a = this.getStyle(); - s.applyStyle(a); - const o = a && a.fontSize ? a.fontSize : 'size5'; - return ( - o !== t.parentSize - ? ((s.classes += ' sizing reset-' + t.parentSize), - (s.classes += ' ' + o)) - : t.parentSize !== t.size && - ((s.classes += ' sizing reset-' + t.parentSize), - (s.classes += ' ' + t.size)), - (s.maxFontSize = Math.max( - s.maxFontSize, - t.sizeMultiplier || 1 - )), - 'text' === this.mode && (s.classes += ' ML__text'), - t.mathstyle.isTight() && (s.isTight = !0), - 'math' !== this.mode && (s.italic = 0), - s.setRight(s.italic), - 'number' == typeof t.opacity && - s.setStyle('opacity', t.opacity), - this.bind(t, s), - this.caret && - (this.superscript || - this.subscript || - ((s.caret = this.caret), - t.mathstyle.isTight() && (s.isTight = !0))), - s - ); - } - } - function Xt(t) { - const e = Kt('​', 'arraycolsep'); - return e.setWidth(t, 'em'), e; - } - function Jt(t, e, i, s) { - const a = []; - for (const o of e) { - const e = Kt(Qt(t, s)); - (e.depth = o.depth), - (e.height = o.height), - a.push(e), - a.push(o.pos - i); - } - return Vt(t, a, 'individualShift'); - } - function Yt(t, e, i, s, a, o, n) { - if (!a && !o) return e; - e = Kt(e); - let r = 0, - l = 0; - a && (r = Math.max(h.bigOpSpacing1, h.bigOpSpacing3 - a.depth)), - o && - (l = Math.max(h.bigOpSpacing2, h.bigOpSpacing4 - o.height)); - let c = null; - if (o && a) { - const n = - h.bigOpSpacing5 + - N.height(o) + - N.depth(o) + - l + - N.depth(e) + - i; - (c = Vt( - t, - [h.bigOpSpacing5, o, l, e, r, a, h.bigOpSpacing5], - 'bottom', - n - )), - c.children[0].setLeft(-s), - c.children[2].setLeft(s); - } else if (o && !a) { - const a = N.height(e) - i; - (c = Vt(t, [h.bigOpSpacing5, o, l, e], 'top', a)), - c.children[0].setLeft(-s); - } else if (!o && a) { - const o = N.depth(e) + i; - (c = Vt(t, [e, r, a, h.bigOpSpacing5], 'bottom', o)), - c.children[1].setLeft(s); - } - return N.makeSpanOfType(n, c, 'op-limits'); - } - function Qt(t, e) { - function i(t) { - return 'mord' === t.type && /[0-9,.]/.test(t.latex); - } - function s(t) { - return 'text' === t.mode; - } - t instanceof _ || (t = new _(t)); - const a = !t.generateID || !t.generateID.groupNumbers; - let o = []; - if (Array.isArray(e)) { - if (0 === e.length) return o; - if (1 === e.length) - (o = e[0].decompose(t)), - o && - a && - e[0].isSelected && - o.forEach(t => t.selected(!0)); - else { - let n = 'none', - r = e[1].type, - l = [], - c = null, - h = !0, - d = null; - for (let p = 0; p < e.length; p++) { - 'mbin' === e[p].type && - (/first|none|mrel|mpunct|mopen|mbin|mop/.test(n) || - /none|mrel|mpunct|mclose/.test(r)) && - (e[p].type = 'mord'), - ('​' === e[p].body && - (e[p].superscript || e[p].subscript)) || - (d = null), - t.generateID.groupNumbers && - c && - ((h && i(e[p])) || (!h && s(e[p]))) && - (t.generateID.overrideID = c); - const m = e[p].decompose(t, d); - if ( - (t.generateID && (t.generateID.overrideID = null), - m) - ) { - const n = [].concat.apply([], m); - (d = n), - t.generateID && - t.generateID.groupNumbers && - ((i(e[p]) || s(e[p])) && - ((c && h === i(e[p])) || - ((h = i(e[p])), (c = e[p].id))), - ((!i(e[p]) && !s(e[p])) || - e[p].superscript || - e[p].subscript) && - c && - (c = null)), - a && e[p].isSelected - ? ((l = l.concat(n)), - l.forEach(t => t.selected(!0))) - : (l.length > 0 && - ((o = [...o, ...l]), (l = [])), - (o = o.concat(n))); - } - (n = e[p].getFinalBaseElement().type), - (r = e[p + 1] - ? e[p + 1].getInitialBaseElement().type - : 'none'); - } - l.length > 0 && ((o = [...o, ...l]), (l = [])); - } - } else - e && - ((o = e.decompose(t)), - o && a && e.isSelected && o.forEach(t => t.selected(!0))); - if (!o || 0 === o.length) return null; - if (t.mathstyle !== t.parentMathstyle) { - const e = - t.mathstyle.sizeMultiplier / - t.parentMathstyle.sizeMultiplier; - for (const t of o) (t.height *= e), (t.depth *= e); - } - if (t.size !== t.parentSize) { - const e = Gt[t.size] / Gt[t.parentSize]; - for (const t of o) (t.height *= e), (t.depth *= e); - } - return o; - } - var te = { - MathAtom: Zt, - decompose: Qt, - makeRoot: function(t, e) { - const i = new Zt((t = t || 'math'), 'root', e || []); - return ( - (0 !== i.body.length && 'first' === i.body[0].type) || - i.body.unshift(new Zt('', 'first')), - i - ); - }, - GREEK_REGEX: Ut, - }; - const ee = { - m0: '#3f3d99', - m1: '#993d71', - m2: '#998b3d', - m3: '#3d9956', - m4: '#3d5a99', - m5: '#993d90', - m6: '#996d3d', - m7: '#43993d', - m8: '#3d7999', - m9: '#843d99', - }, - ie = { - apricot: '#FBB982', - aquamarine: '#00B5BE', - bittersweet: '#C04F17', - black: '#221E1F', - blue: '#2D2F92', - bluegreen: '#00B3B8', - blueviolet: '#473992', - brickred: '#B6321C', - brown: '#792500', - burntorange: '#F7921D', - cadetblue: '#74729A', - carnationpink: '#F282B4', - cerulean: '#00A2E3', - cornflowerblue: '#41B0E4', - cyan: '#00AEEF', - dandelion: '#FDBC42', - darkorchid: '#A4538A', - emerald: '#00A99D', - forestgreen: '#009B55', - fuchsia: '#8C368C', - goldenrod: '#FFDF42', - gray: '#949698', - green: '#00A64F', - greenyellow: '#DFE674', - junglegreen: '#00A99A', - lavender: '#F49EC4', - limegreen: '#8DC73E', - magenta: '#EC008C', - mahogany: '#A9341F', - maroon: '#AF3235', - melon: '#F89E7B', - midnightblue: '#006795', - mulberry: '#A93C93', - navyblue: '#006EB8', - olivegreen: '#3C8031', - orange: '#F58137', - orangered: '#ED135A', - orchid: '#AF72B0', - peach: '#F7965A', - periwinkle: '#7977B8', - pinegreen: '#008B72', - plum: '#92268F', - processblue: '#00B0F0', - purple: '#99479B', - rawsienna: '#974006', - red: '#ED1B23', - redorange: '#F26035', - redviolet: '#A1246B', - rhodamine: '#EF559F', - royalblue: '#0071BC', - royalpurple: '#613F99', - rubinered: '#ED017D', - salmon: '#F69289', - seagreen: '#3FBC9D', - sepia: '#671800', - skyblue: '#46C5DD', - springgreen: '#C6DC67', - tan: '#DA9D76', - tealblue: '#00AEB3', - thistle: '#D883B7', - turquoise: '#00B4CE', - violet: '#58429B', - violetred: '#EF58A0', - white: '#FFFFFF', - wildstrawberry: '#EE2967', - yellow: '#FFF200', - yellowgreen: '#98CC70', - yelloworange: '#FAA21A', - }; - var se = function(t) { - const e = t.toLowerCase().split('!'); - let i, - s, - a, - o = 255, - n = 255, - r = 255, - l = -1; - const c = e.length > 0 && '-' === e[0].charAt(0); - c && (e[0] = e[0].slice(1)); - for (let t = 0; t < e.length; t++) { - (i = o), (s = n), (a = r); - let c = e[t].match(/([a-z0-9]*)/); - c && (c = c[1]); - let h = ie[c] || ee[c]; - h || (h = e[t]); - let d = h.match( - /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i - ); - if (d && d[1] && d[2] && d[3]) - (o = Math.max(0, Math.min(255, parseInt(d[1], 16)))), - (n = Math.max( - 0, - Math.min(255, parseInt(d[2], 16)) - )), - (r = Math.max( - 0, - Math.min(255, parseInt(d[3], 16)) - )); - else if (((d = h.match(/^#([0-9a-f]{3})$/i)), d && d[1])) { - const t = parseInt(d[1][0], 16), - e = parseInt(d[1][1], 16), - i = parseInt(d[1][2], 16); - (o = Math.max(0, Math.min(255, 16 * t + t))), - (n = Math.max(0, Math.min(255, 16 * e + e))), - (r = Math.max(0, Math.min(255, 16 * i + i))); - } else { - if ( - ((d = h.match( - /^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i - )), - !(d && d[1] && d[2] && d[3])) - ) - return null; - (o = Math.max(0, Math.min(255, parseInt(d[1])))), - (n = Math.max(0, Math.min(255, parseInt(d[2])))), - (r = Math.max(0, Math.min(255, parseInt(d[3])))); - } - l >= 0 && - ((o = (1 - l) * o + l * i), - (n = (1 - l) * n + l * s), - (r = (1 - l) * r + l * a), - (l = -1)), - t + 1 < e.length && - (l = - Math.max(0, Math.min(100, parseInt(e[++t]))) / - 100); - } - return ( - l >= 0 && - ((o = l * o + (1 - l) * i), - (n = l * n + (1 - l) * s), - (r = l * r + (1 - l) * a)), - c && ((o = 255 - o), (n = 255 - n), (r = 255 - r)), - '#' + - ('00' + Math.round(o).toString(16)).slice(-2) + - ('00' + Math.round(n).toString(16)).slice(-2) + - ('00' + Math.round(r).toString(16)).slice(-2) - ); - }, - ae = function(t) { - let e = t.toUpperCase(); - for (const t in ie) - if (ie[t] === e) { - e = t; - break; - } - for (const t in ee) - if (ee[t] === e) { - e = t; - break; - } - return e; - }, - oe = [ - '#d35d60', - '#7293cb', - '#e1974d', - '#84bb5d', - '#9066a7', - '#aD6a58', - '#f5a4ce', - '#fff590', - '#212121', - '#818787', - '#d4d5d2', - '#ffffff', - ], - ne = [ - '#cc2428', - '#3769b1', - '#da7e30', - '#409852', - '#6b4c9a', - '#922426', - '#e7298a', - '#ffe907', - '#000000', - '#525055', - '#adafaa', - '#ffffff', - ]; - const re = te.MathAtom; - class le { - constructor(t, e, i) { - (this.tokens = t), - (this.index = 0), - (this.args = e), - (this.macros = i), - (this.mathList = []), - (this.style = {}), - (this.parseMode = 'math'), - (this.tabularMode = !1), - (this.endCount = 0); - } - swapMathList(t) { - const e = this.mathList; - return (this.mathList = t || []), e; - } - swapParseMode(t) { - const e = this.parseMode; - return (this.parseMode = t), e; - } - end() { - return ( - this.endCount++, - this.index >= this.tokens.length || this.endCount > 1e3 - ); - } - get() { - return ( - (this.endCount = 0), - this.index < this.tokens.length - ? this.tokens[this.index++] - : null - ); - } - peek(t) { - const e = this.index + (t || 0); - return e < this.tokens.length ? this.tokens[e] : null; - } - lastMathAtom() { - const t = - 0 === this.mathList.length - ? 'none' - : this.mathList[this.mathList.length - 1].type; - if ('mop' !== t && 'msubsup' !== t) { - const t = new re(this.parseMode, 'msubsup', '​'); - (t.attributes = { 'aria-hidden': !0 }), - this.mathList.push(t); - } - return this.mathList[this.mathList.length - 1]; - } - hasToken(t) { - const e = this.index; - return e < this.tokens.length && this.tokens[e].type === t; - } - hasLiteral(t) { - const e = this.index; - return ( - e < this.tokens.length && - 'literal' === this.tokens[e].type && - (!t || this.tokens[e].value === t) - ); - } - hasLiteralPattern(t) { - return ( - this.hasToken('literal') && - t.test(this.tokens[this.index].value) - ); - } - hasCommand(t) { - const e = this.index; - return ( - e < this.tokens.length && - 'command' === this.tokens[e].type && - this.tokens[e].value === t - ); - } - hasInfixCommand() { - const t = this.index; - if ( - t < this.tokens.length && - 'command' === this.tokens[t].type - ) { - const e = At.getInfo( - '\\' + this.tokens[t].value, - this.parseMode, - this.macros - ); - return e && e.infix; - } - return !1; - } - hasColumnSeparator() { - const t = this.index; - return ( - !!(this.tabularMode && t < this.tokens.length) && - 'literal' === this.tokens[t].type && - '&' === this.tokens[t].value - ); - } - hasRowSeparator() { - const t = this.index; - return ( - !!(this.tabularMode && t < this.tokens.length) && - 'command' === this.tokens[t].type && - ('\\' === this.tokens[t].value || - 'cr' === this.tokens[t].value) - ); - } - parseColumnSeparator() { - return !!this.hasColumnSeparator() && (this.index++, !0); - } - placeholder() { - if (this.args && 'string' == typeof this.args['?']) - return ce( - n(this.args['?']), - this.parseMode, - null, - this.macros - ); - const t = new re( - this.parseMode, - 'placeholder', - '?', - this.style - ); - return (t.captureSelection = !0), [t]; - } - hasImplicitCommand(t) { - if (this.index < this.tokens.length) { - const e = this.tokens[this.index]; - if ('command' === e.type) return t.includes(e.value); - } - return !1; - } - parseRowSeparator() { - return !!this.hasRowSeparator() && (this.index++, !0); - } - parseToken(t) { - return !!this.hasToken(t) && (this.index++, !0); - } - skipWhitespace() { - let t = !1; - for (; this.hasToken('space'); ) this.index++, (t = !0); - return t; - } - skipUntilToken(t) { - for (; !this.end() && !this.parseToken(t); ) this.get(); - } - parseCommand(t) { - return !!this.hasCommand(t) && (this.index++, !0); - } - parseLiteral(t) { - return !!this.hasLiteral(t) && (this.index++, !0); - } - parseFiller() { - let t = !1, - e = !1; - do { - const i = this.skipWhitespace(), - s = this.parseCommand('relax'); - (t = t || i || s), (e = !i && !s); - } while (!e); - return t; - } - parseKeyword(t) { - const e = this.index; - let i = this.end(), - s = ''; - for (; !i; ) { - const e = this.get(); - 'literal' === e.type && (s += e.value), - (i = - this.end() || - 'literal' !== e.type || - s.length >= t.length); - } - const a = t.toUpperCase() === s.toUpperCase(); - return a || (this.index = e), a; - } - scanString() { - let t = '', - e = this.end(); - for (; !e; ) { - if (this.hasLiteral(']')) e = !0; - else if (this.hasToken('literal')) t += this.get().value; - else if (this.skipWhitespace()) t += ' '; - else if (this.hasToken('command')) { - const e = this.get(); - 'space' === e.value ? (t += ' ') : (t += e.value); - } else e = !0; - e = e || this.end(); - } - return t; - } - scanColor() { - return se(this.scanString()); - } - scanNumber(t) { - const e = this.parseLiteral('-'); - e || this.parseLiteral('+'), this.skipWhitespace(), (t = !!t); - let i = 10, - s = /[0-9]/; - this.parseLiteral("'") - ? ((i = 8), (s = /[0-7]/), (t = !0)) - : (this.parseLiteral('"') || this.parseLiteral('x')) && - ((i = 16), (s = /[0-9A-F]/), (t = !0)); - let a = ''; - for (; this.hasLiteralPattern(s); ) a += this.get().value; - if (!t && (this.parseLiteral('.') || this.parseLiteral(','))) - for (a += '.'; this.hasLiteralPattern(s); ) - a += this.get().value; - const o = t ? parseInt(a, i) : parseFloat(a); - return e ? -o : o; - } - scanDimen() { - const t = this.scanNumber(!1); - let e; - return ( - this.skipWhitespace(), - (e = this.parseKeyword('pt') - ? m.toEm(t, 'pt') - : this.parseKeyword('mm') - ? m.toEm(t, 'mm') - : this.parseKeyword('cm') - ? m.toEm(t, 'cm') - : this.parseKeyword('ex') - ? m.toEm(t, 'ex') - : this.parseKeyword('px') - ? m.toEm(t, 'px') - : this.parseKeyword('em') - ? m.toEm(t, 'em') - : this.parseKeyword('bp') - ? m.toEm(t, 'bp') - : this.parseKeyword('dd') - ? m.toEm(t, 'dd') - : this.parseKeyword('pc') - ? m.toEm(t, 'pc') - : this.parseKeyword('in') - ? m.toEm(t, 'in') - : this.parseKeyword('mu') - ? m.toEm(t, 'mu') - : m.toEm(t, 'pt')), - e - ); - } - scanSkip() { - const t = this.scanDimen(); - return ( - this.skipWhitespace(), - this.parseKeyword('plus') && this.scanDimen(), - this.skipWhitespace(), - this.parseKeyword('minus') && this.scanDimen(), - t - ); - } - scanColspec() { - this.skipWhitespace(); - const t = []; - for ( - ; - !this.end() && !this.hasToken('}') && !this.hasLiteral(']'); - - ) - if (this.hasLiteral()) { - const e = this.get().value; - if ('lcr'.includes(e)) t.push({ align: e }); - else if ('|' === e) t.push({ rule: !0 }); - else if ('@' === e) { - if (this.parseToken('{')) { - const e = this.swapParseMode('math'); - t.push({ - gap: this.scanImplicitGroup( - t => '}' === t.type - ), - }), - this.swapParseMode(e); - } - this.parseToken('}'); - } - } - return t; - } - scanModeSet() { - let t; - if ( - (this.parseCommand('(') && (t = ')'), - !t && this.parseCommand('[') && (t = ']'), - !t) - ) - return null; - const e = this.swapParseMode('math'), - i = new re('math', 'group'); - return ( - (i.mathstyle = ')' === t ? 'textstyle' : 'displaystyle'), - (i.body = this.scanImplicitGroup( - e => 'command' === e.type && e.value === t - )), - this.parseCommand(t), - this.swapParseMode(e), - i.body && 0 !== i.body.length ? i : null - ); - } - scanModeShift() { - if (!this.hasToken('$') && !this.hasToken('$$')) return null; - const t = this.get().type, - e = new re('math', 'group'); - (e.mathstyle = '$' === t ? 'textstyle' : 'displaystyle'), - (e.latexOpen = 'textstyle' === e.mathstyle ? '$' : '$$'), - (e.latexClose = e.latexOpen); - const i = this.swapParseMode('math'); - return ( - (e.body = this.scanImplicitGroup(e => e.type === t)), - this.parseToken(t), - this.swapParseMode(i), - e.body && 0 !== e.body.length ? e : null - ); - } - scanEnvironment() { - if (!this.parseCommand('begin')) return null; - const t = this.scanArg('string'), - e = At.getEnvironmentInfo(t), - i = []; - if (e && e.params) - for (const t of e.params) - if (t.optional) { - const e = this.scanOptionalArg(t.type); - i.push(e); - } else i.push(this.scanArg(t.type)); - const s = this.parseMode, - a = this.tabularMode, - o = this.swapMathList([]); - this.tabularMode = e.tabular; - const n = [], - r = []; - let l = [], - c = !1; - do { - if ( - ((c = this.end()), - !c && - this.parseCommand('end') && - (c = this.scanArg('string') === t), - !c) - ) - if (this.parseColumnSeparator()) - l.push(this.swapMathList([])); - else if (this.parseRowSeparator()) { - l.push(this.swapMathList([])); - let t = 0; - this.skipWhitespace(), - this.parseLiteral('[') && - ((t = this.scanDimen()), - this.skipWhitespace(), - this.parseLiteral(']')), - r.push(t || 0), - n.push(l), - (l = []); - } else - this.mathList = this.mathList.concat( - this.scanImplicitGroup() - ); - } while (!c); - l.push(this.swapMathList([])), l.length > 0 && n.push(l); - const h = this.swapMathList(o); - if ( - ((this.parseMode = s), - (this.tabularMode = a), - !e.tabular && 0 === h.length) - ) - return null; - if (e.tabular && 0 === n.length) return null; - const d = new re( - this.parseMode, - 'array', - h, - e.parser ? e.parser(t, i, n) : {} - ); - return ( - (d.array = n), - (d.rowGaps = r), - (d.env = { ...e }), - (d.env.name = t), - d - ); - } - scanImplicitGroup(t) { - const e = this.style; - t || - (t = t => - '}' === t.type || - ('literal' === t.type && '&' === t.value) || - ('command' === t.type && - /^(end|cr|\\)$/.test(t.value))); - let i = null, - s = null; - const a = this.swapMathList([]); - for (; !this.end() && !t(this.peek()); ) - if ( - this.hasImplicitCommand([ - 'displaystyle', - 'textstyle', - 'scriptstyle', - 'scriptscriptstyle', - ]) - ) { - this.parseMode = 'math'; - const t = new re('math', 'mathstyle'); - (t.mathstyle = this.get().value), this.mathList.push(t); - } else - this.hasInfixCommand() && !i - ? ((i = this.get()), (s = this.swapMathList([]))) - : this.parseAtom(); - let o; - if (i) { - const t = this.swapMathList(a), - e = At.getInfo('\\' + i.value, 'math', this.macros); - o = e - ? [ - new re( - this.parseMode, - e.type, - e.value || i.value, - e.parse - ? e.parse('\\' + i.value, [s, t]) - : null - ), - ] - : [new re(this.parseMode, 'mop', i.value)]; - } else o = this.swapMathList(a); - return (this.style = e), o; - } - scanGroup() { - if (!this.parseToken('{')) return null; - const t = new re(this.parseMode, 'group'); - return ( - (t.body = this.scanImplicitGroup(t => '}' === t.type)), - this.parseToken('}'), - (t.latexOpen = '{'), - (t.latexClose = '}'), - t - ); - } - scanSmartFence() { - if ((this.skipWhitespace(), !this.parseLiteral('('))) - return null; - const t = new re(this.parseMode, 'leftright'); - (t.leftDelim = '('), (t.inner = !1); - const e = this.swapMathList([]); - let i = 1; - for (; !this.end() && 0 !== i; ) - this.hasLiteral('(') && (i += 1), - this.hasLiteral(')') && (i -= 1), - 0 !== i && this.parseAtom(); - return ( - 0 === i && this.parseLiteral(')'), - (t.rightDelim = 0 === i ? ')' : '?'), - (t.body = this.swapMathList(e)), - t - ); - } - scanDelim() { - this.skipWhitespace(); - const t = this.get(); - if (!t) return null; - let e = '.'; - 'command' === t.type - ? (e = '\\' + t.value) - : 'literal' === t.type && (e = t.value); - const i = At.getInfo(e, 'math', this.macros); - return i - ? 'mopen' === i.type || 'mclose' === i.type - ? e - : /^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test( - e - ) - ? e - : null - : null; - } - scanLeftRight() { - if (this.parseCommand('right') || this.parseCommand('mright')) - return null; - const t = this.style; - let e = 'right'; - if (!this.parseCommand('left')) { - if (!this.parseCommand('mleft')) return null; - e = 'mright'; - } - const i = this.scanDelim(); - if (!i) return null; - const s = this.swapMathList([]); - for (; !this.end() && !this.parseCommand(e); ) this.parseAtom(); - this.style = t; - const a = this.scanDelim(), - o = new re(this.parseMode, 'leftright'); - return ( - (o.leftDelim = i), - (o.rightDelim = a), - (o.inner = 'right' === e), - (o.body = this.swapMathList(s)), - o - ); - } - parseSupSub() { - if ('math' !== this.parseMode) return !1; - let t = !1; - for ( - ; - this.hasLiteral('^') || - this.hasLiteral('_') || - this.hasLiteral("'"); - - ) { - let e; - if ( - (this.hasLiteral('^') - ? (e = 'superscript') - : this.hasLiteral('_') && (e = 'subscript'), - this.parseLiteral('^') || this.parseLiteral('_')) - ) { - const i = this.scanArg(); - if (i) { - const s = this.lastMathAtom(); - (s[e] = s[e] || []), - (s[e] = s[e].concat(i)), - (t = !0); - } - } else if (this.parseLiteral("'")) { - const e = this.lastMathAtom(); - (e.superscript = e.superscript || []), - e.superscript.push( - new re(e.parseMode, 'mord', '′') - ), - (t = !0); - } - } - return t; - } - parseLimits() { - if (this.parseCommand('limits')) { - const t = this.lastMathAtom(); - return (t.limits = 'limits'), (t.explicitLimits = !0), !0; - } - if (this.parseCommand('nolimits')) { - const t = this.lastMathAtom(); - return (t.limits = 'nolimits'), (t.explicitLimits = !0), !0; - } - return !1; - } - scanOptionalArg(t) { - if ( - ((t = t && 'auto' !== t ? t : this.parseMode), - this.skipWhitespace(), - !this.parseLiteral('[')) - ) - return null; - const e = this.parseMode; - this.parseMode = t; - const i = this.swapMathList(); - let s; - for (; !this.end() && !this.parseLiteral(']'); ) - if ('string' === t) s = this.scanString(); - else if ('number' === t) s = this.scanNumber(); - else if ('dimen' === t) s = this.scanDimen(); - else if ('skip' === t) s = this.scanSkip(); - else if ('colspec' === t) s = this.scanColspec(); - else if ('color' === t) s = this.scanColor() || '#ffffff'; - else if ('bbox' === t) { - const t = this.scanString() - .toLowerCase() - .trim() - .split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/); - for (const e of t) { - const t = se(e); - if (t) (s = s || {}), (s.backgroundcolor = t); - else { - const t = e.match( - /^\s*([0-9.]+)\s*([a-z][a-z])/ - ); - if (t) - (s = s || {}), - (s.padding = m.toEm(t[1], t[2])); - else { - const t = e.match(/^\s*border\s*:\s*(.*)/); - t && ((s = s || {}), (s.border = t[1])); - } - } - } - } else - this.mathList = this.mathList.concat( - this.scanImplicitGroup( - t => 'literal' === t.type && ']' === t.value - ) - ); - this.parseMode = e; - const a = this.swapMathList(i); - return s || a; - } - scanArg(t) { - let e; - if ( - ((t = t && 'auto' !== t ? t : this.parseMode), - this.parseFiller(), - !this.parseToken('{')) - ) { - if ('delim' === t) return this.scanDelim() || '.'; - if (/^(math|text)$/.test(t)) { - const e = this.parseMode; - this.parseMode = t; - const i = this.scanToken(); - return ( - (this.parseMode = e), - Array.isArray(i) ? i : i ? [i] : null - ); - } - } - if (this.hasToken('#')) { - const t = this.get(); - return ( - this.skipUntilToken('}'), - '?' === t.value - ? this.placeholder() - : this.args - ? void 0 === this.args[t.value] && - void 0 !== this.args['?'] - ? this.placeholder() - : this.args[t.value] || null - : null - ); - } - const i = this.parseMode; - this.parseMode = t; - const s = this.swapMathList([]); - if ('string' === t) - (e = this.scanString()), this.skipUntilToken('}'); - else if ('number' === t) - (e = this.scanNumber()), this.skipUntilToken('}'); - else if ('dimen' === t) - (e = this.scanDimen()), this.skipUntilToken('}'); - else if ('skip' === t) - (e = this.scanSkip()), this.skipUntilToken('}'); - else if ('colspec' === t) - (e = this.scanColspec()), this.skipUntilToken('}'); - else if ('color' === t) - (e = this.scanColor() || '#ffffff'), - this.skipUntilToken('}'); - else if ('delim' === t) - (e = this.scanDelim() || '.'), this.skipUntilToken('}'); - else - do { - this.mathList = this.mathList.concat( - this.scanImplicitGroup() - ); - } while (!this.parseToken('}') && !this.end()); - this.parseMode = i; - const a = this.swapMathList(s); - return e || a; - } - scanToken() { - const t = this.get(); - if (!t) return null; - let e = null; - if ('space' === t.type) - 'text' === this.parseMode && - (e = new re('text', '', ' ', this.style)); - else if ('placeholder' === t.type) - (e = new re(this.parseMode, 'placeholder', t.value)), - (e.captureSelection = !0); - else if ('command' === t.type) { - if ('placeholder' === t.value) - (e = new re( - this.parseMode, - 'placeholder', - this.scanArg('string'), - this.style - )), - (e.captureSelection = !0); - else if ('char' === t.value) { - let t = Math.floor(this.scanNumber(!0)); - (!isFinite(t) || t < 0 || t > 1114111) && (t = 10067), - (e = new re( - this.parseMode, - 'math' === this.parseMode ? 'mord' : '', - String.fromCodePoint(t) - )), - (e.latex = - '{\\char"' + - ('000000' + t.toString(16)) - .toUpperCase() - .substr(-6) + - '}'); - } else if ('hskip' === t.value || 'kern' === t.value) { - const i = this.scanSkip(); - isFinite(i) && - ((e = new re( - this.parseMode, - 'spacing', - null, - this.style - )), - (e.width = i)), - (e.latex = '\\' + t.value); - } else if (((e = this.scanMacro(t.value)), !e)) { - const i = At.getInfo( - '\\' + t.value, - this.parseMode, - this.macros - ), - s = []; - let a = '', - o = ''; - if (i && i.params) - for (const t of i.params) - if (t.optional) { - const e = this.scanOptionalArg(t.type); - s.push(e); - } else if (t.type.endsWith('*')) - o = t.type.slice(0, -1); - else { - const e = this.scanArg(t.type); - if ( - (e && - 1 === e.length && - 'placeholder' === e[0].type && - t.placeholder && - (e[0].value = t.placeholder), - e) - ) - s.push(e); - else if (t.placeholder) { - const e = new re( - this.parseMode, - 'placeholder', - t.placeholder - ); - (e.captureSelection = !0), s.push([e]); - } else s.push(this.placeholder()); - 'math' !== t.type && - 'string' == typeof e && - (a += e); - } - if (i && !i.infix) { - if (i.parse) { - const a = i.parse('\\' + t.value, s); - if (a.type) - e = new re( - this.parseMode, - i.type, - o ? this.scanArg(o) : null, - { ...this.style, ...a } - ); - else { - const t = this.parseMode; - if ( - (a.mode && - ((this.parseMode = a.mode), - delete a.mode), - o) - ) { - const t = this.style; - (this.style = { ...this.style, ...a }), - (e = this.scanArg(o)), - (this.style = t); - } else this.style = { ...this.style, ...a }; - this.parseMode = t; - } - } else { - const s = { ...this.style }; - i.baseFontFamily && - (s.baseFontFamily = i.baseFontFamily), - (e = new re( - this.parseMode, - i.type || 'mop', - i.value || t.value, - s - )), - i.skipBoundary && (e.skipBoundary = !0); - } - if ( - e && - !/^(llap|rlap|class|cssId)$/.test(t.value) && - ((e.latex = '\\' + t.value), - a && (e.latex += '{' + a + '}'), - e.isFunction && this.smartFence) - ) { - const t = this.scanSmartFence(); - t && (e = [e, t]); - } - } - i || - ((e = new re( - this.parseMode, - 'error', - '\\' + t.value - )), - (e.latex = '\\' + t.value)); - } - } else if ('literal' === t.type) { - const i = At.getInfo(t.value, this.parseMode, this.macros); - if (i) { - const s = { ...this.style }; - i.baseFontFamily && - (s.baseFontFamily = i.baseFontFamily), - (e = new re( - this.parseMode, - i.type, - i.value || t.value, - s - )), - i.isFunction && (e.isFunction = !0); - } else - e = new re( - this.parseMode, - 'math' === this.parseMode ? 'mord' : '', - t.value, - this.style - ); - if ( - ((e.latex = At.matchCodepoint( - this.parseMode, - t.value.codePointAt(0) - )), - i && i.isFunction && this.smartFence) - ) { - const t = this.scanSmartFence(); - t && (e = [e, t]); - } - } else if ('#' === t.type) - if ('?' === t.value) e = this.placeholder(); - else if (this.args) - if ( - ((e = this.args[t.value] || null), - Array.isArray(e) && 1 === e.length) - ) - e = e[0]; - else if (Array.isArray(e)) { - const t = new re(this.parseMode, 'group'); - (t.body = e), (e = t); - } else e = this.placeholder(); - return e; - } - scanMacro(t) { - if (!this.macros || !this.macros[t]) return null; - const e = {}; - let i, - s = 0; - 'string' == typeof this.macros[t] - ? ((i = this.macros[t]), - /(^|[^\\])#1/.test(i) && (s = 1), - /(^|[^\\])#2/.test(i) && (s = 2), - /(^|[^\\])#3/.test(i) && (s = 3), - /(^|[^\\])#4/.test(i) && (s = 4), - /(^|[^\\])#5/.test(i) && (s = 5), - /(^|[^\\])#6/.test(i) && (s = 6), - /(^|[^\\])#7/.test(i) && (s = 7), - /(^|[^\\])#8/.test(i) && (s = 8), - /(^|[^\\])#9/.test(i) && (s = 9)) - : ((i = this.macros[t].def), - (s = this.macros[t].args || 0)); - for (let t = 1; t <= s; t++) e[t] = this.scanArg(); - this.args && - 'string' == typeof this.args['?'] && - (e['?'] = this.args['?']); - const a = new re( - this.parseMode, - 'group', - ce(n(i), this.parseMode, e, this.macros) - ); - (a.captureSelection = !0), (a.latex = '\\' + t); - let o = ''; - for (let t = 1; t <= s; t++) { - if (((o += '{'), Array.isArray(e[t]))) - for (let i = 0; i < e[t].length; i++) - o += e[t][i].latex; - o += '}'; - } - return (a.latex += o || ''), a; - } - parseAtom() { - let t = - this.scanEnvironment() || - this.scanModeShift() || - this.scanModeSet() || - this.scanGroup() || - this.scanLeftRight(); - return ( - !(t || (!this.parseSupSub() && !this.parseLimits())) || - (t || (t = this.scanToken()), - Array.isArray(t) - ? (this.mathList = this.mathList.concat(t)) - : t && this.mathList.push(t), - null !== t) - ); - } - } - function ce(t, e, i, s, a) { - let o = []; - const n = new le(t, i, s); - for ( - n.parseMode = e || 'math', a && (n.smartFence = !0); - !n.end(); - - ) - o = o.concat(n.scanImplicitGroup()); - return o; - } - var he = { Parser: le, parseTokens: ce }; - function de(t, e) { - let i = ''; - for (const e of t) i += e.relation + ':' + e.offset + '/'; - return e && (i += '#' + e), i; - } - function pe(t) { - const e = { path: [], extent: 0 }, - i = t.split('#'); - i.length > 1 && (e.extent = parseInt(i[1])); - const s = i[0].split('/'); - for (const t of s) { - const i = t.match(/([^:]*):(.*)/); - i && e.path.push({ relation: i[1], offset: parseInt(i[2]) }); - } - return e; - } - var me = { - pathFromString: pe, - pathToString: de, - pathDistance: function(t, e) { - let i = 0, - s = -1, - a = !1; - for (; !a; ) - (s += 1), - (a = s >= t.length || s >= e.length), - (a = - a || - !( - t[s].relation === e[s].relation && - t[s].offset === e[s].offset - )); - return ( - (i = - s === t.length && s === e.length - ? 0 - : s + 1 === t.length && - s + 1 === e.length && - t[s].relation === e[s].relation - ? 1 - : 2), - i - ); - }, - pathCommonAncestor: function(t, e) { - const i = [], - s = Math.min(t.length - 1, e.length - 1); - let a = 0; - for ( - ; - a <= s && - t[a].relation === e[a].relation && - t[a].offset === e[a].offset; - - ) - i.push(t[a]), (a += 1); - return i; - }, - clone: function(t) { - return pe(de(t)).path; - }, - }; - const ue = { - Left: 'moveToPreviousChar', - Right: 'moveToNextChar', - Up: 'moveUp', - Down: 'moveDown', - 'Shift-Left': 'extendToPreviousChar', - 'Shift-Right': 'extendToNextChar', - 'Shift-Up': 'extendUp', - 'Shift-Down': 'extendDown', - Backspace: 'deletePreviousChar', - 'Alt-Del': 'deletePreviousChar', - Del: 'deleteNextChar', - 'Alt-Backspace': 'deleteNextChar', - 'Alt-Left': 'moveToPreviousWord', - 'Alt-Right': 'moveToNextWord', - 'Alt-Shift-Left': 'extendToPreviousWord', - 'Alt-Shift-Right': 'extendToNextWord', - 'Ctrl-Left': 'moveToGroupStart', - 'Ctrl-Right': 'moveToGroupEnd', - 'Ctrl-Shift-Left': 'extendToGroupStart', - 'Ctrl-Shift-Right': 'extendToGroupEnd', - 'math:Spacebar': 'moveAfterParent', - 'math:Shift-Spacebar': 'moveBeforeParent', - Home: 'moveToMathFieldStart', - 'mac:Meta-Left': 'moveToMathFieldStart', - 'Shift-Home': 'extendToMathFieldStart', - 'mac:Meta-Shift-Left': 'extendToMathFieldStart', - End: 'moveToMathFieldEnd', - 'mac:Meta-Right': 'moveToMathFieldEnd', - 'Shift-End': 'extendToMathFieldEnd', - 'mac:Meta-Shift-Right': 'extendToMathFieldEnd', - PageUp: 'moveToGroupStart', - PageDown: 'moveToGroupEnd', - 'math:Tab': 'moveToNextPlaceholder', - 'math:F8': 'moveToNextPlaceholder', - 'math:Shift-Tab': 'moveToPreviousPlaceholder', - 'math:Shift-F8': 'moveToPreviousPlaceholder', - 'text:Tab': 'moveToNextPlaceholder', - 'text:F8': 'moveToNextPlaceholder', - 'text:Shift-Tab': 'moveToPreviousPlaceholder', - 'text:Shift-F8': 'moveToPreviousPlaceholder', - 'math:Esc': ['switch-mode', 'command'], - 'math:Backslash': ['switch-mode', 'command'], - 'math:IntlBackslash': ['switch-mode', 'command'], - 'math:Alt-Equal': ['apply-style', { mode: 'text' }], - 'text:Alt-Equal': ['apply-style', { mode: 'math' }], - 'command:Esc': ['complete', { discard: !0 }], - 'command:Tab': ['complete', { acceptSuggestion: !0 }], - 'command:Return': 'complete', - 'command:Enter': 'complete', - 'command:Shift-Esc': ['complete', { discard: !0 }], - 'command:Down': 'nextSuggestion', - 'ios:command:Tab': 'nextSuggestion', - 'command:Up': 'previousSuggestion', - '!mac:Ctrl-KeyA': 'selectAll', - 'mac:Meta-KeyA': 'selectAll', - Cut: 'cut', - Copy: 'copy', - Paste: 'paste', - Clear: 'delete', - '!mac:Ctrl-KeyZ': 'undo', - 'mac:Meta-KeyZ': 'undo', - Undo: 'undo', - '!mac:Ctrl-KeyY': 'redo', - 'mac:Meta-Shift-KeyY': 'redo', - '!mac:Ctrl-Shift-KeyZ': 'redo', - 'mac:Meta-Shift-KeyZ': 'redo', - Redo: 'redo', - EraseEof: 'deleteToGroupEnd', - 'mac:Ctrl-KeyB': 'moveToPreviousChar', - 'mac:Ctrl-KeyF': 'moveToNextChar', - 'mac:Ctrl-KeyP': 'moveUp', - 'mac:Ctrl-KeyN': 'moveDown', - 'mac:Ctrl-KeyA': 'moveToMathFieldStart', - 'mac:Ctrl-KeyE': 'moveToMathFieldEnd', - 'mac:Ctrl-Shift-KeyB': 'extendToPreviousChar', - 'mac:Ctrl-Shift-KeyF': 'extendToNextChar', - 'mac:Ctrl-Shift-KeyP': 'extendUp', - 'mac:Ctrl-Shift-KeyN': 'extendDown', - 'mac:Ctrl-Shift-KeyA': 'extendToMathFieldStart', - 'mac:Ctrl-Shift-KeyE': 'extendToMathFieldEnd', - 'mac:Ctrl-Alt-KeyB': 'moveToPreviousWord', - 'mac:Ctrl-Alt-KeyF': 'moveToNextWord', - 'mac:Ctrl-Shift-Alt-KeyB': 'extendToPreviousWord', - 'mac:Ctrl-Shift-Alt-KeyF': 'extendToNextWord', - 'mac:Ctrl-KeyH': 'deletePreviousChar', - 'mac:Ctrl-KeyD': 'deleteNextChar', - 'mac:Ctrl-KeyL': 'scrollIntoView', - 'mac:Ctrl-KeyT': 'transpose', - 'math:Shift-Quote': ['switch-mode', 'text', '', '“'], - 'text:Shift-Quote': ['switch-mode', 'math', '”', ''], - 'math:Ctrl-Digit2': ['insert', '\\sqrt{#0}'], - 'math:Ctrl-Digit5': 'moveToOpposite', - 'math:Ctrl-Digit6': 'moveToSuperscript', - 'math:Ctrl-Minus': 'moveToSubscript', - 'math:Alt-BracketLeft': [ - 'insert', - '\\left\\lbrack #0 \\right\\rbrack', - ], - 'math:Alt-Shift-BracketLeft': [ - 'insert', - '\\left\\lbrace #0 \\right\\rbrace', - ], - 'math:Return': 'addRowAfter', - 'math:Enter': 'addRowAfter', - 'math:Ctrl-Comma': 'addColumnAfter', - 'math:Alt-KeyQ': ['insert', '\\theta'], - 'math:Alt-KeyP': ['insert', '\\pi'], - 'math:Alt-KeyV': ['insert', '\\sqrt{#0}'], - 'math:Alt-KeyW': ['insert', '\\sum_{i=#?}^{#?}'], - 'math:Alt-KeyB': ['insert', '\\int_{#?}^{#?}'], - 'math:Alt-KeyU': ['insert', '\\cup'], - 'math:Alt-KeyN': ['insert', '\\cap'], - 'math:Alt-KeyO': ['insert', '\\emptyset'], - 'math:Alt-KeyD': ['insert', '\\differentialD'], - 'math:Alt-Shift-KeyO': ['insert', '\\varnothing'], - 'math:Alt-Shift-KeyD': ['insert', '\\partial'], - 'math:Alt-Shift-KeyP': ['insert', '\\prod_{i=#?}^{#?}'], - 'math:Alt-Shift-KeyU': ['insert', '\\bigcup'], - 'math:Alt-Shift-KeyN': ['insert', '\\bigcap'], - 'math:Alt-Shift-KeyA': ['insert', '\\forall'], - 'math:Alt-Shift-KeyE': ['insert', '\\exists'], - 'math:Alt-Digit5': ['insert', '\\infty'], - 'math:Alt-Digit6': ['insert', '\\wedge'], - 'math:Alt-Shift-Digit6': ['insert', '\\vee'], - 'math:Alt-Digit9': ['insert', '('], - 'math:Alt-Digit0': ['insert', ')'], - 'math:Alt-Shift-Backslash': ['insert', '|'], - 'math:Alt-Backslash': ['insert', '\\backslash'], - 'math:Slash': ['insert', '\\frac{#@}{#?}'], - 'math:Alt-Slash': ['insert', '\\frac{#?}{#@}'], - 'math:NumpadDivide': ['insert', '\\frac{#@}{#?}'], - 'math:Alt-NumpadDivide': ['insert', '\\frac{#?}{#@}'], - 'math:Shift-Backquote': ['insert', '\\~'], - 'math:Alt-Shift-Slash': ['insert', '\\/'], - 'Alt-Shift-KeyK': 'toggleKeystrokeCaption', - 'Alt-Space': 'toggleVirtualKeyboard', - 'mac:Ctrl-Meta-Up': [ - 'speak', - 'parent', - { withHighlighting: !1 }, - ], - '!mac:Ctrl-Alt-Up': [ - 'speak', - 'parent', - { withHighlighting: !1 }, - ], - 'mac:Ctrl-Meta-Down': [ - 'speak', - 'all', - { withHighlighting: !1 }, - ], - '!mac:Ctrl-Alt-Down': [ - 'speak', - 'all', - { withHighlighting: !1 }, - ], - 'mac:Ctrl-Meta-Left': [ - 'speak', - 'left', - { withHighlighting: !1 }, - ], - '!mac:Ctrl-Alt-Left': [ - 'speak', - 'left', - { withHighlighting: !1 }, - ], - 'mac:Ctrl-Meta-Right': [ - 'speak', - 'right', - { withHighlighting: !1 }, - ], - '!mac:Ctrl-Alt-Right': [ - 'speak', - 'right', - { withHighlighting: !1 }, - ], - '!mac:Ctrl-Alt-Period': [ - 'speak', - 'selection', - { withHighlighting: !1 }, - ], - 'mac:Ctrl-Meta-Period': [ - 'speak', - 'selection', - { withHighlighting: !1 }, - ], - 'mac:Ctrl-Meta-Shift-Up': [ - 'speak', - 'parent', - { withHighlighting: !0 }, - ], - '!mac:Ctrl-Alt-Shift-Up': [ - 'speak', - 'parent', - { withHighlighting: !0 }, - ], - 'mac:Ctrl-Meta-Shift-Down': [ - 'speak', - 'all', - { withHighlighting: !0 }, - ], - '!mac:Ctrl-Alt-Shift-Down': [ - 'speak', - 'all', - { withHighlighting: !0 }, - ], - 'mac:Ctrl-Meta-Shift-Left': [ - 'speak', - 'left', - { withHighlighting: !0 }, - ], - '!mac:Ctrl-Alt-Shift-Left': [ - 'speak', - 'left', - { withHighlighting: !0 }, - ], - 'mac:Ctrl-Meta-Shift-Right': [ - 'speak', - 'right', - { withHighlighting: !0 }, - ], - '!mac:Ctrl-Alt-Shift-Right': [ - 'speak', - 'right', - { withHighlighting: !0 }, - ], - '!mac:Ctrl-Alt-Shift-Period': [ - 'speak', - 'selection', - { withHighlighting: !0 }, - ], - 'mac:Ctrl-Meta-Shift-Period': [ - 'speak', - 'selection', - { withHighlighting: !0 }, - ], - }, - fe = { - '\\theta': 'Alt-KeyQ', - '\\sqrt': ['Alt-KeyV', 'Ctrl-Digit2'], - '\\pi': 'Alt-KeyP', - '\\prod': 'Alt-Shift-KeyP', - '\\sum': 'Alt-KeyW', - '\\int': 'Alt-KeyB', - '\\cup': 'Alt-KeyU', - '\\cap': 'Alt-KeyN', - '\\bigcup': 'Alt-Shift-KeyU', - '\\bigcap': 'Alt-Shift-KeyN', - '\\forall': 'Alt-Shift-KeyA', - '\\exists': 'Alt-Shift-KeyE', - '\\infty': 'Alt-Digit5', - '\\wedge': 'Alt-Digit5', - '\\vee': 'Alt-Shift-Digit6', - '\\differentialD': 'Alt-keyD', - '\\partial': 'Alt-Shift-KeyD', - '\\frac': 'Slash', - '\\emptyset': 'Alt-KeyO', - '\\varnothing': 'Alt-Shift-KeyO', - '\\~': '~', - }, - ge = { - "''": { mode: 'math', value: '^{\\doubleprime}' }, - alpha: '\\alpha', - delta: '\\delta', - Delta: '\\Delta', - pi: { mode: 'math', value: '\\pi' }, - 'pi ': { mode: 'text', value: '\\pi ' }, - Pi: { mode: 'math', value: '\\Pi' }, - theta: '\\theta', - Theta: '\\Theta', - ii: { - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\imaginaryI', - }, - jj: { - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\imaginaryJ', - }, - ee: { - mode: 'math', - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\exponentialE', - }, - nabla: { mode: 'math', value: '\\nabla' }, - grad: { mode: 'math', value: '\\nabla' }, - del: { mode: 'math', value: '\\partial' }, - '∞': '\\infty', - oo: { - mode: 'math', - after: - 'nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space', - value: '\\infty', - }, - '∑': { mode: 'math', value: '\\sum' }, - sum: { mode: 'math', value: '\\sum_{#?}^{#?}' }, - prod: { mode: 'math', value: '\\prod_{#?}^{#?}' }, - sqrt: { mode: 'math', value: '\\sqrt' }, - '∆': { mode: 'math', value: '\\differentialD' }, - '∂': { mode: 'math', value: '\\differentialD' }, - sin: { mode: 'math', value: '\\sin' }, - cos: { mode: 'math', value: '\\cos' }, - tan: { mode: 'math', value: '\\tan' }, - tanh: { mode: 'math', value: '\\tanh' }, - log: { mode: 'math', value: '\\log' }, - ln: { mode: 'math', value: '\\ln' }, - exp: { mode: 'math', value: '\\exp' }, - lim: { mode: 'math', value: '\\lim_{#?}' }, - dx: '\\differentialD x', - dy: '\\differentialD y', - dt: '\\differentialD t', - AA: { mode: 'math', value: '\\forall' }, - EE: { mode: 'math', value: '\\exists' }, - '!EE': { mode: 'math', value: '\\nexists' }, - '&&': { mode: 'math', value: '\\land' }, - xin: { - mode: 'math', - after: 'nothing+text+relop+punct+openfence+space', - value: 'x \\in', - }, - in: { - mode: 'math', - after: 'nothing+letter+closefence', - value: '\\in', - }, - '!in': { mode: 'math', value: '\\notin' }, - NN: '\\N', - ZZ: '\\Z', - QQ: '\\Q', - RR: '\\R', - CC: '\\C', - PP: '\\P', - xx: '\\times', - '+-': '\\pm', - '!=': '\\ne', - '>=': '\\ge', - '<=': '\\le', - '<<': '\\ll', - '>>': '\\gg', - '~~': '\\approx', - '≈': '\\approx', - '?=': '\\questeq', - '÷': '\\div', - '¬': '\\neg', - ':=': '\\coloneq', - '::': '\\Colon', - '(:': '\\langle', - ':)': '\\rangle', - beta: '\\beta', - chi: '\\chi', - epsilon: '\\epsilon', - varepsilon: '\\varepsilon', - eta: { - mode: 'math', - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\eta', - }, - 'eta ': { - mode: 'text', - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\eta ', - }, - gamma: '\\gamma', - Gamma: '\\Gamma', - iota: '\\iota', - kappa: '\\kappa', - lambda: '\\lambda', - Lambda: '\\Lambda', - mu: { - mode: 'math', - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\mu', - }, - 'mu ': { - mode: 'text', - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\mu ', - }, - nu: { - mode: 'math', - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\nu', - }, - 'nu ': { - mode: 'text', - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\nu ', - }, - µ: '\\mu', - phi: { - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\phi', - }, - Phi: { - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\Phi', - }, - varphi: '\\varphi', - psi: { - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\psi', - }, - Psi: { - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\Psi', - }, - rho: { - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\rho', - }, - sigma: '\\sigma', - Sigma: '\\Sigma', - tau: { - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\tau', - }, - vartheta: '\\vartheta', - upsilon: '\\upsilon', - xi: { - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\xi', - }, - Xi: { - after: - 'nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text', - value: '\\Xi', - }, - zeta: '\\zeta', - omega: '\\omega', - Omega: '\\Omega', - Ω: '\\omega', - forall: '\\forall', - exists: { mode: 'math', value: '\\exists' }, - '!exists': { mode: 'math', value: '\\nexists' }, - ':.': { mode: 'math', value: '\\therefore' }, - liminf: '\\operatorname*{lim~inf}_{#?}', - limsup: '\\operatorname*{lim~sup}_{#?}', - argmin: '\\operatorname*{arg~min}_{#?}', - argmax: '\\operatorname*{arg~max}_{#?}', - det: '\\det', - mod: { mode: 'math', value: '\\mod' }, - max: { mode: 'math', value: '\\max' }, - min: { mode: 'math', value: '\\min' }, - erf: '\\operatorname{erf}', - erfc: '\\operatorname{erfc}', - bessel: { mode: 'math', value: '\\operatorname{bessel}' }, - mean: { mode: 'math', value: '\\operatorname{mean}' }, - median: { mode: 'math', value: '\\operatorname{median}' }, - fft: { mode: 'math', value: '\\operatorname{fft}' }, - lcm: { mode: 'math', value: '\\operatorname{lcm}' }, - gcd: { mode: 'math', value: '\\operatorname{gcd}' }, - randomReal: '\\operatorname{randomReal}', - randomInteger: '\\operatorname{randomInteger}', - Re: { mode: 'math', value: '\\operatorname{Re}' }, - Im: { mode: 'math', value: '\\operatorname{Im}' }, - mm: { - mode: 'math', - after: 'nothing+digit', - value: '\\operatorname{mm}', - }, - cm: { - mode: 'math', - after: 'nothing+digit', - value: '\\operatorname{cm}', - }, - km: { - mode: 'math', - after: 'nothing+digit', - value: '\\operatorname{km}', - }, - kg: { - mode: 'math', - after: 'nothing+digit', - value: '\\operatorname{kg}', - }, - '...': '\\ldots', - '+...': '+\\cdots', - '-...': '-\\cdots', - '->...': '\\to\\cdots', - '->': '\\to', - '|->': '\\mapsto', - '--\x3e': '\\longrightarrow', - '<--': '\\longleftarrow', - '=>': '\\Rightarrow', - '==>': '\\Longrightarrow', - '<=>': '\\Leftrightarrow', - '<->': '\\leftrightarrow', - '(.)': '\\odot', - '(+)': '\\oplus', - '(/)': '\\oslash', - '(*)': '\\otimes', - '(-)': '\\ominus', - '||': '\\Vert', - '{': '\\{', - '}': '\\}', - '*': '\\cdot', - }; - function ye(t, e, i) { - if (!i) return i; - if ('string' == typeof i) return i; - if ('string' == typeof i.mode && i.mode !== t) return null; - if (!e) return i ? i.value : void 0; - let s = !1, - a = !1, - o = !1, - n = !1, - r = !1, - l = !1, - c = !1, - h = !1, - d = !1, - p = !1, - m = !1, - u = !1, - f = !1, - g = !1, - y = e[e.length - 1], - b = e.length - 1; - for (; y && /msubsup|placeholder/.test(y.type); ) - (b -= 1), (y = e[b]); - return ( - (s = !y || 'first' === y.type), - y && - ((f = 'text' === y.mode), - (a = !f && 'mord' === y.type && At.LETTER.test(y.body)), - (o = !f && 'mord' === y.type && /[0-9]+$/.test(y.body)), - (n = !f && y.isFunction), - (r = 'genfrac' === y.type), - (l = 'surd' === y.type), - (c = 'mbin' === y.type), - (h = 'mrel' === y.type), - (d = 'mpunct' === y.type || 'minner' === y.type), - (p = y.array), - (m = 'mopen' === y.type), - (u = 'mclose' === y.type || 'leftright' === y.type), - (g = 'space' === y.type)), - void 0 !== i.after - ? (/nothing/.test(i.after) && s) || - (/letter/.test(i.after) && a) || - (/digit/.test(i.after) && o) || - (/function/.test(i.after) && n) || - (/frac/.test(i.after) && r) || - (/surd/.test(i.after) && l) || - (/binop/.test(i.after) && c) || - (/relop/.test(i.after) && h) || - (/punct/.test(i.after) && d) || - (/array/.test(i.after) && p) || - (/openfence/.test(i.after) && m) || - (/closefence/.test(i.after) && u) || - (/text/.test(i.after) && f) || - (/space/.test(i.after) && g) - ? i.value - : null - : i.value - ); - } - function be(t) { - let e = 'other'; - return ( - navigator && - navigator.platform && - navigator.userAgent && - (/^(mac)/i.test(navigator.platform) - ? (e = 'mac') - : /^(win)/i.test(navigator.platform) - ? (e = 'win') - : /(android)/i.test(navigator.userAgent) - ? (e = 'android') - : /(iphone)/i.test(navigator.userAgent) || - /(ipod)/i.test(navigator.userAgent) || - /(ipad)/i.test(navigator.userAgent) - ? (e = 'ios') - : /\bCrOS\b/i.test(navigator.userAgent) && - (e = 'chromeos')), - e === t ? t : '!' + t - ); - } - function xe(t) { - let e = t; - return ( - Array.isArray(e) && - e.length > 0 && - (e = e[0] + '(' + e.slice(1).join('') + ')'), - e - ); - } - function ke(t, e) { - let i = ''; - Array.isArray(t) || (t = [t]); - for (const s of t) { - let t; - const a = s.match(/(^[^:]*):/), - o = a ? a[1] : ''; - if ( - o === be('mac') || - o === be('win') || - o === be('ios') || - o === be('android') || - o === be('chromeos') || - o === be('other') - ) { - const e = s.match(/:([^:]*)$/); - t = e ? e[1] : s; - } else if ( - ![ - 'mac', - '!mac', - 'win', - '!win', - 'ios', - '!ios', - 'android', - '!android', - 'chromeos', - '!chromeos', - 'other', - '!other', - ].includes(o) - ) { - const e = s.match(/:([^:]*)$/); - t = e ? e[1] : s; - } - if (t) { - const s = 'mac' === be('mac') || 'ios' === be('ios'), - a = t.length > 1 ? t.split('-') : [t]; - let o = ''; - for (const t of a) - !s && - o.length > 0 && - (o += '+'), - 'Key' === t.substr(0, 3) - ? (o += t.substr(3, 1)) - : 'Digit' === t.substr(0, 5) - ? (o += t.substr(5, 1)) - : (o += - { - Meta: s ? '⌘' : 'command', - Shift: s ? '⇧' : 'shift', - Alt: s ? '⌥' : 'alt', - Ctrl: s ? '⌃' : 'control', - '\n': s ? '⏎' : 'return', - Return: s ? '⏎' : 'return', - Enter: s ? '⌤' : 'enter', - Tab: s ? '⇥' : 'tab', - Esc: 'esc', - Backspace: s ? '⌫' : 'backspace', - Del: s ? '⌦' : 'del', - PageUp: s ? '⇞' : 'page up', - PageDown: s ? '⇟' : 'page down', - Home: s ? '⤒' : 'home', - End: s ? '⤓' : 'end', - Spacebar: 'space', - Semicolon: ';', - Period: '.', - Comma: ',', - Minus: '-', - Equal: '=', - Quote: "'", - BracketLeft: '[', - BracketRight: ']', - Backslash: '\\', - IntlBackslash: '\\', - Backquote: '`', - Slash: '/', - NumpadMultiply: '* 🔢', - NumpadDivide: '/ 🔢', - NumpadSubtract: '- 🔢', - NumpadAdd: '+ 🔢', - NumpadDecimal: '. 🔢', - NumpadComma: ', 🔢', - Help: 'help', - Left: '⇠', - Up: '⇡', - Right: '⇢', - Down: '⇣', - }[t] || t); - i.length > 0 && (i += e || ' or '), (i += o); - } - } - return i; - } - var ve = { - KEYBOARD_SHORTCUTS: ue, - INLINE_SHORTCUTS: ge, - stringify: ke, - startsWithString: function(t, e) { - const i = []; - for (let s = 0; s <= t.length - 1; s++) { - const a = t.substring(s); - (e && e.overrideDefaultInlineShortcuts) || - Object.keys(ge).forEach(t => { - t.startsWith(a) && !i.includes(t) && i.push(t); - }); - const o = e && e.inlineShortcuts ? e.inlineShortcuts : null; - o && - Object.keys(o).forEach(t => { - t.startsWith(a) && i.push(t); - }); - } - return i; - }, - forString: function(t, e, i, s) { - let a = ''; - (s && s.overrideDefaultInlineShortcuts) || - (a = ye(t, e, ge[i])); - const o = s && s.inlineShortcuts ? s.inlineShortcuts : null; - let n; - return o && (n = ye(t, e, o[i])), n || a; - }, - selectorForKeystroke: function(t, e) { - for (const i of [ - be('mac') + ':' + t + ':' + e, - be('win') + ':' + t + ':' + e, - be('ios') + ':' + t + ':' + e, - be('android') + ':' + t + ':' + e, - be('chromeos') + ':' + t + ':' + e, - be('other') + ':' + t + ':' + e, - be('mac') + ':' + e, - be('win') + ':' + e, - be('ios') + ':' + e, - be('android') + ':' + e, - be('chromeos') + ':' + e, - t + ':' + e, - e, - ]) - if (ue[i]) return ue[i]; - return ''; - }, - forCommand: function(t) { - let e = []; - if ('string' == typeof t) { - const i = fe[t]; - Array.isArray(i) ? (e = i.slice()) : i && e.push(i); - } - t = xe(t); - const i = new RegExp( - '^' + - t - .replace('\\', '\\\\') - .replace('|', '\\|') - .replace('*', '\\*') - .replace('$', '\\$') - .replace('^', '\\^') + - '([^*a-zA-Z]|$)' - ); - return ( - Object.keys(ue).forEach(t => { - if (i.test(xe(ue[t]))) { - const i = t.match(/:([^:]*)$/); - i && e.push(i[1]); - } - }), - ke(e) - ); - }, - }; - function we(t, e) { - (this.root = te.makeRoot()), - (this.path = [{ relation: 'body', offset: 0 }]), - (this.extent = 0), - (this.config = t ? { ...t } : {}), - (this.target = e), - (this.suppressChangeNotifications = !1); - } - function Se(t) { - const e = Object.assign(new we(t.config, t.target), t); - return (e.path = me.clone(t.path)), e; - } - function Ae(t, e) { - let i = 0; - for (let s = 0; s < e.row; s++) - for (let e = 0; e < t[s].length; e++) i += 1; - return (i += e.col), i; - } - function Me(t, e) { - if ('string' == typeof e) { - const t = e.match(/cell([0-9]*)$/); - t && (e = parseInt(t[1])); - } - const i = { row: 0, col: 0 }; - for (; e > 0; ) - (i.col += 1), - (!t[i.row] || i.col >= t[i.row].length) && - ((i.col = 0), (i.row += 1)), - (e -= 1); - return i; - } - function Ce(t, e) { - let i; - return ( - 'object' != typeof e && (e = Me(t, e)), - Array.isArray(t[e.row]) && (i = t[e.row][e.col] || null), - !i || - (0 !== i.length && 'first' === i[0].type) || - i.unshift(Oe()), - i - ); - } - function _e(t) { - let e = 0, - i = 0, - s = 1; - for (const e of t) (i += 1), e.length > s && (s = e.length); - return (e = i * s), e; - } - function Te(t, e, i) { - if (!t) return []; - e || (e = ','); - let s, - a = []; - for (let o of t) - o && o.length > 0 && 'first' === o[0].type && (o = o.slice(1)), - o && - o.length > 0 && - (s - ? a.push(s) - : (s = new te.MathAtom('math', 'mpunct', e, i)), - (a = a.concat(o))); - return a; - } - function Le(t, e, i) { - const s = { ...e }; - if (((s.row += i), s.row < 0)) { - if (((s.col += i), (s.row = t.length - 1), s.col < 0)) - return null; - for (; s.row >= 0 && !Ce(t, s); ) s.row -= 1; - if (s.row < 0) return null; - } else if (s.row >= t.length) { - for (s.col += i, s.row = 0; s.row < t.length && !Ce(t, s); ) - s.row += 1; - if (s.row > t.length - 1) return null; - } - return s; - } - function Fe(t) { - return ( - !!t && - (('mord' === t.type && /[0-9.]/.test(t.body)) || - ('mpunct' === t.type && ',' === t.body)) - ); - } - function De(t, e) { - if (!t) return !1; - if (Array.isArray(t)) { - for (const i of t) if (De(i, e)) return !0; - } else { - if (t === e) return !0; - if ( - [ - 'body', - 'numer', - 'denom', - 'index', - 'subscript', - 'superscript', - 'underscript', - 'overscript', - ].some(function(i) { - return i === e || De(t[i], e); - }) - ) - return !0; - if (t.array) - for (let i = _e(t.array); i >= 0; i--) - if (De(Ce(t.array, i), e)) return !0; - } - return !1; - } - function ze(t) { - if (t) - return ( - 1 === t.length && - 'leftright' === t[0].type && - '(' === t[0].leftDelim && - (t = t[0].body), - t - ); - } - function Ee(t, e) { - if (!t) return ''; - if (t.length <= 1) return t; - if (!e || 'ASCIIMath' !== e.format) { - if (t.startsWith('$$') && t.endsWith('$$')) - return t.substring(2, t.length - 2); - if (t.startsWith('$') && t.endsWith('$')) - return t.substring(1, t.length - 1); - if (((t = t.replace(/\\\\([^\s\n])/g, '\\$1')), /\\/.test(t))) - return t; - } - return qe( - (t = (t = (t = (t = (t = (t = t.replace( - /\u2061/gu, - '' - )).replace(/\u3016/gu, '{')).replace(/\u3017/gu, '}')).replace( - /([^\\])sinx/g, - '$1\\sin x' - )).replace(/([^\\])cosx/g, '$1\\cos x ')).replace( - /\u2013/g, - '-' - )), - e - ); - } - function qe(t, e) { - if (!t) return ''; - let i, - s = !1; - if ( - (s || - ('^' !== t[0] && '_' !== t[0]) || - ((i = Ie(t.substr(1), { ...e, noWrap: !0 })), - (t = t[0] + '{' + i.match + '}'), - (t += qe(i.rest, e)), - (s = !0)), - s || - ((i = t.match(/^(sqrt|\u221a)(.*)/)), - i && - ((i = Ie(i[2], { ...e, noWrap: !0 })), - (t = '\\sqrt{' + i.match + '}'), - (t += qe(i.rest, e)), - (s = !0))), - s || - ((i = t.match(/^(\\cbrt|\u221b)(.*)/)), - i && - ((i = Ie(i[2], { ...e, noWrap: !0 })), - (t = '\\sqrt[3]{' + i.match + '}'), - (t += qe(i.rest, e)), - (s = !0))), - s || - ((i = t.match(/^abs(.*)/)), - i && - ((i = Ie(i[1], { ...e, noWrap: !0 })), - (t = '\\left|' + i.match + '\\right|'), - (t += qe(i.rest, e)), - (s = !0))), - s || - ((i = t.match(/^["”“](.*?)["”“](.*)/)), - i && - ((t = '\\text{' + i[1] + '}'), - (t += qe(i[2], e)), - (s = !0))), - s || - ((i = t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/)), - i && ((t = Pe(i[1], e)), (t += qe(i[2], e)), (s = !0))), - !s && - /^(f|g|h)[^a-zA-Z]/.test(t) && - ((i = Ie(t.substring(1), { ...e, noWrap: !0 })), - (t = - '(' === t[1] - ? t[0] + '\\mleft(' + i.match + '\\mright)' - : t[0] + i.match), - (t += qe(i.rest, e)), - (s = !0)), - s || - ((i = t.match(/^([a-zA-Z]+)(.*)/)), - i && ((t = Pe(i[1], e)), (t += qe(i[2], e)), (s = !0))), - !s) - ) - if ( - ((i = Ie(t, { ...e, noWrap: !0 })), - i.match && '/' === i.rest[0]) - ) { - const a = Ie(i.rest.substr(1), { ...e, noWrap: !0 }); - a.match && - (t = - '\\frac{' + - i.match + - '}{' + - a.match + - '}' + - qe(a.rest, e)), - (s = !0); - } else - i.match && - ((t = - '(' === t[0] - ? '\\left(' + - i.match + - '\\right)' + - qe(i.rest, e) - : i.match + qe(i.rest, e)), - (s = !0)); - return ( - s || - ((i = t.match(/^(\s+)(.*)$/)), - i && ((t = ' ' + qe(i[2], e)), (s = !0))), - t - ); - } - function Ie(t, e) { - let i = '', - s = (t = t.trim()), - a = t.charAt(0), - o = { '(': ')', '{': '}', '[': ']' }[a]; - if (o) { - let n = 1, - r = 1; - for (; r < t.length && n > 0; ) - t[r] === a && n++, t[r] === o && n--, r++; - 0 === n - ? (e.noWrap && '(' === a - ? (i = qe(t.substring(1, r - 1), e)) - : ('{' === a && - '}' === o && - ((a = '\\{'), (o = '\\}')), - (i = - '\\left' + - a + - qe(t.substring(1, r - 1), e) + - '\\right' + - o)), - (s = t.substring(r))) - : ((i = t.substring(1, r)), (s = '')); - } else { - let a = t.match(/^([a-zA-Z]+)/); - if (a) { - let i = ve.forString('math', null, t, e); - if (i) - return ( - (i = i.replace('_{#?}', '')), - (i = i.replace('^{#?}', '')), - { match: i, rest: t.substring(i.length) } - ); - } - if (((a = t.match(/^([a-zA-Z])/)), a)) - return { match: a[1], rest: t.substring(1) }; - if (((a = t.match(/^(-)?\d+(\.\d*)?/)), a)) - return { match: a[0], rest: t.substring(a[0].length) }; - /^\\(left|right)/.test(t) || - ((a = t.match(/^(\\[a-zA-Z]+)/)), - a && ((s = t.substring(a[1].length)), (i = a[1]))); - } - return { match: i, rest: s }; - } - function Pe(t, e) { - let i = ve.forString('math', null, t, e); - return ( - i - ? ((i = i.replace('_{#?}', '')), - (i = i.replace('^{#?}', '')), - (i += ' ')) - : (i = t), - i - ); - } - function Oe() { - return new te.MathAtom('', 'first'); - } - (we.prototype._announce = function(t, e, i) { - 'function' == typeof this.config.onAnnounce && - this.config.onAnnounce(this.target, t, e, i); - }), - (we.prototype.filter = function(t, e) { - e = e < 0 ? -1 : 1; - const i = [], - s = new we(); - (s.path = me.clone(this.path)), - (s.extent = this.extent), - (s.root = this.root), - e >= 0 - ? s.collapseForward() - : (s.collapseBackward(), s.move(1)); - const a = s.anchor(); - do { - t.bind(s)(s.path, s.anchor()) && i.push(s.toString()), - e >= 0 - ? s.next({ iterateAll: !0 }) - : s.previous({ iterateAll: !0 }); - } while (a !== s.anchor()); - return i; - }), - (we.prototype.forEach = function(t) { - this.root.forEach(t); - }), - (we.prototype.forEachSelected = function(t, e) { - (e = e || {}).recursive = void 0 !== e.recursive && e.recursive; - const i = this.siblings(), - s = this.startOffset() + 1, - a = this.endOffset() + 1; - if (e.recursive) - for (let e = s; e < a; e++) - i[e] && 'first' !== i[e].type && i[e].forEach(t); - else - for (let e = s; e < a; e++) - i[e] && 'first' !== i[e].type && t(i[e]); - }), - (we.prototype.toString = function() { - return me.pathToString(this.path, this.extent); - }), - (we.prototype.adjustPlaceholder = function() { - const t = this.siblings(); - if (t && t.length <= 1) { - let e; - const i = this.relation(); - if ( - ('numer' === i - ? (e = 'numerator') - : 'denom' === i - ? (e = 'denominator') - : 'surd' === this.parent().type && 'body' === i - ? (e = 'radicand') - : 'overunder' === this.parent().type && 'body' === i - ? (e = 'base') - : ('underscript' !== i && 'overscript' !== i) || - (e = 'annotation'), - e) - ) { - const e = [ - new te.MathAtom( - 'math', - 'placeholder', - '⬚', - this.anchorStyle() - ), - ]; - Array.prototype.splice.apply(t, [1, 0].concat(e)); - } - } - }), - (we.prototype.selectionWillChange = function() { - 'function' != typeof this.config.onSelectionWillChange || - this.suppressChangeNotifications || - this.config.onSelectionWillChange(this.target); - }), - (we.prototype.selectionDidChange = function() { - 'function' != typeof this.config.onSelectionDidChange || - this.suppressChangeNotifications || - this.config.onSelectionDidChange(this.target); - }), - (we.prototype.contentWillChange = function() { - 'function' != typeof this.config.onContentWillChange || - this.suppressChangeNotifications || - this.config.onContentWillChange(this.target); - }), - (we.prototype.contentDidChange = function() { - 'function' != typeof this.config.onContentDidChange || - this.suppressChangeNotifications || - this.config.onContentDidChange(this.target); - }), - (we.prototype.setPath = function(t, e) { - if ('string' == typeof t) t = me.pathFromString(t); - else if (Array.isArray(t)) { - const i = me.clone(t), - s = this.path; - (this.path = i), - 0 === e && - 'placeholder' === this.anchor().type && - ((i[i.length - 1].offset = this.anchorOffset() - 1), - (e = 1)), - (t = { path: i, extent: e || 0 }), - (this.path = s); - } - const i = 0 !== me.pathDistance(this.path, t.path), - s = t.extent !== this.extent; - return ( - (i || s) && - (i && this.adjustPlaceholder(), - this.selectionWillChange(), - (this.path = me.clone(t.path)), - this.siblings().length < this.anchorOffset() - ? ((this.path = [{ relation: 'body', offset: 0 }]), - (this.extent = 0)) - : this.setExtent(t.extent), - this.selectionDidChange()), - i || s - ); - }), - (we.prototype.wordBoundary = function(t, e) { - e = e < 0 ? -1 : 1; - const i = new we(); - (i.path = me.clone(t)), (i.root = this.root); - let s = 0; - for ( - ; - i.sibling(s) && - 'text' === i.sibling(s).mode && - At.LETTER_AND_DIGITS.test(i.sibling(s).body); - - ) - s += e; - return ( - i.sibling(s) || (s -= e), - (i.path[i.path.length - 1].offset += s), - i.path - ); - }), - (we.prototype.wordBoundaryOffset = function(t, e) { - e = e < 0 ? -1 : 1; - const i = this.siblings(); - if (!i[t]) return t; - if ('text' !== i[t].mode) return t; - let s; - if (At.LETTER_AND_DIGITS.test(i[t].body)) { - let a, - o = t; - do { - (a = - 'text' === i[o].mode && - At.LETTER_AND_DIGITS.test(i[o].body)), - (o += e); - } while (i[o] && a); - s = i[o] ? o - 2 * e : o - e; - } else if (/\s/.test(i[t].body)) { - let a = t; - for ( - ; - i[a] && 'text' === i[a].mode && /\s/.test(i[a].body); - - ) - a += e; - if (i[a]) { - let t = !0; - do { - (t = 'text' === i[a].mode && !/\s/.test(i[a].body)), - (a += e); - } while (i[a] && t); - s = i[a] ? a - 2 * e : a - e; - } else s = a - e; - } else { - let a = t; - for ( - ; - i[a] && 'text' === i[a].mode && !/\s/.test(i[a].body); - - ) - a += e; - s = i[a] ? a : a - e; - let o = !0; - for (; i[a] && o; ) - (o = 'text' === i[a].mode && /\s/.test(i[a].body)), - o && (s = a), - (a += e); - s = i[a] ? a - 2 * e : a - e; - } - return s - (e > 0 ? 0 : 1); - }), - (we.prototype.setRange = function(t, e, i) { - i = i || {}; - const s = me.pathDistance(t, e); - if (0 === s) - return i.extendToWordBoundary - ? ((t = this.wordBoundary(t, -1)), - (e = this.wordBoundary(e, 1)), - this.setRange(t, e)) - : this.setPath(me.clone(t), 0); - if (1 === s) { - const s = e[e.length - 1].offset - t[t.length - 1].offset; - return i.extendToWordBoundary - ? ((t = this.wordBoundary(t, s < 0 ? 1 : -1)), - (e = this.wordBoundary(e, s < 0 ? -1 : 1)), - this.setRange(t, e)) - : this.setPath(me.clone(t), s); - } - let a = me.pathCommonAncestor(t, e); - const o = a.length; - if ( - t.length === o || - e.length === o || - t[o].relation !== e[o].relation - ) - return this.setPath(a, -1); - a.push(t[o]), (a = me.clone(a)); - let n = e[o].offset - t[o].offset + 1; - return ( - n <= 0 - ? e.length > o + 1 - ? ((a[o].relation = e[o].relation), - (a[o].offset = e[o].offset), - (a[a.length - 1].offset -= 1), - (n = 2 - n)) - : ((a[o].relation = e[o].relation), - (a[o].offset = e[o].offset), - (n = 1 - n)) - : e.length <= t.length - ? (a[a.length - 1].offset -= 1) - : e.length > t.length && (a[o].offset -= 1), - this.setPath(a, n) - ); - }), - (we.prototype.ancestor = function(t) { - if (t > this.path.length) return null; - let e = this.root; - for (let i = 0; i < this.path.length - t; i++) { - const t = this.path[i]; - if (e.array) e = Ce(e.array, t.relation)[t.offset]; - else { - if (!e[t.relation]) return null; - { - (0 !== e[t.relation].length && - 'first' === e[t.relation][0].type) || - e[t.relation].unshift(Oe()); - const i = Math.min( - t.offset, - e[t.relation].length - 1 - ); - e = e[t.relation][i]; - } - } - } - return e; - }), - (we.prototype.anchor = function() { - if (this.parent().array) - return Ce(this.parent().array, this.relation())[ - this.anchorOffset() - ]; - const t = this.siblings(); - return t[Math.min(t.length - 1, this.anchorOffset())]; - }), - (we.prototype.parent = function() { - return this.ancestor(1); - }), - (we.prototype.relation = function() { - return this.path.length > 0 - ? this.path[this.path.length - 1].relation - : ''; - }), - (we.prototype.anchorOffset = function() { - return this.path.length > 0 - ? this.path[this.path.length - 1].offset - : 0; - }), - (we.prototype.focusOffset = function() { - return this.path.length > 0 - ? this.path[this.path.length - 1].offset + this.extent - : 0; - }), - (we.prototype.startOffset = function() { - return Math.min(this.focusOffset(), this.anchorOffset()); - }), - (we.prototype.endOffset = function() { - return Math.max(this.focusOffset(), this.anchorOffset()); - }), - (we.prototype.insertFirstAtom = function() { - this.siblings(); - }), - (we.prototype.siblings = function() { - if (0 === this.path.length) return []; - let t; - return ( - this.parent().array - ? (t = Ce(this.parent().array, this.relation())) - : ((t = this.parent()[this.relation()] || []), - 'string' == typeof t && (t = [])), - (0 !== t.length && 'first' === t[0].type) || - t.unshift(Oe()), - t - ); - }), - (we.prototype.sibling = function(t) { - return this.siblings()[this.startOffset() + t]; - }), - (we.prototype.isCollapsed = function() { - return 0 === this.extent; - }), - (we.prototype.setExtent = function(t) { - this.extent = t; - }), - (we.prototype.collapseForward = function() { - return ( - 0 !== this.extent && - (this.setSelection(this.endOffset()), !0) - ); - }), - (we.prototype.collapseBackward = function() { - return ( - 0 !== this.extent && - (this.setSelection(this.startOffset()), !0) - ); - }), - (we.prototype.selectGroup_ = function() { - const t = this.siblings(); - if ('text' === this.anchorMode()) { - let e = this.startOffset(), - i = this.endOffset(); - for ( - ; - t[e] && - 'text' === t[e].mode && - At.LETTER_AND_DIGITS.test(t[e].body); - - ) - e -= 1; - for ( - ; - t[i] && - 'text' === t[i].mode && - At.LETTER_AND_DIGITS.test(t[i].body); - - ) - i += 1; - if (((i -= 1), e >= i)) - return void this.setSelection(this.endOffset() - 1, 1); - this.setSelection(e, i - e); - } else if ( - 'mord' === this.sibling(0).type && - /[0-9,.]/.test(this.sibling(0).body) - ) { - let e = this.startOffset(), - i = this.endOffset(); - for (; Fe(t[e]); ) e -= 1; - for (; Fe(t[i]); ) i += 1; - (i -= 1), this.setSelection(e, i - e); - } else this.setSelection(0, 'end'); - }), - (we.prototype.selectAll_ = function() { - (this.path = [{ relation: 'body', offset: 0 }]), - this.setSelection(0, 'end'); - }), - (we.prototype.deleteAll_ = function() { - this.selectAll_(), this.delete_(); - }), - (we.prototype.contains = function(t) { - if (this.isCollapsed()) return !1; - const e = this.siblings(), - i = this.startOffset(), - s = this.endOffset(); - for (let a = i; a < s; a++) if (De(e[a], t)) return !0; - return !1; - }), - (we.prototype.getSelectedAtoms = function() { - if (this.isCollapsed()) return null; - const t = [], - e = this.siblings(), - i = this.startOffset() + 1, - s = this.endOffset() + 1; - for (let a = i; a < s; a++) - e[a] && 'first' !== e[a].type && t.push(e[a]); - return t; - }), - (we.prototype.commandOffsets = function() { - const t = this.siblings(); - if (t.length <= 1) return null; - let e = Math.min(this.endOffset(), t.length - 1); - if ('command' !== t[e].type) return null; - for (; e > 0 && 'command' === t[e].type; ) e -= 1; - let i = this.startOffset() + 1; - for (; i <= t.length - 1 && 'command' === t[i].type; ) i += 1; - return i > e ? { start: e + 1, end: i } : null; - }), - (we.prototype.extractCommandStringAroundInsertionPoint = function( - t - ) { - let e = ''; - const i = this.commandOffsets(); - if (i) { - const s = t ? this.anchorOffset() + 1 : i.end, - a = this.siblings(); - for (let t = i.start; t < s; t++) e += a[t].body || ''; - } - return e; - }), - (we.prototype.decorateCommandStringAroundInsertionPoint = function( - t - ) { - const e = this.commandOffsets(); - if (e) { - const i = this.siblings(); - for (let s = e.start; s < e.end; s++) i[s].error = t; - } - }), - (we.prototype.commitCommandStringBeforeInsertionPoint = function() { - const t = this.commandOffsets(); - if (t) { - const e = this.siblings(), - i = this.anchorOffset() + 1; - for (let s = t.start; s < i; s++) - e[s] && (e[s].suggestion = !1); - } - }), - (we.prototype.spliceCommandStringAroundInsertionPoint = function( - t - ) { - const e = this.commandOffsets(); - if (e) { - if ((this.contentWillChange(), t)) { - Array.prototype.splice.apply( - this.siblings(), - [e.start, e.end - e.start].concat(t) - ); - let i = []; - for (const e of t) - i = i.concat( - e.filter(t => 'placeholder' === t.type) - ); - this.setExtent(0), - (this.path[this.path.length - 1].offset = - e.start - 1), - (0 !== i.length && this.leap(1, !1)) || - this.setSelection(e.start + t.length - 1); - } else - this.siblings().splice(e.start, e.end - e.start), - this.setSelection(e.start - 1, 0); - this.contentDidChange(); - } - }), - (we.prototype.removeCommandString = function() { - this.contentWillChange(); - const t = this.suppressChangeNotifications; - (this.suppressChangeNotifications = !0), - (function t(e) { - if (e) - if (Array.isArray(e)) - for (let i = e.length - 1; i >= 0; i--) - 'command' === e[i].type - ? e.splice(i, 1) - : t(e[i]); - else if ( - (t(e.body), - t(e.superscript), - t(e.subscript), - t(e.underscript), - t(e.overscript), - t(e.numer), - t(e.denom), - t(e.index), - e.array) - ) - for (let i = _e(e.array); i >= 0; i--) - t(Ce(e.array, i)); - })(this.root.body), - (this.suppressChangeNotifications = t), - this.contentDidChange(); - }), - (we.prototype.extractArgBeforeInsertionPoint = function() { - const t = this.siblings(); - if (t.length <= 1) return []; - const e = []; - let i = this.startOffset(); - if ('text' === t[i].mode) - for (; i >= 1 && 'text' === t[i].mode; ) - e.unshift(t[i]), i--; - else - for ( - ; - i >= 1 && - /^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type); - - ) - e.unshift(t[i]), i--; - return e; - }), - (we.prototype.setSelection = function(t, e, i) { - (t = t || 0), (e = e || 0); - const s = this.path[this.path.length - 1].relation; - i || (i = s); - const a = this.parent(); - if (!a && 'body' !== i) return !1; - const o = i.startsWith('cell'); - if ((!o && !a[i]) || (o && !a.array)) return !1; - const n = i !== s; - this.path[this.path.length - 1].relation = i; - const r = this.siblings().length; - this.path[this.path.length - 1].relation = s; - const l = this.extent; - 'end' === e ? (e = r - t - 1) : 'start' === e && (e = -t), - this.setExtent(e); - const c = this.extent !== l; - this.setExtent(l), - t < 0 && (t = r + t), - (t = Math.max(0, Math.min(t, r - 1))); - const h = this.path[this.path.length - 1].offset; - return ( - (n || h !== t || c) && - (n && this.adjustPlaceholder(), - this.selectionWillChange(), - (this.path[this.path.length - 1].relation = i), - (this.path[this.path.length - 1].offset = t), - this.setExtent(e), - this.selectionDidChange()), - !0 - ); - }), - (we.prototype.next = function(t) { - t = t || {}; - const e = { - body: 'numer', - numer: 'denom', - denom: 'index', - index: 'overscript', - overscript: 'underscript', - underscript: 'subscript', - subscript: 'superscript', - }; - if (this.anchorOffset() === this.siblings().length - 1) { - this.adjustPlaceholder(); - let i = e[this.relation()]; - const s = this.parent(); - for (; i && !s[i]; ) i = e[i]; - if (i) return void this.setSelection(0, 0, i); - if (this.parent().array) { - const t = _e(this.parent().array); - let e = - parseInt( - this.relation().match(/cell([0-9]*)$/)[1] - ) + 1; - for (; e < t; ) { - if ( - Ce(this.parent().array, e) && - this.setSelection(0, 0, 'cell' + e) - ) - return void this.selectionDidChange(); - e += 1; - } - } - if (1 === this.path.length) - (this.suppressChangeNotifications || - !this.config.onMoveOutOf || - this.config.onMoveOutOf(this, 'forward')) && - (this.path[0].offset = 0); - else { - const e = !t.iterateAll && this.parent().skipBoundary; - this.path.pop(), e && this.next(t); - } - return void this.selectionDidChange(); - } - this.setSelection(this.anchorOffset() + 1); - const i = this.anchor(); - if (i && !i.captureSelection) { - let s; - if (i.array) { - let t = 0; - s = ''; - const e = _e(i.array); - for (; !s && t < e; ) - Ce(i.array, t) && (s = 'cell' + t.toString()), - (t += 1); - return ( - this.path.push({ relation: s, offset: 0 }), - void this.setSelection(0, 0, s) - ); - } - for (s = 'body'; s; ) { - if (Array.isArray(i[s])) - return ( - this.path.push({ relation: s, offset: 0 }), - this.insertFirstAtom(), - void ( - !t.iterateAll && - i.skipBoundary && - this.next(t) - ) - ); - s = e[s]; - } - } - }), - (we.prototype.previous = function(t) { - const e = { - numer: 'body', - denom: 'numer', - index: 'denom', - overscript: 'index', - underscript: 'overscript', - subscript: 'underscript', - superscript: 'subscript', - }; - if ( - (!(t = t || {}).iterateAll && - 1 === this.anchorOffset() && - this.parent() && - this.parent().skipBoundary && - this.setSelection(0), - this.anchorOffset() < 1) - ) { - let t = e[this.relation()]; - for (; t && !this.setSelection(-1, 0, t); ) t = e[t]; - const i = this.parent() ? this.parent().type : 'none'; - if ( - ('body' !== t || - ('msubsup' !== i && 'mop' !== i) || - (t = null), - t) - ) - return; - if ( - (this.adjustPlaceholder(), - this.selectionWillChange(), - this.relation().startsWith('cell')) - ) { - let t = - parseInt( - this.relation().match(/cell([0-9]*)$/)[1] - ) - 1; - for (; t >= 0; ) { - if ( - Ce(this.parent().array, t) && - this.setSelection(-1, 0, 'cell' + t) - ) - return void this.selectionDidChange(); - t -= 1; - } - } - return ( - 1 === this.path.length - ? (this.suppressChangeNotifications || - !this.config.onMoveOutOf || - this.config.onMoveOutOf.bind(this)(-1)) && - (this.path[0].offset = this.root.body.length - 1) - : (this.path.pop(), - this.setSelection(this.anchorOffset() - 1)), - void this.selectionDidChange() - ); - } - const i = this.anchor(); - if (!i.captureSelection) { - let t; - if (i.array) { - t = ''; - const e = _e(i.array); - let s = e - 1; - for (; !t && s < e; ) - Ce(i.array, s) && (t = 'cell' + s.toString()), - (s -= 1); - return ( - (s += 1), - this.path.push({ - relation: t, - offset: Ce(i.array, s).length - 1, - }), - void this.setSelection(-1, 0, t) - ); - } - for (t = 'superscript'; t; ) { - if (Array.isArray(i[t])) - return ( - this.path.push({ - relation: t, - offset: i[t].length - 1, - }), - void this.setSelection(-1, 0, t) - ); - t = e[t]; - } - } - this.setSelection(this.anchorOffset() - 1), - !t.iterateAll && - this.sibling(0) && - this.sibling(0).skipBoundary && - this.previous(t); - }), - (we.prototype.move = function(t, e) { - const i = (e = e || { extend: !1 }).extend || !1; - if ((this.removeSuggestion(), i)) this.extend(t, e); - else { - const e = Se(this); - if (t > 0) - for (this.collapseForward() && t--; t > 0; ) - this.next(), t--; - else if (t < 0) - for (this.collapseBackward() && t++; 0 !== t; ) - this.previous(), t++; - this._announce('move', e); - } - }), - (we.prototype.up = function(t) { - const e = (t = t || { extend: !1 }).extend || !1; - this.collapseBackward(); - const i = this.relation(); - if ('denom' === i) - e - ? (this.selectionWillChange(), - this.path.pop(), - (this.path[this.path.length - 1].offset -= 1), - this.setExtent(1), - this.selectionDidChange()) - : this.setSelection(this.anchorOffset(), 0, 'numer'), - this._announce('moveUp'); - else if (this.parent().array) { - let e = Me(this.parent().array, i); - (e = Le(this.parent().array, e, -1)), - e && Ce(e) - ? ((this.path[this.path.length - 1].relation = - 'cell' + Ae(this.parent().array, e)), - this.setSelection(this.anchorOffset()), - this._announce('moveUp')) - : this.move(-1, t); - } else this._announce('line'); - }), - (we.prototype.down = function(t) { - const e = (t = t || { extend: !1 }).extend || !1; - this.collapseForward(); - const i = this.relation(); - if ('numer' === i) - e - ? (this.selectionWillChange(), - this.path.pop(), - (this.path[this.path.length - 1].offset -= 1), - this.setExtent(1), - this.selectionDidChange()) - : this.setSelection(this.anchorOffset(), 0, 'denom'), - this._announce('moveDown'); - else if (this.parent().array) { - let e = Me(this.parent().array, i); - (e = Le(this.parent().array, e, 1)), - e && Ce(e) - ? ((this.path[this.path.length - 1].relation = - 'cell' + Ae(this.parent().array, e)), - this.setSelection(this.anchorOffset()), - this._announce('moveDown')) - : this.move(1, t); - } else this._announce('line'); - }), - (we.prototype.extend = function(t) { - let e = this.path[this.path.length - 1].offset, - i = 0; - const s = Se(this); - i = this.extent + t; - const a = e + i; - if (a < 0 && 0 !== i) { - if (this.path.length > 1) - return ( - this.selectionWillChange(), - this.path.pop(), - this.setExtent(-1), - this.selectionDidChange(), - void this._announce('move', s) - ); - (e = this.path[this.path.length - 1].offset), - (i = this.extent); - } else if (a >= this.siblings().length) { - if (this.path.length > 1) - return ( - this.selectionWillChange(), - this.path.pop(), - (this.path[this.path.length - 1].offset -= 1), - this.setExtent(1), - this.selectionDidChange(), - void this._announce('move', s) - ); - this.isCollapsed() && (e -= 1), (i -= 1); - } - this.setSelection(e, i), this._announce('move', s); - }), - (we.prototype.skip = function(t, e) { - const i = (e = e || { extend: !1 }).extend || !1; - t = t < 0 ? -1 : 1; - const s = Se(this), - a = this.siblings(), - o = this.focusOffset(); - let n = o + t; - if ( - (i && (n = Math.min(Math.max(0, n), a.length - 1)), - n < 0 || n >= a.length) - ) - this.move(t, e); - else { - if (a[n] && 'text' === a[n].mode) { - if (((n = this.wordBoundaryOffset(n, t)), n < 0 && !i)) - return void this.setSelection(0); - if (n > a.length) - return ( - this.setSelection(a.length - 1), - void this.move(t, e) - ); - } else { - const e = a[n] ? a[n].type : ''; - if ( - ('mopen' === e && t > 0) || - ('mclose' === e && t < 0) - ) { - let i = 'mopen' === e ? 1 : -1; - for ( - n += t > 0 ? 1 : -1; - n >= 0 && n < a.length && 0 !== i; - - ) - 'mopen' === a[n].type - ? (i += 1) - : 'mclose' === a[n].type && (i -= 1), - (n += t); - 0 !== i && (n = o + t), t > 0 && (n -= 1); - } else { - for ( - ; - a[n] && 'math' === a[n].mode && a[n].type === e; - - ) - n += t; - n -= t > 0 ? 1 : 0; - } - } - if (i) { - const t = this.anchorOffset(); - this.setSelection(t, n - t); - } else this.setSelection(n); - this._announce('move', s); - } - }), - (we.prototype.jump = function(t, e) { - const i = (e = e || { extend: !1 }).extend || !1; - t = t < 0 ? -1 : 1; - const s = this.siblings(); - let a = this.focusOffset(); - t > 0 && (a = Math.min(a + 1, s.length - 1)); - const o = t < 0 ? 0 : s.length - 1; - i ? this.extend(o - a) : this.move(o - a); - }), - (we.prototype.jumpToMathFieldBoundary = function(t, e) { - const i = (e = e || { extend: !1 }).extend || !1; - t = (t = t || 1) < 0 ? -1 : 1; - const s = Se(this), - a = [{ relation: 'body', offset: this.path[0].offset }]; - let o; - i - ? t < 0 - ? a[0].offset > 0 && (o = -a[0].offset) - : a[0].offset < this.siblings().length - 1 && - (o = this.siblings().length - 1 - a[0].offset) - : ((a[0].offset = t < 0 ? 0 : this.root.body.length - 1), - (o = 0)), - this.setPath(a, o), - this._announce('move', s); - }), - (we.prototype.leap = function(t, e) { - (t = (t = t || 1) < 0 ? -1 : 1), (e = e || !0); - const i = this.suppressChangeNotifications; - this.suppressChangeNotifications = !0; - const s = Se(this), - a = this.extent; - this.move(t), - 'placeholder' === this.anchor().type && this.move(t); - const o = this.filter( - (t, e) => - 'placeholder' === e.type || - (t.length > 1 && 1 === this.siblings().length), - t - ); - if (0 === o.length) { - if ((this.setPath(s, a), e)) - if (this.config.onTabOutOf) - this.config.onTabOutOf( - this.target, - t > 0 ? 'forward' : 'backward' - ); - else if (document.activeElement) { - const e = - 'a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])', - i = Array.prototype.filter.call( - document.querySelectorAll(e), - t => - ((t.offsetWidth > 0 || - t.offsetHeight > 0) && - !t.contains( - document.activeElement - )) || - t === document.activeElement - ); - let s = i.indexOf(document.activeElement) + t; - s < 0 && (s = i.length - 1), - s >= i.length && (s = 0), - i[s].focus(); - } - return (this.suppressChangeNotifications = i), !1; - } - return ( - this.selectionWillChange(), - this.setPath(o[0]), - 'placeholder' === this.anchor().type && this.setExtent(-1), - this._announce('move', s), - this.selectionDidChange(), - (this.suppressChangeNotifications = i), - !0 - ); - }), - (we.prototype.anchorMode = function() { - const t = this.isCollapsed() ? this.anchor() : this.sibling(1); - let e; - if (t) { - if ('commandliteral' === t.type || 'command' === t.type) - return 'command'; - e = t.mode; - } - let i = 1, - s = this.ancestor(i); - for (; !e && s; ) - s && (e = s.mode), (i += 1), (s = this.ancestor(i)); - return e; - }), - (we.prototype.anchorStyle = function() { - const t = this.isCollapsed() ? this.anchor() : this.sibling(1); - let e; - if (t && 'first' !== t.type) { - if ('commandliteral' === t.type || 'command' === t.type) - return {}; - e = { - color: t.color, - backgroundColor: t.backgroundColor, - fontFamily: t.fontFamily, - fontShape: t.fontShape, - fontSeries: t.fontSeries, - fontSize: t.fontSize, - }; - } - let i = 1, - s = this.ancestor(i); - for (; !e && s; ) - s && - (e = { - color: s.color, - backgroundColor: s.backgroundColor, - fontFamily: s.fontFamily, - fontShape: s.fontShape, - fontSeries: s.fontSeries, - fontSize: s.fontSize, - }), - (i += 1), - (s = this.ancestor(i)); - return e; - }), - (we.prototype.simplifyParen = function(t) { - if (t && this.config.removeExtraneousParentheses) { - for (let e = 0; t[e]; e++) - if ( - 'leftright' === t[e].type && - '(' === t[e].leftDelim && - Array.isArray(t[e].body) - ) { - let i = 0, - s = 0, - a = 0; - for (let o = 0; t[e].body[o]; o++) - 'genfrac' === t[e].body[o].type && - (i++, (s = o)), - 'first' !== t[e].body[o].type && a++; - 0 === a && 1 === i && (t[e] = t[e].body[s]); - } - t.forEach(t => { - if ( - ('genfrac' === t.type && - (this.simplifyParen(t.numer), - this.simplifyParen(t.denom), - (t.numer = ze(t.numer)), - (t.denom = ze(t.denom))), - t.superscript && - (this.simplifyParen(t.superscript), - (t.superscript = ze(t.superscript))), - t.subscript && - (this.simplifyParen(t.subscript), - (t.subscript = ze(t.subscript))), - t.underscript && - (this.simplifyParen(t.underscript), - (t.underscript = ze(t.underscript))), - t.overscript && - (this.simplifyParen(t.overscript), - (t.overscript = ze(t.overscript))), - t.index && - (this.simplifyParen(t.index), - (t.index = ze(t.index))), - 'surd' === t.type - ? (this.simplifyParen(t.body), - (t.body = ze(t.body))) - : t.body && - Array.isArray(t.body) && - this.simplifyParen(t.body), - t.array) - ) - for (let e = _e(t.array); e >= 0; e--) - this.simplifyParen(Ce(t.array, e)); - }); - } - }), - (we.prototype.insert = function(t, e) { - if ( - (e = e || {}).smartFence && - this._insertSmartFence(t, e.style) - ) - return; - const i = this.suppressChangeNotifications; - e.suppressChangeNotifications && - (this.suppressChangeNotifications = !0), - this.contentWillChange(); - const s = this.suppressChangeNotifications; - (this.suppressChangeNotifications = !0), - e.insertionMode || (e.insertionMode = 'replaceSelection'), - e.selectionMode || (e.selectionMode = 'placeholder'), - e.format || (e.format = 'auto'), - (e.macros = e.macros || this.config.macros); - const a = e.mode || this.anchorMode(); - let o; - const r = [this.getSelectedAtoms()]; - void 0 !== e.placeholder && (r['?'] = e.placeholder), - 'replaceSelection' !== e.insertionMode || this.isCollapsed() - ? 'replaceAll' === e.insertionMode - ? (this.root.body.splice(1), - (this.path = [{ relation: 'body', offset: 0 }]), - (this.extent = 0)) - : 'insertBefore' === e.insertionMode - ? this.collapseBackward() - : 'insertAfter' === e.insertionMode && - this.collapseForward() - : this.delete_(); - const l = this.siblings(), - c = this.startOffset(); - if ( - (c + 1 < l.length && - l[c + 1] && - 'placeholder' === l[c + 1].type - ? this.delete_(1) - : c > 0 && - l[c] && - 'placeholder' === l[c].type && - this.delete_(-1), - 'math' === a && 'ASCIIMath' === e.format) - ) - (t = Ee(t, { ...this.config, format: 'ASCIIMath' })), - (o = he.parseTokens(n(t), 'math', null, e.macros, !1)), - this.simplifyParen(o); - else if ('text' !== a && 'auto' === e.format) - if ('command' === a) { - o = []; - for (const e of t) - At.COMMAND_MODE_CHARACTERS.test(e) && - o.push( - new te.MathAtom('command', 'command', e) - ); - } else - '' === t - ? (o = [ - new te.MathAtom('command', 'command', '\\'), - ]) - : ((t = Ee(t, this.config)), - r[0] - ? (t = t.replace(/(^|[^\\])#@/g, '$1#0')) - : /(^|[^\\])#@/.test(t) - ? ((t = t.replace(/(^|[^\\])#@/g, '$1#0')), - (r[0] = this.extractArgBeforeInsertionPoint()), - this._deleteAtoms(-r[0].length), - Array.isArray(r[0]) && - 0 === r[0].length && - (r[0] = void 0)) - : (t = t.replace(/(^|[^\\])#@/g, '$1#?')), - (o = he.parseTokens( - n(t), - a, - r, - e.macros, - e.smartFence - )), - this.simplifyParen(o)); - else - 'latex' === e.format - ? (o = he.parseTokens( - n(t), - a, - r, - e.macros, - e.smartFence - )) - : ('text' !== a && 'text' !== e.format) || - ((t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = t.replace( - /\\/g, - '\\textbackslash ' - )).replace(/#/g, '\\#')).replace( - /\$/g, - '\\$' - )).replace(/%/g, '\\%')).replace( - /&/g, - '\\&' - )).replace(/_/g, '\\_')).replace( - /{/g, - '\\textbraceleft ' - )).replace(/}/g, '\\textbraceright ')).replace( - /\^/g, - '\\textasciicircum ' - )).replace(/~/g, '\\textasciitilde ')).replace( - /£/g, - '\\textsterling ' - )), - (o = he.parseTokens(n(t), 'text', r, e.macros, !1))); - !(function t(e, i) { - e && - i && - (Array.isArray(e) - ? e.forEach(e => t(e, i)) - : 'object' == typeof e && - (e.color || - e.backgroundColor || - e.fontFamily || - e.fontShape || - e.fontSeries || - e.fontSize || - (e.applyStyle(i), - t(e.body, i), - t(e.numer, i), - t(e.denom, i), - t(e.index, i), - t(e.overscript, i), - t(e.underscript, i), - t(e.subscript, i), - t(e.superscript, i)))); - })(o, e.style); - const h = this.parent(); - if ( - (this.config.removeExtraneousParentheses && - h && - 'leftright' === h.type && - '(' === h.leftDelim && - (function(t) { - return ( - 0 === t.length || - (1 === t.length && 'first' === t[0].type) - ); - })(h.body) && - o && - 1 === o.length && - 'genfrac' === o[0].type - ? (this.path.pop(), - (this.siblings()[this.anchorOffset()] = o[0])) - : Array.prototype.splice.apply( - this.siblings(), - [this.anchorOffset() + 1, 0].concat(o) - ), - this.insertFirstAtom(), - (this.suppressChangeNotifications = s), - 'placeholder' === e.selectionMode) - ) { - let t = []; - for (const e of o) - t = t.concat(e.filter(t => 'placeholder' === t.type)); - 0 !== t.length && this.leap(1, !1) - ? this._announce('move') - : this.setSelection(this.anchorOffset() + o.length); - } else - 'before' === e.selectionMode || - ('after' === e.selectionMode - ? this.setSelection(this.anchorOffset() + o.length) - : 'item' === e.selectionMode && - this.setSelection(this.anchorOffset(), o.length)); - this.contentDidChange(), (this.suppressChangeNotifications = i); - }), - (we.prototype._insertSmartFence = function(t, e) { - const i = this.parent(); - if ( - 'leftright' === i.type && - '|' !== i.leftDelim && - /\||\\vert|\\Vert|\\mvert|\\mid/.test(t) - ) - return ( - this.insert('\\,\\middle' + t + '\\, ', { - mode: 'math', - format: 'latex', - style: e, - }), - !0 - ); - ('{' !== t && '\\{' !== t) || (t = '\\lbrace'), - ('}' !== t && '\\}' !== t) || (t = '\\rbrace'), - ('[' !== t && '\\[' !== t) || (t = '\\lbrack'), - (']' !== t && '\\]' !== t) || (t = '\\rbrack'); - const s = At.RIGHT_DELIM[t]; - if (s && ('leftright' !== i.type || '|' !== i.leftDelim)) { - let i = ''; - const a = - this.isCollapsed() || - 'placeholder' === this.anchor().type; - (i = this.sibling(0).isFunction - ? '\\mleft' + t + '\\mright' - : '\\left' + t + '\\right'), - (i += a ? '?' : s); - let o = []; - return ( - a && - (o = this.siblings().splice( - this.anchorOffset() + 1, - this.siblings().length - )), - this.insert(i, { - mode: 'math', - format: 'latex', - style: e, - }), - a && ((this.sibling(0).body = o), this.move(-1)), - !0 - ); - } - let a; - if ( - (Object.keys(At.RIGHT_DELIM).forEach(e => { - t === At.RIGHT_DELIM[e] && (a = e); - }), - a) - ) { - if ( - i && - 'leftright' === i.type && - this.endOffset() === this.siblings().length - 1 - ) - return ( - this.contentWillChange(), - (i.rightDelim = t), - this.move(1), - this.contentDidChange(), - !0 - ); - const s = this.siblings(); - let a; - for ( - a = this.endOffset(); - a >= 0 && - ('leftright' !== s[a].type || '?' !== s[a].rightDelim); - a-- - ); - if (a >= 0) - return ( - this.contentWillChange(), - (s[a].rightDelim = t), - (s[a].body = s[a].body.concat( - s.slice(a + 1, this.endOffset() + 1) - )), - s.splice(a + 1, this.endOffset() - a), - this.setSelection(a), - this.contentDidChange(), - !0 - ); - if (i && 'leftright' === i.type && '?' === i.rightDelim) { - this.contentWillChange(), (i.rightDelim = t); - const e = s.slice(this.endOffset() + 1); - return ( - s.splice(this.endOffset() + 1), - this.path.pop(), - Array.prototype.splice.apply( - this.siblings(), - [this.endOffset() + 1, 0].concat(e) - ), - this.contentDidChange(), - !0 - ); - } - const o = this.ancestor(2); - return o && - 'leftright' === o.type && - '?' === o.rightDelim && - this.endOffset() === s.length - 1 - ? (this.move(1), this._insertSmartFence(t, e)) - : (this.insert(t, { - mode: 'math', - format: 'latex', - style: e, - }), - !0); - } - return !1; - }), - (we.prototype.positionInsertionPointAfterCommitedCommand = function() { - const t = this.siblings(), - e = this.commandOffsets(); - let i = e.start; - for (; i < e.end && !t[i].suggestion; ) i++; - this.setSelection(i - 1); - }), - (we.prototype.removeSuggestion = function() { - const t = this.siblings(); - for (let e = t.length - 1; e >= 0; e--) - t[e].suggestion && t.splice(e, 1); - }), - (we.prototype.insertSuggestion = function(t, e) { - this.removeSuggestion(); - const i = [], - s = t.substr(e); - for (const t of s) { - const e = new te.MathAtom('command', 'command', t); - (e.suggestion = !0), i.push(e); - } - Array.prototype.splice.apply( - this.siblings(), - [this.anchorOffset() + 1, 0].concat(i) - ); - }), - (we.prototype._deleteAtoms = function(t) { - t > 0 - ? this.siblings().splice(this.anchorOffset() + 1, t) - : (this.siblings().splice(this.anchorOffset() + t + 1, -t), - this.setSelection(this.anchorOffset() + t)); - }), - (we.prototype.delete = function(t) { - if (0 === (t = t || 0)) this.delete_(0); - else if (t > 0) for (; t > 0; ) this.delete_(1), t--; - else for (; t < 0; ) this.delete_(-1), t++; - }), - (we.prototype.delete_ = function(t) { - this.contentWillChange(), this.selectionWillChange(); - const e = this.suppressChangeNotifications; - if ( - ((this.suppressChangeNotifications = !0), - (t = (t = t || 0) < 0 ? -1 : t > 0 ? 1 : t), - this.removeSuggestion(), - this.parent().array && t < 0 && 0 === this.startOffset()) - ) { - const t = this.parent().array; - if ( - (function(t) { - const e = { col: 0, row: 0 }; - for (; e.row < t.length && !Ce(t, e); ) e.row += 1; - return Ce(t, e) ? 'cell' + Ae(t, e) : ''; - })(t) === this.relation() - ) { - const e = (function(t, e, i) { - e || (e = [';', ',']); - let s, - a = []; - for (const i of t) - s - ? a.push(s) - : (s = new te.MathAtom( - 'math', - 'mpunct', - e[0], - void 0 - )), - (a = a.concat(Te(i, e[1]))); - return a; - })(t); - this.path.pop(), - this.siblings().splice( - this.anchorOffset(), - 1, - ...e - ), - this.setSelection( - this.anchorOffset() - 1, - e.length - ); - } else { - const e = Me(t, this.relation()); - if (0 === e.col) { - const i = Le(t, e, -1); - (i.col = t[i.row].length - 1), - (this.path[this.path.length - 1].relation = - 'cell' + Ae(t, i)); - const s = t[i.row][i.col].length, - a = Te(t[e.row]); - (t[i.row][i.col] = t[i.row][i.col].concat(a)), - this.setSelection(s - 1, a.length), - (function(t, e) { - t.splice(e, 1); - })(t, e.row); - } else if ( - 0 === - (function(t, e) { - let i = 0; - const s = { col: e, row: 0 }; - for (; s.row < t.length; ) { - const e = Ce(t, s); - if (e && e.length > 0) { - let t = e.length; - 'first' === e[0].type && (t -= 1), - t > 0 && (i += 1); - } - s.row += 1; - } - return i; - })(t, e.col) - ) { - !(function(t, e) { - let i = 0; - for (; i < t.length; ) - t[i][e] && t[i].splice(e, 1), (i += 1); - })(t, e.col), - (e.col -= 1), - (this.path[this.path.length - 1].relation = - 'cell' + Ae(t, e)); - const i = t[e.row][e.col]; - this.setSelection(i.length - 1, 0); - } - } - return ( - (this.suppressChangeNotifications = e), - this.selectionDidChange(), - void this.contentDidChange() - ); - } - const i = this.siblings(); - if (this.isCollapsed()) { - const e = this.anchorOffset(); - if (t < 0) - if (0 !== e) { - const t = this.sibling(0); - 'leftright' === t.type - ? ((t.rightDelim = '?'), this.move(-1)) - : !t.captureSelection && - /^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test( - t.type - ) - ? this.move(-1) - : (this._announce( - 'delete', - null, - i.slice(e, e + 1) - ), - i.splice(e, 1), - this.setSelection(e - 1)); - } else { - const t = this.relation(); - if ('superscript' === t || 'subscript' === t) { - const e = this.parent()[t].filter( - t => - 'placeholder' !== t.type && - 'first' !== t.type - ); - (this.parent()[t] = null), - this.path.pop(), - Array.prototype.splice.apply( - this.siblings(), - [this.anchorOffset(), 0].concat(e) - ), - this.setSelection(this.anchorOffset() - 1), - this._announce('deleted: ' + t); - } else if ('denom' === t) { - const t = this.parent().numer.filter( - t => - 'placeholder' !== t.type && - 'first' !== t.type - ), - e = this.parent().denom.filter( - t => - 'placeholder' !== t.type && - 'first' !== t.type - ); - this.path.pop(), - Array.prototype.splice.apply( - this.siblings(), - [this.anchorOffset(), 1].concat(e) - ), - Array.prototype.splice.apply( - this.siblings(), - [this.anchorOffset(), 0].concat(t) - ), - this.setSelection( - this.anchorOffset() + t.length - 1 - ), - this._announce('deleted: denominator'); - } else if ('body' === t) { - const t = this.siblings().filter( - t => 'placeholder' !== t.type - ); - this.path.length > 1 && - (t.shift(), - this.path.pop(), - Array.prototype.splice.apply( - this.siblings(), - [this.anchorOffset(), 1].concat(t) - ), - this.setSelection(this.anchorOffset() - 1), - this._announce('deleted: root')); - } else this.move(-1), this.delete(-1); - } - else if (t > 0) - if (e !== i.length - 1) - /^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test( - this.sibling(1).type - ) - ? this.move(1) - : (this._announce( - 'delete', - null, - i.slice(e + 1, e + 2) - ), - i.splice(e + 1, 1)); - else if ('numer' === this.relation()) { - const t = this.parent().numer.filter( - t => - 'placeholder' !== t.type && - 'first' !== t.type - ), - e = this.parent().denom.filter( - t => - 'placeholder' !== t.type && - 'first' !== t.type - ); - this.path.pop(), - Array.prototype.splice.apply( - this.siblings(), - [this.anchorOffset(), 1].concat(e) - ), - Array.prototype.splice.apply( - this.siblings(), - [this.anchorOffset(), 0].concat(t) - ), - this.setSelection( - this.anchorOffset() + t.length - 1 - ), - this._announce('deleted: numerator'); - } else this.move(1), this.delete(-1); - } else { - const t = this.startOffset() + 1, - e = this.endOffset() + 1; - this._announce('deleted', null, i.slice(t, e)), - i.splice(t, e - t), - this.setSelection(t - 1); - } - (this.suppressChangeNotifications = e), - this.selectionDidChange(), - this.contentDidChange(); - }), - (we.prototype.moveToNextPlaceholder_ = function() { - this.leap(1); - }), - (we.prototype.moveToPreviousPlaceholder_ = function() { - this.leap(-1); - }), - (we.prototype.moveToNextChar_ = function() { - this.move(1); - }), - (we.prototype.moveToPreviousChar_ = function() { - this.move(-1); - }), - (we.prototype.moveUp_ = function() { - this.up(); - }), - (we.prototype.moveDown_ = function() { - this.down(); - }), - (we.prototype.moveToNextWord_ = function() { - this.skip(1); - }), - (we.prototype.moveToPreviousWord_ = function() { - this.skip(-1); - }), - (we.prototype.moveToGroupStart_ = function() { - this.setSelection(0); - }), - (we.prototype.moveToGroupEnd_ = function() { - this.setSelection(-1); - }), - (we.prototype.moveToMathFieldStart_ = function() { - this.jumpToMathFieldBoundary(-1); - }), - (we.prototype.moveToMathFieldEnd_ = function() { - this.jumpToMathFieldBoundary(1); - }), - (we.prototype.deleteNextChar_ = function() { - this.delete_(1); - }), - (we.prototype.deletePreviousChar_ = function() { - this.delete_(-1); - }), - (we.prototype.deleteNextWord_ = function() { - this.extendToNextBoundary(), this.delete_(); - }), - (we.prototype.deletePreviousWord_ = function() { - this.extendToPreviousBoundary(), this.delete_(); - }), - (we.prototype.deleteToGroupStart_ = function() { - this.extendToGroupStart(), this.delete_(); - }), - (we.prototype.deleteToGroupEnd_ = function() { - this.extendToMathFieldStart(), this.delete_(); - }), - (we.prototype.deleteToMathFieldEnd_ = function() { - this.extendToMathFieldEnd(), this.delete_(); - }), - (we.prototype.transpose_ = function() {}), - (we.prototype.extendToNextChar_ = function() { - this.extend(1); - }), - (we.prototype.extendToPreviousChar_ = function() { - this.extend(-1); - }), - (we.prototype.extendToNextWord_ = function() { - this.skip(1, { extend: !0 }); - }), - (we.prototype.extendToPreviousWord_ = function() { - this.skip(-1, { extend: !0 }); - }), - (we.prototype.extendUp_ = function() { - this.up({ extend: !0 }); - }), - (we.prototype.extendDown_ = function() { - this.down({ extend: !0 }); - }), - (we.prototype.extendToNextBoundary_ = function() { - this.skip(1, { extend: !0 }); - }), - (we.prototype.extendToPreviousBoundary_ = function() { - this.skip(-1, { extend: !0 }); - }), - (we.prototype.extendToGroupStart_ = function() { - this.setExtent(-this.anchorOffset()); - }), - (we.prototype.extendToGroupEnd_ = function() { - this.setExtent(this.siblings().length - this.anchorOffset()); - }), - (we.prototype.extendToMathFieldStart_ = function() { - this.jumpToMathFieldBoundary(-1, { extend: !0 }); - }), - (we.prototype.extendToMathFieldEnd_ = function() { - this.jumpToMathFieldBoundary(1, { extend: !0 }); - }), - (we.prototype.moveToSuperscript_ = function() { - if ((this.collapseForward(), !this.anchor().superscript)) - if (this.anchor().subscript) - this.anchor().superscript = [Oe()]; - else { - const t = this.sibling(1); - t && t.superscript - ? (this.path[this.path.length - 1].offset += 1) - : t && t.subscript - ? ((this.path[this.path.length - 1].offset += 1), - (this.anchor().superscript = [Oe()])) - : ('limits' !== this.anchor().limits && - (this.siblings().splice( - this.anchorOffset() + 1, - 0, - new te.MathAtom( - this.parent().anchorMode, - 'msubsup', - '​', - this.anchorStyle() - ) - ), - (this.path[ - this.path.length - 1 - ].offset += 1)), - (this.anchor().superscript = [Oe()])); - } - this.path.push({ relation: 'superscript', offset: 0 }), - this.selectGroup_(); - }), - (we.prototype.moveToSubscript_ = function() { - if ((this.collapseForward(), !this.anchor().subscript)) - if (this.anchor().superscript) - this.anchor().subscript = [Oe()]; - else { - const t = this.sibling(1); - t && t.subscript - ? (this.path[this.path.length - 1].offset += 1) - : t && t.superscript - ? ((this.path[this.path.length - 1].offset += 1), - (this.anchor().subscript = [Oe()])) - : ('limits' !== this.anchor().limits && - (this.siblings().splice( - this.anchorOffset() + 1, - 0, - new te.MathAtom( - this.parent().anchorMode, - 'msubsup', - '​', - this.anchorStyle() - ) - ), - (this.path[ - this.path.length - 1 - ].offset += 1)), - (this.anchor().subscript = [Oe()])); - } - this.path.push({ relation: 'subscript', offset: 0 }), - this.selectGroup_(); - }), - (we.prototype.moveToOpposite_ = function() { - const t = { - superscript: 'subscript', - subscript: 'superscript', - denom: 'numer', - numer: 'denom', - }[this.relation()]; - t || this.moveToSuperscript_(), - this.parent()[t] || (this.parent()[t] = [Oe()]), - this.setSelection(0, 'end', t); - }), - (we.prototype.moveBeforeParent_ = function() { - this.path.length > 1 - ? (this.path.pop(), - this.setSelection(this.anchorOffset() - 1)) - : this._announce('plonk'); - }), - (we.prototype.moveAfterParent_ = function() { - if (this.path.length > 1) { - const t = Se(this); - this.path.pop(), - this.setExtent(0), - this._announce('move', t); - } else this._announce('plonk'); - }), - (we.prototype._addCell = function(t) { - const e = this.parent(); - if (e && 'array' === e.type && Array.isArray(e.array)) { - const i = this.relation(); - if (e.array) { - const s = Me(e.array, i); - 'after row' === t || 'before row' === t - ? ((s.col = 0), - (s.row = s.row + ('after row' === t ? 1 : 0)), - e.array.splice(s.row, 0, [[]])) - : ((s.col += 'after column' === t ? 1 : 0), - e.array[s.row].splice(s.col, 0, [])); - const a = Ae(e.array, s); - this.path.pop(), - this.path.push({ - relation: 'cell' + a.toString(), - offset: 0, - }), - this.insertFirstAtom(); - } - } - }), - (we.prototype.convertParentToArray = function() { - const t = this.parent(); - if ('leftright' === t.type) { - t.type = 'array'; - const e = - { - '(': 'pmatrix', - '\\lbrack': 'bmatrix', - '\\lbrace': 'cases', - }[t.leftDelim] || 'matrix', - i = At.getEnvironmentInfo(e), - s = [[t.body]]; - i.parser && Object.assign(t, i.parser(e, [], s)), - (t.tabularMode = i.tabular), - (t.parseMode = this.anchorMode()), - (t.env = { ...i }), - (t.env.name = e), - (t.array = s), - (t.rowGaps = [0]), - delete t.body, - (this.path[this.path.length - 1].relation = 'cell0'); - } - }), - (we.prototype.addRowAfter_ = function() { - this.contentWillChange(), - this.convertParentToArray(), - this._addCell('after row'), - this.contentDidChange(); - }), - (we.prototype.addRowBefore_ = function() { - this.contentWillChange(), - this.convertParentToArray(), - this._addCell('before row'), - this.contentDidChange(); - }), - (we.prototype.addColumnAfter_ = function() { - this.contentWillChange(), - this.convertParentToArray(), - this._addCell('after column'), - this.contentDidChange(); - }), - (we.prototype.addColumnBefore_ = function() { - this.contentWillChange(), - this.convertParentToArray(), - this._addCell('before column'), - this.contentDidChange(); - }), - (we.prototype._applyStyle = function(t) { - if (this.isCollapsed()) return; - const e = this; - function i(t, i) { - let s = !0; - return ( - e.forEachSelected( - e => { - s = s && e[t] === i; - }, - { recursive: !0 } - ), - s - ); - } - t.color && i('color', t.color) && (t.color = 'none'), - t.backgroundColor && - i('backgroundColor', t.backgroundColor) && - (t.backgroundColor = 'none'), - t.fontFamily && - i('fontFamily', t.fontFamily) && - (t.fontFamily = 'none'), - t.series && (t.fontSeries = t.series), - t.fontSeries && - i('fontSeries', t.fontSeries) && - (t.fontSeries = 'auto'), - t.shape && (t.fontShape = t.shape), - t.fontShape && - i('fontShape', t.fontShape) && - (t.fontShape = 'auto'), - t.size && (t.fontSize = t.size), - t.fontSize && - i('fontSize', t.fontSize) && - (t.fontSize = 'size5'), - this.contentWillChange(), - this.forEachSelected(e => e.applyStyle(t), { - recursive: !0, - }), - this.contentDidChange(); - }); - var Be = { EditableMathlist: we, parseMathString: Ee }; - const $e = { - '#': '#', - '|': '|', - '[': 'BracketLeft', - ']': 'BracketRight', - '-': 'Minus', - '+': 'Plus', - '=': 'Equal', - '/': 'Slash', - '\\': 'Backslash', - }, - Re = { - Space: 'Spacebar', - ' ': 'Spacebar', - Escape: 'Esc', - ArrowLeft: 'Left', - ArrowUp: 'Up', - ArrowRight: 'Right', - ArrowDown: 'Down', - Delete: 'Del', - }, - Ke = { - q: 'KeyQ', - w: 'KeyW', - e: 'KeyE', - r: 'KeyR', - t: 'KeyT', - y: 'KeyY', - u: 'KeyU', - i: 'KeyI', - o: 'KeyO', - p: 'KeyP', - a: 'KeyA', - s: 'KeyS', - d: 'KeyD', - f: 'KeyF', - g: 'KeyG', - h: 'KeyH', - j: 'KeyJ', - k: 'KeyK', - l: 'KeyL', - z: 'KeyZ', - x: 'KeyX', - c: 'KeyC', - v: 'KeyV', - b: 'KeyB', - n: 'KeyN', - m: 'KeyM', - 1: 'Digit1', - 2: 'Digit2', - 3: 'Digit3', - 4: 'Digit4', - 5: 'Digit5', - 6: 'Digit6', - 7: 'Digit7', - 8: 'Digit8', - 9: 'Digit9', - 0: 'Digit0', - '!': 'Shift-Digit1', - '@': 'Shift-Digit2', - '#': 'Shift-Digit3', - $: 'Shift-Digit4', - '%': 'Shift-Digit5', - '^': 'Shift-Digit6', - '&': 'Shift-Digit7', - '*': 'Shift-Digit8', - '(': 'Shift-Digit9', - ')': 'Shift-Digit0', - '-': 'Minus', - _: 'Shift-Minus', - '/': 'Slash', - '\\': 'Backslash', - '|': 'Shift-Backslash', - '?': 'Shift-Slash', - ' ': 'Spacebar', - }; - function Ne(t) { - let e, - i = !0; - 'Unidentified' === t.key && - t.target && - (e = Ke[t.target.value] || t.target.value), - e || - ($e[t.key] ? ((e = $e[t.key]), (i = !1)) : (e = Re[t.key]), - e || (e = Ke[t.key.toLowerCase()])), - !e && t.code && (e = Re[t.code] || t.code); - const s = []; - return ( - t.ctrlKey && s.push('Ctrl'), - t.metaKey && s.push('Meta'), - i && t.altKey && s.push('Alt'), - i && t.shiftKey && s.push('Shift'), - 0 === s.length ? e : (s.push(e), s.join('-')) - ); - } - function We(t, e) { - let i, - s = null, - a = null, - o = !1, - n = !1; - function r(t) { - clearTimeout(i), - (i = setTimeout(function() { - clearTimeout(i), t(); - })); - } - function l() { - if ( - (function(t) { - return t.selectionStart !== t.selectionEnd; - })(t) - ) - return; - const i = t.value; - (t.value = ''), i.length > 0 && e.typedText(i); - } - const c = t || e.container; - c.addEventListener( - 'keydown', - function(i) { - if ( - ('function' == typeof e.allowDeadKey && - e.allowDeadKey()) || - ('Dead' !== i.key && - 'Unidentified' !== i.key && - 229 !== i.keyCode) - ) - n = !1; - else { - (n = !0), (o = !1); - const i = e.blur, - s = e.focus; - (e.blur = null), - (e.focus = null), - t.blur(), - t.focus(), - (e.blur = i), - (e.focus = s); - } - return ( - !( - !o && - 'CapsLock' !== i.code && - !/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code) - ) || ((s = i), (a = null), e.keystroke(Ne(i), i)) - ); - }, - !0 - ), - c.addEventListener( - 'keypress', - function(t) { - o || (s && a && e.keystroke(Ne(s), s), (a = t), r(l)); - }, - !0 - ), - c.addEventListener( - 'keyup', - function() { - o || !s || a || l(); - }, - !0 - ), - c.addEventListener( - 'paste', - function() { - t.focus(); - const i = t.value; - (t.value = ''), i.length > 0 && e.paste(i); - }, - !0 - ), - c.addEventListener( - 'copy', - function(t) { - e.copy && e.copy(t); - }, - !0 - ), - c.addEventListener( - 'cut', - function(t) { - e.cut && e.cut(t); - }, - !0 - ), - c.addEventListener( - 'blur', - function() { - (s = null), (a = null), e.blur && e.blur(); - }, - !0 - ), - c.addEventListener( - 'focus', - function() { - e.focus && e.focus(); - }, - !0 - ), - c.addEventListener( - 'compositionstart', - () => { - o = !0; - }, - !0 - ), - c.addEventListener( - 'compositionend', - () => { - (o = !1), r(l); - }, - !0 - ), - c.addEventListener('input', () => { - if (n) { - const i = e.blur, - s = e.focus; - (e.blur = null), - (e.focus = null), - t.blur(), - t.focus(), - (e.blur = i), - (e.focus = s), - (n = !1), - (o = !1), - r(l); - } else o || r(l); - }); - } - var He = { - delegateKeyboardEvents: We, - select: We.select, - keyboardEventToString: Ne, - eventToChar: function(t) { - if (!t) return ''; - let e; - return ( - 'Unidentified' === t.key && - t.target && - (e = t.target.value), - (e = e || t.key || t.code), - /^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test( - e - ) && (e = ''), - e - ); - }, - charToEvent: function(t) { - return { - key: t, - metaKey: !1, - ctrlKey: !1, - altKey: !1, - shiftKey: !1, - }; - }, - }; - const Ve = { - '\\mathrm': '\\mathrm{x=+3.14, x\\in A}', - '\\mathbf': '\\mathbf{x=+3.14, x\\in A}', - '\\bf': '\\bf{x=+3.14, x\\in A}', - '\\bm': '\\bm{x=+3.14, x\\in A}', - '\\bold': '\\bold{x=+3.14, x\\in A}', - '\\mathit': '\\mathbb{x=+3.14}', - '\\mathbb': '\\mathbb{ABCD}', - '\\Bbb': '\\mathbb{ABCD}', - '\\frak': '\\frak{ABCD}', - '\\mathfrak': '\\mathfrak{ABCD}', - '\\mathscr': '\\mathscr{ABCD}', - '\\mathsf': '\\mathsf{ABab01}', - '\\mathtt': '\\mathtt{x=+3.14, x\\in A}', - '\\mathcal': '\\mathcal{ABCD}', - '\\boldsymbol': '\\boldsymbol{ABab01+=}', - '\\text': '\\text{ABC abc}', - '\\textrm': '\\textrm{ABC abc}', - '\\textnormal': '\\textnormal{ABC abc}', - '\\textit': '\\textit{ABC abc}', - '\\textbf': '\\textbf{ABC abc}', - '\\texttt': '\\texttt{ABC abc}', - '\\textsf': '\\textsf{ABC abc}', - '\\textcolor': - '{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}', - '\\color': - '{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}', - '\\underline': '\\underline{\\unicode{"2B1A}}', - '\\overline': '\\overline{\\unicode{"2B1A}}', - '\\vec': '\\vec{\\unicode{"25CC}}', - '\\check': '\\check{\\unicode{"25CC}}', - '\\acute': '\\acute{\\unicode{"25CC}}', - '\\breve': '\\breve{\\unicode{"25CC}}', - '\\tilde': '\\tilde{\\unicode{"25CC}}', - '\\hat': '\\hat{\\unicode{"25CC}}', - '\\ddot': '\\ddot{\\unicode{"25CC}}', - '\\dot': '\\dot{\\unicode{"25CC}}', - '\\bar': '\\bar{\\unicode{"25CC}}', - '\\!': '\\unicode{"203A}\\!\\unicode{"2039}', - '\\,': '\\unicode{"203A}\\,\\unicode{"2039}', - '\\:': '\\unicode{"203A}\\:\\unicode{"2039}', - '\\;': '\\unicode{"203A}\\;\\unicode{"2039}', - '\\quad': '\\unicode{"203A}\\quad\\unicode{"2039}', - '\\qquad': '\\unicode{"203A}\\qquad\\unicode{"2039}', - '\\enskip': '\\unicode{"203A}\\enskip\\unicode{"2039}', - '\\space': '\\unicode{"203A}\\space\\unicode{"2039}', - '\\frac': '\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}', - '\\dfrac': '\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}', - '\\cfrac': '\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}', - '\\tfrac': '\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}', - '\\dbinom': '\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}', - '\\tbinom': '\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}', - '\\binom': '\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}', - '\\pdiff': '\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}', - '\\in': 'n\\in\\N', - '\\notin': 'n\\notin\\N', - '\\not': 'B \\not A', - '\\ni': 'N\\in n', - '\\owns': 'N\\owns n', - '\\subset': 'A\\subset B', - '\\supset': 'B\\supset A', - '\\subseteq': 'A\\subseteq B', - '\\supseteq': 'B\\supseteq A', - '\\nsubseteq': 'A\\nsubseteq B', - '\\nsupseteq': 'B\\nsupseteq A', - '\\subsetneq': 'A\\subsetneq B', - '\\supsetneq': 'B\\supsetneq A', - '\\varsubsetneq': 'A\\varsubsetneq B', - '\\varsupsetneq': 'B\\varsupsetneq A', - '\\nsubseteqq': 'A\\varsupsetneq B', - '\\subsetneqq': 'A\\subsetneqq B', - '\\varsubsetneqq': 'A\\varsubsetneqq B', - '\\nsubset': 'A\\nsubset B', - '\\nsupset': 'B\\nsupset A', - '\\complement': 'A^\\complement', - '\\bigcup': '\\bigcup_{\\unicode{"2B1A}}', - '\\bigcap': '\\bigcap_{\\unicode{"2B1A}}', - '\\sqrt': '\\sqrt{\\unicode{"2B1A}}', - '\\prod': '\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}', - '\\sum': '\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}', - '\\int': '\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}', - '\\stackrel': '\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}', - '\\stackbin': '\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}', - '\\underset': '\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}', - '\\overset': '\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}', - '\\prime': '\\unicode{"2B1A}^{\\prime}', - '\\boxed': '\\boxed{\\unicode{"2B1A}}', - '\\colorbox': '\\colorbox{#fbc0bd}{\\unicode{"2B1A}}', - '\\bbox': - '\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}', - '\\enclose': - '\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}', - '\\fcolorbox': - '\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}', - '\\ ': '\\char"2423', - '\\top': '{\\color{red}P}\\top', - '\\bot': '{\\color{#0F0}P}\\bot', - '\\mid': 'P(p\\mid q)', - '\\rlap': '\\rlap{x}o', - '\\llap': 'o\\llap{/}', - }, - Ue = { - '\\text': 'roman text', - '\\textrm': 'roman text', - '\\textnormal': 'roman text', - '\\textit': 'italic text', - '\\textbf': 'bold text', - '\\texttt': 'monospaced text', - '\\textsf': 'sans-serif text', - '\\mathrm': ['roman', '(upright)'], - '\\mathbf': 'bold', - '\\bf': 'bold', - '\\bold': 'bold', - '\\mathit': 'italic', - '\\mathbb': 'blackboard', - '\\Bbb': 'blackboard', - '\\mathscr': 'script', - '\\mathtt': ['typewriter', '(monospaced)'], - '\\mathsf': 'sans-serif', - '\\mathcal': 'caligraphic', - '\\frak': ['fraktur', '(gothic)'], - '\\mathfrak': ['fraktur', '(gothic)'], - '\\textcolor': 'text color', - '\\color': 'color', - '\\forall': 'for all', - '\\exists': 'there exists', - '\\nexists': 'there does not exist', - '\\frac': 'fraction', - '\\dfrac': 'display fraction', - '\\cfrac': 'continuous fraction', - '\\tfrac': 'text fraction', - '\\binom': 'binomial coefficient', - '\\dbinom': 'display binomial coefficient', - '\\tbinom': 'text binomial coefficient', - '\\pdiff': 'partial differential', - '\\vec': 'vector', - '\\check': 'caron', - '\\acute': 'acute', - '\\breve': 'breve', - '\\tilde': 'tilde', - '\\dot': 'dot', - '\\hat': ['hat', 'circumflex'], - '\\ddot': 'double dot', - '\\bar': 'bar', - '\\prime': 'prime', - '\\doubleprime': 'double prime', - '\\varnothing': 'empty set', - '\\emptyset': 'empty set', - '\\subseteq': 'subset of or
    equal to', - '\\supseteq': 'superset of or
    equal to', - '\\supset': 'superset of', - '\\subset': 'subset of', - '\\partial': 'partial derivative', - '\\bigcup': 'union', - '\\bigcap': 'intersection', - '\\approx': 'approximately equal to', - '\\notin': 'not an element of', - '\\in': ['element of', 'included in'], - '\\infty': 'infinity', - '\\land': 'logical and', - '\\sqrt': 'square root', - '\\prod': 'product', - '\\sum': 'summation', - '\\amalg': [ - 'amalgamation', - 'coproduct', - 'free product', - 'disjoint union', - ], - '\\cup': 'union with', - '\\cap': 'intersection with', - '\\int': 'integral', - '\\iint': 'surface integral', - '\\oint': 'curve integral', - '\\iiint': 'volume integral', - '\\iff': 'if and only if', - '\\ln': 'natural logarithm', - '\\boldsymbol': 'bold', - '\\setminus': 'set subtraction', - '\\stackrel': 'relation with symbol above', - '\\stackbin': 'operator with symbol above', - '\\underset': 'symbol with annotation below', - '\\overset': 'symbol with annotation above', - '\\hslash': ['h-bar', 'Planck constant'], - '\\gtrsim': 'greater than or
    similar to', - '\\propto': 'proportional to', - '\\equiv': 'equivalent to', - '\\!': ['negative thin space', '(-3 mu)'], - '\\ ': ['space', '(6 mu)'], - '\\,': ['thin space', '(3 mu)'], - '\\:': ['medium space', '(4 mu)'], - '\\;': ['thick space', '(5 mu)'], - '\\quad': ['1 em space', '(18 mu)'], - '\\qquad': ['2 em space', '(36 mu)'], - '\\enskip': ['½ em space', '(9 mu)'], - '\\mp': 'minus or plus', - '\\pm': 'plus or minus', - '\\Im': 'Imaginary part of', - '\\Re': 'Real part of', - '\\gothicCapitalR': 'Real part of', - '\\gothicCapitalI': 'Imaginary part part of', - '\\differentialD': 'differential d', - '\\aleph': [ - 'aleph', - 'infinite cardinal', - 'Wikipedia ', - ], - '\\beth': [ - 'beth', - 'beth number', - 'Wikipedia ', - ], - '\\gimel': [ - 'gimel', - 'gimel function', - 'Wikipedia ', - ], - '\\O': 'empty set', - '\\N': 'set of
    natural numbers', - '\\Z': 'set of
    integers', - '\\Q': 'set of
    rational numbers', - '\\C': 'set of
    complex numbers', - '\\R': 'set of
    real numbers', - '\\P': 'set of
    prime numbers', - '\\lesseqqgtr': 'less than, equal to or
    greater than', - '\\gnapprox': 'greater than and
    not approximately', - '\\lnapprox': 'lesser than and
    not approximately', - '\\j': 'dotless j', - '\\i': 'dotless i', - '\\cdot': 'centered dot', - '\\lmoustache': 'left moustache', - '\\rmoustache': 'right moustache', - '\\nabla': ['nabla', 'del', 'differential vector operator'], - '\\square': [ - 'square', - 'd’Alembert operator', - 'Wikipedia ', - ], - '\\blacksquare': [ - 'black square', - 'end of proof', - 'tombstone', - 'Halmos symbol', - ], - '\\Box': 'end of proof', - '\\colon': ['such that', 'ratio'], - '\\coloneq': ['is defined by', 'is assigned'], - '\\Colon': ['is defined by', 'as'], - '\\_': ['underbar', 'underscore'], - '\\ll': 'much less than', - '\\gg': 'much greater than', - '\\doteq': 'approximately equal to', - '\\Doteq': 'approximately equal to', - '\\doteqdot': 'approximately equal to', - '\\cong': ['isomorphism of', '(for algebras, modules...)'], - '\\det': ['determinant of', '(of a matrix)'], - '\\dotplus': 'Cartesian product algebra', - '\\otimes': [ - 'tensor product', - '(of algebras)', - 'Kronecker product', - '(of matrices)', - ], - '\\oplus': ['direct sum', '(of modules)'], - '\\lb': 'base-2 logarithm', - '\\lg': 'base-10 logarithm', - '\\wp': [ - 'Weierstrass P', - 'Wikipedia ', - ], - '\\wr': [ - 'wreath product', - 'Wikipedia ', - ], - '\\top': ['tautology', 'Proposition P is universally true'], - '\\bot': ['contradiction', 'Proposition P is contradictory'], - '\\mid': ['probability', 'of event A given B'], - '\\mho': [ - 'Siemens', - 'electrical conductance in SI unit', - 'Wikipedia ', - ], - '\\Longrightarrow': 'implies', - '\\Longleftrightarrow': 'if, and only if,', - '\\prec': 'precedes', - '\\preceq': 'precedes or is equal to', - '\\succ': 'succeedes', - '\\succeq': 'succeedes or is equal to', - '\\perp': ['is perpendicular to', 'is independent of'], - '\\models': [ - 'entails', - 'double-turnstyle, models', - 'is a semantic consequence of', - 'Wikipedia ', - ], - '\\vdash': [ - 'satisfies', - 'turnstyle, assertion sign', - 'syntactic inference', - 'Wikipedia ', - ], - '\\implies': ['implies', 'logical consequence'], - '\\impliedby': ['implied by', 'logical consequence'], - '\\surd': ['surd', 'root of', 'checkmark'], - '\\ltimes': [ - 'semi direct product', - 'Wikipedia ', - ], - '\\rtimes': [ - 'semi direct product', - 'Wikipedia ', - ], - '\\leftthreetimes': [ - 'semi direct product', - 'Wikipedia ', - ], - '\\rightthreetimes': [ - 'semi direct product', - 'Wikipedia ', - ], - '\\divideontimes': ['divide on times'], - '\\curlywedge': 'nor', - '\\curlyvee': 'nand', - '\\simeq': 'is group isomorphic with', - '\\vartriangleleft': [ - 'is a normal subgroup of', - 'is an ideal ring of', - ], - '\\circ': ['circle', 'ring', 'function composition'], - '\\rlap': ['overlap right', '\\rlap{x}o'], - '\\llap': ['overlap left', 'o\\llap{/}'], - '\\colorbox': ['color box', '\\colorbox{#fbc0bd}{...}'], - '\\ast': ['asterisk', 'reflexive closure (as a superscript)'], - '\\bullet': 'bullet', - '\\lim': 'limit', - }; - function je(t) { - let e = Ue[t] || ''; - return Array.isArray(e) && (e = e.join('
    ')), e; - } - function Ge(t, e) { - t.popover.innerHTML = e; - const i = t._getCaretPosition(); - i && Ze(t, i), t.popover.classList.add('is-visible'); - } - function Ze(t, e) { - const i = - window.innerHeight || - document.documentElement.clientHeight || - document.body.clientHeight, - s = - window.innerWidth || - document.documentElement.clientWidth || - document.body.clientWidth, - a = window.innerWidth - document.documentElement.clientWidth, - o = window.innerHeight - document.documentElement.clientHeight, - n = t.virtualKeyboardVisible - ? t.virtualKeyboard.offsetHeight - : 0; - e.x + t.popover.offsetWidth / 2 > s - a - ? (t.popover.style.left = s - t.popover.offsetWidth - a + 'px') - : e.x - t.popover.offsetWidth / 2 < 0 - ? (t.popover.style.left = 0) - : (t.popover.style.left = - e.x - t.popover.offsetWidth / 2 + 'px'), - e.y + t.popover.offsetHeight + 5 > i - o - n - ? (t.popover.classList.add('reverse-direction'), - (t.popover.style.top = - e.y - e.height - t.popover.offsetHeight - 5 + 'px')) - : (t.popover.classList.remove('reverse-direction'), - (t.popover.style.top = e.y + 5 + 'px')); - } - function Xe(t) { - t.popover.classList.remove('is-visible'); - } - var Je = { - getNote: je, - SAMPLES: Ve, - NOTES: Ue, - showPopoverWithLatex: function(t, e, i) { - if (!e || 0 === e.length) return void Xe(t); - const s = e, - a = (function(t, e) { - const i = he.parseTokens( - n(t), - 'math', - null, - e.config.macros - ), - s = te.decompose( - { - mathstyle: 'displaystyle', - macros: e.config.macros, - }, - i - ), - a = N.makeSpan(s, 'ML__base'), - o = N.makeSpan('', 'ML__strut'); - o.setStyle('height', a.height, 'em'); - const r = N.makeSpan('', 'ML__strut--bottom'); - return ( - r.setStyle('height', a.height + a.depth, 'em'), - r.setStyle('vertical-align', -a.depth, 'em'), - N.makeSpan([o, r, a], 'ML__mathlive').toMarkup() - ); - })(Ve[s] || e, t), - o = je(s), - r = ve.forCommand(s); - let l = i - ? '

    ' - : ''; - (l += ''), - (l += '
    ' + a + '
    '), - o && - (l += '
    ' + o + '
    '), - r && - (l += - '
    ' + - r + - '
    '), - (l += '
    '), - (l += i - ? '
    ' - : ''), - Ge(t, l); - let c = t.popover.getElementsByClassName( - 'ML__popover__content' - ); - c && - c.length > 0 && - t._attachButtonHandlers(c[0], [ - 'complete', - { acceptSuggestion: !0 }, - ]), - (c = t.popover.getElementsByClassName( - 'ML__popover__prev-shortcut' - )), - c && - c.length > 0 && - t._attachButtonHandlers(c[0], 'previousSuggestion'), - (c = t.popover.getElementsByClassName( - 'ML__popover__next-shortcut' - )), - c && - c.length > 0 && - t._attachButtonHandlers(c[0], 'nextSuggestion'); - }, - showPopover: Ge, - hidePopover: Xe, - updatePopoverPosition: function t(e, i) { - if ( - e.element && - e.element.mathfield === e && - e.popover.classList.contains('is-visible') - ) - if (i && i.deferred) - window.requestAnimationFrame(() => t(e)); - else if ( - e.mathlist.anchor() && - 'command' === e.mathlist.anchor().type - ) { - const t = e._getCaretPosition(); - t && Ze(e, t); - } else Xe(e); - }, - }; - function Ye(t, e, i) { - let s = ''; - if (Array.isArray(e) && e.length > 0) { - if ('first' === e[0].type && 0 === (e = e.slice(1)).length) - return ''; - s = (function t(e, i, s, a) { - if (0 === s.length) return ''; - if (0 === i.length) - return s.map(t => t.toLatex(a)).join(''); - let o = '', - n = '', - r = ''; - const l = i[0]; - let c = s[0][l]; - 'fontFamily' === l && - (c = s[0].fontFamily || s[0].baseFontFamily); - const h = (function(t, e, i) { - let s = 0; - if ('fontFamily' === e) - for ( - ; - t[s] && - ('mop' === t[s].type || - (t[s].fontFamily || t[s].baseFontFamily) === - i); - - ) - s++; - else if ('mode' === e) - for (; t[s] && t[s][e] === i; ) s++; - else - for ( - ; - t[s] && ('mop' === t[s].type || t[s][e] === i); - - ) - s++; - return s; - })(s, l, c); - if ('text' === s[0].mode) { - if ('fontShape' === l && s[0].fontShape) - 'it' === s[0].fontShape - ? ((n = '\\textit{'), (r = '}')) - : 'sl' === s[0].fontShape - ? ((n = '\\textsl{'), (r = '}')) - : 'sc' === s[0].fontShape - ? ((n = '\\textsc{'), (r = '}')) - : 'n' === s[0].fontShape - ? ((n = '\\textup{'), (r = '}')) - : ((n = - '\\text{\\fontshape{' + - s[0].fontShape + - '}'), - (r = '}')); - else if ('fontSeries' === l && s[0].fontSeries) - 'b' === s[0].fontSeries - ? ((n = '\\textbf{'), (r = '}')) - : 'l' === s[0].fontSeries - ? ((n = '\\textlf{'), (r = '}')) - : 'm' === s[0].fontSeries - ? ((n = '\\textmd{'), (r = '}')) - : ((n = - '\\text{\\fontseries{' + - s[0].fontSeries + - '}'), - (r = '}')); - else if ('mode' === l) { - let t = !0; - for (let e = 0; e < h; e++) - if ( - !( - s[e].fontSeries || - s[e].fontShape || - s[e].fontFamily || - s[e].baseFontFamily - ) - ) { - t = !1; - break; - } - t || ((n = '\\text{'), (r = '}')); - } else if ('fontSize' === l && s[0].fontSize) - (n = - '{\\' + - ({ - size1: 'tiny', - size2: 'scriptsize', - size3: 'footnotesize', - size4: 'small', - size5: 'normalsize', - size6: 'large', - size7: 'Large', - size8: 'LARGE', - size9: 'huge', - size10: 'Huge', - }[s[0].fontSize] || '') + - ' '), - (r = '}'); - else if ( - 'fontFamily' === l && - (s[0].fontFamily || s[0].baseFontFamily) - ) { - const t = - { - cmr: 'textrm', - cmtt: 'texttt', - cmss: 'textsf', - }[s[0].fontFamily || s[0].baseFontFamily] || ''; - t - ? ((n = '\\' + t + '{'), (r = '}')) - : ((n += - '{\\fontfamily{' + - (s[0].fontFamily || s[0].baseFontFamily) + - '}'), - (r = '}')); - } - } else if ('math' === s[0].mode) - if ('fontSeries' === l) - 'b' === s[0].fontSeries - ? ((n = '\\mathbf{'), (r = '}')) - : s[0].fontSeries && - 'n' !== s[0].fontSeries && - ((n = - '{\\fontSeries{' + s[0].fontSeries + '}'), - (r = '}')); - else if ('fontShape' === l) - 'it' === s[0].fontShape - ? ((n = '\\mathit{'), (r = '}')) - : 'n' === s[0].fontShape - ? ((n = '{\\upshape '), (r = '}')) - : s[0].fontShape && - 'n' !== s[0].fontShape && - ((n = '{\\fontShape{' + s[0].fontShape + '}'), - (r = '}')); - else if ('fontSize' === l && s[0].fontSize) - (n = - '{\\' + - ({ - size1: 'tiny', - size2: 'scriptsize', - size3: 'footnotesize', - size4: 'small', - size5: 'normalsize', - size6: 'large', - size7: 'Large', - size8: 'LARGE', - size9: 'huge', - size10: 'Huge', - }[s[0].fontSize] || '') + - ' '), - (r = '}'); - else if ('fontFamily' === l && s[0].fontFamily) { - if (!/^(math|main)$/.test(s[0].fontFamily)) { - const o = - { - cal: 'mathcal', - frak: 'mathfrak', - bb: 'mathbb', - scr: 'mathscr', - cmr: 'mathrm', - cmtt: 'mathtt', - cmss: 'mathsf', - }[s[0].fontFamily] || ''; - if (o) { - if (/^\\operatorname{/.test(s[0].latex)) - return ( - s[0].latex + t(e, i, s.slice(h), a) - ); - s[0].isFunction || - ((n = '\\' + o + '{'), (r = '}')), - (i = []); - } else - (n += - '{\\fontfamily{' + - s[0].fontFamily + - '}'), - (r = '}'); - } - } else if ('fontFamily' === l && s[0].baseFontFamily) - if (s[0].latex && s[0].latex.startsWith('\\')) - (n = ''), (r = ''); - else { - const t = - { - cal: 'mathcal', - frak: 'mathfrak', - bb: 'mathbb', - scr: 'mathscr', - cmr: 'mathrm', - cmtt: 'mathtt', - cmss: 'mathsf', - }[s[0].baseFontFamily] || ''; - t && ((n = '\\' + t + '{'), (r = '}')); - } - return ( - 'color' !== l || - !s[0].color || - 'none' === s[0].color || - (e && e.color === s[0].color) || - ((n = '\\textcolor{' + ae(s[0].color) + '}{'), - (r = '}')), - 'backgroundColor' !== l || - !s[0].backgroundColor || - 'none' === s[0].backgroundColor || - (e && e.backgroundColor === s[0].backgroundColor) || - ((n = - '\\colorbox{' + - ae(s[0].backgroundColor) + - '}{'), - (r = '}')), - (o += n), - (o += t(e, i.slice(1), s.slice(0, h), a)), - (o += r), - (o += t(e, i, s.slice(h), a)), - o - ); - })( - t, - [ - 'mode', - 'color', - 'backgroundColor', - 'fontSize', - 'fontFamily', - 'fontShape', - 'fontSeries', - ], - e, - i - ); - } else - 'number' == typeof e || 'boolean' == typeof e - ? (s = e.toString()) - : 'string' == typeof e - ? (s = e.replace(/\s/g, '~')) - : e && 'function' == typeof e.toLatex && (s = e.toLatex(i)); - return s; - } - function Qe(t) { - const e = Qe.locale.substring(0, 2); - let i = ''; - return ( - Qe.strings[Qe.locale] && (i = Qe.strings[Qe.locale][t]), - !i && Qe.strings[e] && (i = Qe.strings[e][t]), - i || (i = Qe.strings.en[t]), - i || (i = t), - i - ); - } - (te.MathAtom.prototype.toLatex = function(t) { - t = void 0 !== t && t; - let e, - i = '', - s = 0, - a = 0; - const o = this.latex ? this.latex.match(/^(\\[^{\s0-9]+)/) : null, - n = o ? o[1] : null; - switch (this.type) { - case 'group': - (i += - this.latexOpen || - (this.cssId || this.cssClass ? '' : '{')), - this.cssId && (i += '\\cssId{' + this.cssId + '}{'), - 'ML__emph' === this.cssClass - ? (i += '\\emph{' + Ye(this, this.body, t) + '}') - : (this.cssClass && - (i += '\\class{' + this.cssClass + '}{'), - (i += t - ? Ye(this, this.body, !0) - : this.latex || Ye(this, this.body, !1)), - this.cssClass && (i += '}')), - this.cssId && (i += '}'), - (i += - this.latexClose || - (this.cssId || this.cssClass ? '' : '}')); - break; - case 'array': - if ( - ((i += '\\begin{' + this.env.name + '}'), - 'array' === this.env.name) - ) { - if (((i += '{'), this.colFormat)) - for (a = 0; a < this.colFormat.length; a++) - this.colFormat[a].align - ? (i += this.colFormat[a].align) - : this.colFormat[a].rule && (i += '|'); - i += '}'; - } - for (s = 0; s < this.array.length; s++) { - for (e = 0; e < this.array[s].length; e++) - e > 0 && (i += ' & '), - (i += Ye(this, this.array[s][e], t)); - s < this.array.length - 1 && (i += ' \\\\ '); - } - i += '\\end{' + this.env.name + '}'; - break; - case 'root': - i = Ye(this, this.body, t); - break; - case 'genfrac': - /^(choose|atop|over)$/.test(this.body) - ? ((i += '{'), - (i += Ye(this, this.numer, t)), - (i += '\\' + this.body + ' '), - (i += Ye(this, this.denom, t)), - (i += '}')) - : ((i += n), - (i += `{${Ye(this, this.numer, t)}}{${Ye( - this, - this.denom, - t - )}}`)); - break; - case 'surd': - (i += '\\sqrt'), - this.index && - ((i += '['), - (i += Ye(this, this.index, t)), - (i += ']')), - (i += `{${Ye(this, this.body, t)}}`); - break; - case 'leftright': - this.inner - ? ((i += '\\left' + (this.leftDelim || '.')), - this.leftDelim && - this.leftDelim.length > 1 && - (i += ' '), - (i += Ye(this, this.body, t)), - (i += '\\right' + (this.rightDelim || '.')), - this.rightDelim && - this.rightDelim.length > 1 && - (i += ' ')) - : t && '(' === this.leftDelim && ')' === this.rightDelim - ? (i += '(' + Ye(this, this.body, t) + ')') - : ((i += '\\mleft' + (this.leftDelim || '.')), - this.leftDelim && - this.leftDelim.length > 1 && - (i += ' '), - (i += Ye(this, this.body, t)), - (i += '\\mright' + (this.rightDelim || '.')), - this.rightDelim && - this.rightDelim.length > 1 && - (i += ' ')); - break; - case 'delim': - case 'sizeddelim': - i += n + '{' + this.delim + '}'; - break; - case 'rule': - (i += n), - this.shift && (i += `[${Ye(this, this.shift, t)}em]`), - (i += `{${Ye(this, this.width, t)}em}{${Ye( - this, - this.height, - t - )}em}`); - break; - case 'line': - case 'overlap': - case 'accent': - i += `${n}{${Ye(this, this.body, t)}}`; - break; - case 'overunder': - i += `${n}{${Ye( - this, - this.overscript || this.underscript, - t - )}}{${Ye(parent, this.body, t)}}`; - break; - case 'mord': - case 'minner': - case 'mbin': - case 'mrel': - case 'mpunct': - case 'mopen': - case 'mclose': - case 'textord': - case '': - /^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test( - n - ) - ? (i += n + '{' + Ye(this, this.body, t) + '}') - : '\\char"' === n - ? (i += this.latex + ' ') - : '\\unicode' === n - ? ((i += '\\unicode{"'), - (i += ( - '000000' + this.body.charCodeAt(0).toString(16) - ) - .toUpperCase() - .substr(-6)), - (i += '}')) - : (this.latex || 'string' == typeof this.body) && - (this.latex && '\\' === this.latex[0] - ? ((i += this.latex), - /[a-zA-Z0-9]$/.test(this.latex) && (i += ' ')) - : (i += - n || - ('​' !== this.body - ? this.latex || this.body - : ''))); - break; - case 'mop': - '​' !== this.body && - ('\\mathop' === n - ? (i += n + '{' + Ye(this, this.body, t) + '}') - : '\\operatorname' === n - ? (i += n + '{' + Ye(this, this.body, t) + '}') - : this.latex && '\\' === this.latex[0] - ? ((i += this.latex), - /[a-zA-Z0-9]$/.test(this.latex) && (i += ' ')) - : (i += - n || - ('​' !== this.body - ? this.latex || this.body - : ''))), - this.explicitLimits && - ('limits' === this.limits && (i += '\\limits '), - 'nolimits' === this.limits && (i += '\\nolimits ')); - break; - case 'box': - if ('\\bbox' === n) { - if ( - ((i += n), - isFinite(this.padding) || - void 0 !== this.border || - void 0 !== this.backgroundcolor) - ) { - const t = []; - isFinite(this.padding) && - t.push( - Math.floor(100 * this.padding) / 100 + 'em' - ), - this.border && t.push('border:' + this.border), - this.backgroundcolor && - t.push(ae(this.backgroundcolor)), - (i += `[${t.join(',')}]`); - } - i += `{${Ye(this, this.body, t)}}`; - } else - '\\boxed' === n - ? (i += `\\boxed{${Ye(this, this.body, t)}}`) - : ((i += n), - this.framecolor && - (i += `{${ae(this.framecolor)}}`), - this.backgroundcolor && - (i += `{${ae(this.backgroundcolor)}}`), - (i += `{${Ye(this, this.body, t)}}`)); - break; - case 'spacing': - (i += n), - '\\hspace' === n || '\\hspace*' === n - ? ((i += '{'), - this.width - ? (i += this.width + 'em') - : (i += '0em'), - (i += '}')) - : ((i += ' '), - this.width && (i += this.width + 'em ')); - break; - case 'enclose': - if (((i += n), '\\enclose' === n)) { - i += '{'; - let t = ''; - for (const e in this.notation) - Object.prototype.hasOwnProperty.call( - this.notation, - e - ) && - this.notation[e] && - ((i += t + e), (t = ' ')); - i += '}'; - let e = ''; - (t = ''), - this.backgroundcolor && - 'transparent' !== this.backgroundcolor && - ((e += - t + - 'mathbackground="' + - ae(this.backgroundcolor) + - '"'), - (t = ',')), - this.shadow && - 'auto' !== this.shadow && - ((e += t + 'shadow="' + this.shadow + '"'), - (t = ',')), - 1 !== this.strokeWidth || - 'solid' !== this.strokeStyle - ? ((e += t + this.borderStyle), (t = ',')) - : this.strokeColor && - 'currentColor' !== this.strokeColor && - ((e += - t + - 'mathcolor="' + - ae(this.strokeColor) + - '"'), - (t = ',')), - e && (i += `[${e}]`); - } - i += `{${Ye(this, this.body, t)}}`; - break; - case 'mathstyle': - i += '\\' + this.mathstyle + ' '; - break; - case 'space': - i += this.latex; - break; - case 'placeholder': - i += '\\placeholder{' + (this.value || '') + '}'; - break; - case 'first': - case 'command': - case 'msubsup': - break; - case 'error': - i += this.latex; - } - if (this.superscript) { - let e = Ye(this, this.superscript, t); - 1 === e.length - ? ('′' === e - ? (e = '\\prime ') - : '″' === e && (e = '\\doubleprime '), - (i += '^' + e)) - : (i += '^{' + e + '}'); - } - if (this.subscript) { - const e = Ye(this, this.subscript, t); - 1 === e.length ? (i += '_' + e) : (i += '_{' + e + '}'); - } - return i; - }), - (Qe.plural = function(t, e, i) { - (i = i || {}).type = i.type || 'cardinal'; - const s = Qe.locale.substring(0, 2), - a = 'ordinal' === i.type ? Qe.ordinal : Qe.cardinal; - let o, - n = - 'ordinal' === i.type - ? Qe._ordinalPluralCategories.indexOf(a.select(t)) - : Qe._cardinalPluralCategories.indexOf(a.select(t)); - return ( - Qe.strings[Qe.locale] && (o = Qe.strings[Qe.locale][e]), - !o && Qe.strings[s] && (o = Qe.strings[s][e]), - o || - ((o = Qe.strings.en[e]), - o || (o = e), - (n = - 'ordinal' === i.type - ? Qe._ordinalPluralCategories.indexOf( - Qe._ordinalEnglish.select(t) - ) - : Qe._cardinalPluralCategories.indexOf( - Qe._cardinalEnglish.select(t) - ))), - o.split(';')[n] || o.split(';')[0] - ); - }), - (Qe.merge = function(t, e) { - if (t && e) { - const i = Qe._locale; - (Qe.locale = t), - (Qe.strings[t] = { ...Qe.strings[t], ...e }), - (Qe.locale = i); - } else - t && - !e && - ((e = t), - Object.keys(e).forEach(t => Qe.merge(t, e[t]))); - }), - Object.defineProperty(Qe, 'locale', { - set(t) { - (Qe._locale = t), - (Qe._ordinal = null), - (Qe._cardinal = null); - }, - get: () => ( - Qe._locale || - (Qe._locale = - 'undefined' == typeof navigator - ? 'en' - : navigator.language.slice(0, 5)), - Qe._locale - ), - }), - Object.defineProperty(Qe, 'ordinal', { - get: () => ( - Qe._ordinal || - ((Qe._ordinalEnglish = new Intl.PluralRules('en', { - type: 'ordinal', - })), - (Qe._ordinalEnglishPluralCategories = Qe._ordinalEnglish.resolvedOptions().pluralCategories), - (Qe._ordinal = new Intl.PluralRules(Qe.locale, { - type: 'ordinal', - })), - (Qe._ordinalPluralCategories = Qe._ordinal.resolvedOptions().pluralCategories)), - Qe._ordinal - ), - }), - Object.defineProperty(Qe, 'cardinal', { - get: () => ( - Qe._cardinal || - ((Qe._cardinalEnglish = new Intl.PluralRules('en', { - type: 'cardinal', - })), - (Qe._cardinalEnglishPluralCategories = Qe._cardinalEnglish.resolvedOptions().pluralCategories), - (Qe._cardinal = new Intl.PluralRules(Qe.locale, { - type: 'cardinal', - })), - (Qe._cardinaPluralCategories = Qe._ordinal.resolvedOptions().pluralCategories)), - Qe._cardinal - ), - }), - (Qe.strings = { - en: { - 'keyboard.tooltip.functions': 'Functions', - 'keyboard.tooltip.greek': 'Greek Letters', - 'keyboard.tooltip.command': 'LaTeX Command Mode', - 'keyboard.tooltip.numeric': 'Numeric', - 'keyboard.tooltip.roman': 'Symbols and Roman Letters', - 'tooltip.copy to clipboard': 'Copy to Clipboard', - 'tooltip.redo': 'Redo', - 'tooltip.toggle virtual keyboard': - 'Toggle Virtual Keyboard', - 'tooltip.undo': 'Undo', - }, - ar: { - 'keyboard.tooltip.functions': 'مهام', - 'keyboard.tooltip.greek': 'حروف يونانية', - 'keyboard.tooltip.command': 'حالة تلقي الأوامر اللاتك', - 'keyboard.tooltip.numeric': 'الرقمية', - 'keyboard.tooltip.roman': 'رموز الاحرف الرومانية', - 'tooltip.copy to clipboard': 'نسخ إلى الحافظة', - 'tooltip.redo': 'الإعادة', - 'tooltip.toggle virtual keyboard': - 'تبديل لوحة المفاتيح الإفتراضية', - 'tooltip.undo': 'إلغاء', - }, - de: { - 'keyboard.tooltip.functions': 'Funktionen', - 'keyboard.tooltip.greek': 'Griechische Buchstaben', - 'keyboard.tooltip.command': 'LaTeX-Befehlsmodus', - 'keyboard.tooltip.numeric': 'Numerisch', - 'keyboard.tooltip.roman': 'Symbole und römische Buchstaben', - 'tooltip.copy to clipboard': - 'In die Zwischenablage kopieren', - 'tooltip.redo': 'Wiederholen', - 'tooltip.toggle virtual keyboard': - 'Virtuelle Tastatur umschalten', - 'tooltip.undo': 'Widerrufen', - }, - el: { - 'keyboard.tooltip.functions': 'συναρτήσεις', - 'keyboard.tooltip.greek': 'ελληνικά γράμματα', - 'keyboard.tooltip.command': 'Λειτουργία εντολών LaTeX', - 'keyboard.tooltip.numeric': 'Αριθμητικός', - 'keyboard.tooltip.roman': 'Σύμβολα και ρωμαϊκά γράμματα', - 'tooltip.copy to clipboard': 'Αντιγραφή στο πρόχειρο', - 'tooltip.redo': 'Ξανακάνω', - 'tooltip.toggle virtual keyboard': - 'Εναλλαγή εικονικού πληκτρολογίου', - 'tooltip.undo': 'Ξεκάνω', - }, - es: { - 'keyboard.tooltip.functions': 'Funciones', - 'keyboard.tooltip.greek': 'Letras griegas', - 'keyboard.tooltip.command': 'Modo Comando LaTeX', - 'keyboard.tooltip.numeric': 'Numérico', - 'keyboard.tooltip.roman': 'Símbolos y letras romanas', - 'tooltip.copy to clipboard': 'Copiar al portapapeles', - 'tooltip.redo': 'Rehacer', - 'tooltip.toggle virtual keyboard': - 'Alternar teclado virtual', - 'tooltip.undo': 'Deshacer', - }, - fa: { - 'keyboard.tooltip.functions': 'توابع', - 'keyboard.tooltip.greek': 'حروف یونانی', - 'keyboard.tooltip.command': 'حالت دستور لاتک', - 'keyboard.tooltip.numeric': 'عددی', - 'keyboard.tooltip.roman': 'علائم و حروف لاتین', - 'tooltip.copy to clipboard': 'کپی به کلیپبورد', - 'tooltip.redo': 'بازگشت به بعد', - 'tooltip.toggle virtual keyboard': - 'نمایش/نهفتن کیبورد مجازی', - 'tooltip.undo': 'بازگشت به قبل', - }, - fr: { - 'keyboard.tooltip.functions': 'Fonctions', - 'keyboard.tooltip.greek': 'Lettres grecques', - 'keyboard.tooltip.command': 'Mode de commandes LaTeX', - 'keyboard.tooltip.numeric': 'Numérique', - 'keyboard.tooltip.roman': 'Lettres et symboles romains', - 'tooltip.copy to clipboard': - 'Copier dans le presse-papiers', - 'tooltip.redo': 'Rétablir', - 'tooltip.toggle virtual keyboard': - 'Afficher/Masquer le clavier virtuel', - 'tooltip.undo': 'Annuler', - }, - it: { - 'keyboard.tooltip.functions': 'Funzioni', - 'keyboard.tooltip.greek': 'Lettere greche', - 'keyboard.tooltip.command': 'Modalità di comando LaTeX', - 'keyboard.tooltip.numeric': 'Numerico', - 'keyboard.tooltip.roman': 'Simboli e lettere romane', - 'tooltip.copy to clipboard': 'Copia negli appunti', - 'tooltip.redo': 'Rifare', - 'tooltip.toggle virtual keyboard': - 'Attiva / disattiva la tastiera virtuale', - 'tooltip.undo': 'Disfare', - }, - ja: { - 'keyboard.tooltip.functions': '関数', - 'keyboard.tooltip.greek': 'ギリシャ文字', - 'keyboard.tooltip.command': 'LaTeXコマンドモード', - 'keyboard.tooltip.numeric': '数値', - 'keyboard.tooltip.roman': '記号とローマ字', - 'tooltip.copy to clipboard': 'クリップボードにコピー', - 'tooltip.redo': 'やり直し', - 'tooltip.toggle virtual keyboard': - '仮想キーボードの切り替え', - 'tooltip.undo': '元に戻す', - }, - pl: { - 'keyboard.tooltip.functions': 'Funkcje', - 'keyboard.tooltip.greek': 'Litery greckie', - 'keyboard.tooltip.command': 'Tryb poleceń LaTeX', - 'keyboard.tooltip.numeric': 'Numeryczne', - 'keyboard.tooltip.roman': 'Symbole i litery rzymskie', - 'tooltip.copy to clipboard': 'Kopiuj do Schowka', - 'tooltip.redo': 'Przywróć', - 'tooltip.toggle virtual keyboard': - 'Przełącz wirtualną klawiaturę', - 'tooltip.undo': 'Cofnij', - }, - ru: { - 'keyboard.tooltip.functions': 'Функции', - 'keyboard.tooltip.greek': 'Греческие буквы', - 'keyboard.tooltip.command': 'Режим командной строки LaTeX', - 'keyboard.tooltip.numeric': 'числовой', - 'keyboard.tooltip.roman': 'Символы и римские буквы', - 'tooltip.copy to clipboard': 'Скопировать в буфер обмена', - 'tooltip.redo': 'переделывать', - 'tooltip.toggle virtual keyboard': - 'Переключить виртуальную клавиатуру', - 'tooltip.undo': 'расстегивать', - }, - }); - const ti = { - numeric: { - tooltip: 'keyboard.tooltip.numeric', - layer: 'math', - label: '123', - layers: ['math'], - }, - roman: { - tooltip: 'keyboard.tooltip.roman', - layer: 'lower-roman', - label: 'ABC', - layers: ['lower-roman', 'upper-roman', 'symbols'], - }, - greek: { - tooltip: 'keyboard.tooltip.greek', - layer: 'lower-greek', - label: 'αβγ', - classes: 'tex-math', - layers: ['lower-greek', 'upper-greek'], - }, - functions: { - tooltip: 'keyboard.tooltip.functions', - layer: 'functions', - label: 'f ()', - classes: 'tex', - layers: ['functions'], - }, - command: { - tooltip: 'keyboard.tooltip.command', - command: 'enterCommandMode', - label: "", - layers: [ - 'lower-command', - 'upper-command', - 'symbols-command', - ], - }, - style: { - tooltip: 'keyboard.tooltip.style', - layer: 'style', - label: 'bi𝔹', - }, - }, - ei = { - '\\varphi ': { label: 'Φ', insert: '\\Phi ' }, - '\\varsigma ': { label: 'Σ', insert: '\\Sigma ' }, - '\\epsilon ': { label: 'Ɛ', insert: '{\\char"0190}' }, - '\\rho ': { label: 'Ρ', insert: '{\\char"3A1}' }, - '\\tau ': { label: 'Τ', insert: '{\\char"3A4}' }, - '\\upsilon ': { label: 'Υ', insert: '\\Upsilon ' }, - '\\theta ': { label: 'Θ', insert: '\\Theta ' }, - '\\iota ': { label: 'Ι', insert: '{\\char"399}' }, - '\\omicron ': { label: 'Ο', insert: '{\\char"39F}' }, - '\\pi ': { label: 'Π', insert: '\\Pi ' }, - '\\alpha ': { label: 'Α', insert: '{\\char"391}' }, - '\\sigma ': { label: 'Σ', insert: '\\Sigma ' }, - '\\delta ': { label: 'Δ', insert: '\\Delta ' }, - '\\phi ': { label: 'Φ', insert: '\\Phi ' }, - '\\gamma ': { label: 'Γ', insert: '\\Gamma ' }, - '\\eta ': { label: 'Η', insert: '{\\char"397}' }, - '\\xi ': { label: 'Ξ', insert: '\\Xi ' }, - '\\kappa ': { label: 'Κ', insert: '{\\char"39A}' }, - '\\lambda ': { label: 'Λ', insert: '\\Lambda ' }, - '\\zeta ': { label: 'Ζ', insert: '{\\char"396}' }, - '\\chi ': { label: 'Χ', insert: '{\\char"3A7}' }, - '\\psi ': { label: 'Ψ', insert: '\\Psi ' }, - '\\omega ': { label: 'Ω', insert: '\\Omega ' }, - '\\beta ': { label: 'Β', insert: '{\\char"392}' }, - '\\nu ': { label: 'Ν', insert: '{\\char"39D}' }, - '\\mu ': { label: 'Μ', insert: '{\\char"39C}' }, - }, - ii = { - 0: [ - '\\emptyset', - '\\varnothing', - '\\infty', - { latex: '#?_0', insert: '#@_0' }, - '\\circ', - '\\bigcirc', - '\\bullet', - ], - 2: ['\\frac{1}{2}', { latex: '#?^2', insert: '#@^2' }], - 3: ['\\frac{1}{3}', { latex: '#?^3', insert: '#@^3' }], - '.': [ - ',', - ';', - '\\colon', - { latex: ':', aside: 'ratio' }, - { latex: '\\cdotp', aside: 'center dot', classes: 'box' }, - { - latex: '\\cdots', - aside: 'center ellipsis', - classes: 'box', - }, - { latex: '\\ldotp', aside: 'low dot', classes: 'box' }, - { latex: '\\ldots', aside: 'low ellipsis', classes: 'box' }, - { latex: '\\vdots', aside: '', classes: 'box' }, - { latex: '\\ddots', aside: '', classes: 'box' }, - '\\odot', - '\\oslash', - '\\circledcirc', - ], - '*': [ - '\\cdot', - '\\ast', - '\\star', - '\\bigstar', - '\\ltimes', - '\\rtimes', - '\\rightthreetimes', - '\\leftthreetimes', - '\\intercal', - '\\prod', - { - latex: '\\prod_{n\\mathop=0}^{\\infty}', - classes: 'small', - }, - ], - '+': [ - '\\pm', - '\\mp', - '\\sum', - { - latex: '\\sum_{n\\mathop=0}^{\\infty}', - classes: 'small', - }, - '\\dotplus', - '\\oplus', - ], - '-': ['\\pm', '\\mp', '\\ominus', '\\vert #0 \\vert'], - '/': ['\\divideontimes', '/', '\\div'], - '(': [ - '\\left( #0\\right)', - '\\left[ #0\\right]', - '\\left\\{ #0\\right\\}', - '\\left\\langle #0\\right\\rangle', - '\\lfloor', - '\\llcorner', - '(', - '\\lbrack', - '\\lvert', - '\\lVert', - '\\lgroup', - '\\langle', - '\\lceil', - '\\ulcorner', - '\\lmoustache', - '\\lbrace', - ], - ')': [ - '\\rfloor', - '\\lrcorner', - ')', - '\\rbrack', - '\\rvert', - '\\rVert', - '\\rgroup', - '\\rangle', - '\\rceil', - '\\urcorner', - '\\rmoustache', - '\\rbrace', - ], - '=': [ - '\\cong', - '\\asymp', - '\\equiv', - '\\differencedelta', - '\\varpropto', - '\\thickapprox', - '\\approxeq', - '\\thicksim', - '\\backsim', - '\\eqsim', - '\\simeq', - '\\Bumpeq', - '\\bumpeq', - '\\doteq', - '\\Doteq', - '\\fallingdotseq', - '\\risingdotseq', - '\\coloneq', - '\\eqcirc', - '\\circeq', - '\\triangleq', - '\\between', - ], - '!=': ['\\neq', '\\ncong', '', '\\nsim'], - '<': [ - '\\leq', - '\\leqq', - '\\lneqq', - '\\ll', - '\\nless', - '\\nleq', - '\\precsim', - '\\lesssim', - '\\lessgtr', - '\\prec', - '\\preccurlyeq', - '\\lessdot', - '\\nprec', - ], - '>': [ - '\\geq', - '\\geqq', - '\\gneqq', - '\\gg', - '\\ngtr', - '\\ngeq', - '\\succsim', - '\\gtrsim', - '\\gtrless', - '\\succ', - '\\succcurlyeq', - '\\gtrdot', - '\\nsucc', - ], - set: [ - '\\in', - '\\owns', - '\\subset', - '\\nsubset', - '\\supset', - '\\nsupset', - ], - '!set': ['\\notin', '\\backepsilon'], - subset: [], - supset: [], - infinity: [ - '\\aleph_0', - '\\aleph_1', - '\\omega', - '\\mathfrak{m}', - ], - 'numeric-pi': [ - '\\prod', - '\\theta', - '\\rho', - '\\sin', - '\\cos', - '\\tan', - ], - ee: ['\\times 10^{#?}', '\\ln', '\\ln_{10}', '\\log'], - '^': ['_{#?}'], - int: [ - { latex: '\\int_{#?}^{#?}', classes: 'small' }, - { latex: '\\int', classes: 'small' }, - { latex: '\\smallint', classes: 'small' }, - { latex: '\\iint', classes: 'small' }, - { latex: '\\iiint', classes: 'small' }, - { latex: '\\oint', classes: 'small' }, - { latex: '\\dfrac{\\rd}{\\rd x}', classes: 'small' }, - { - latex: '\\frac{\\partial}{\\partial x}', - classes: 'small', - }, - '\\capitalDifferentialD', - '\\rd', - '\\partial', - ], - nabla: ['\\nabla\\times', '\\nabla\\cdot', '\\nabla^{2}'], - '!': ['!!', '\\Gamma', '\\Pi'], - accents: [ - '\\bar{#@}', - '\\vec{#@}', - '\\hat{#@}', - '\\check{#@}', - '\\dot{#@}', - '\\ddot{#@}', - '\\mathring{#@}', - '\\breve{#@}', - '\\acute{#@}', - '\\tilde{#@}', - '\\grave{#@}', - ], - A: [ - { latex: '\\aleph', aside: 'aleph' }, - { latex: '\\forall', aside: 'for all' }, - ], - a: [ - { latex: '\\aleph', aside: 'aleph' }, - { latex: '\\forall', aside: 'for all' }, - ], - b: [{ latex: '\\beth', aside: 'beth' }], - B: [{ latex: '\\beth', aside: 'beth' }], - c: [{ latex: '\\C', aside: 'set of complex numbers' }], - d: [{ latex: '\\daleth', aside: 'daleth' }], - D: [{ latex: '\\daleth', aside: 'daleth' }], - e: [ - { latex: '\\exponentialE', aside: 'exponential e' }, - { latex: '\\exists', aside: 'there is' }, - { latex: '\\nexists', aside: 'there isn’t' }, - ], - g: [{ latex: '\\gimel', aside: 'gimel' }], - G: [{ latex: '\\gimel', aside: 'gimel' }], - h: [ - { latex: '\\hbar', aside: 'h bar' }, - { latex: '\\hslash', aside: 'h slash' }, - ], - i: [{ latex: '\\imaginaryI', aside: 'imaginary i' }], - j: [{ latex: '\\imaginaryJ', aside: 'imaginary j' }], - l: [{ latex: '\\ell', aside: 'ell' }], - n: [{ latex: '\\N', aside: 'set of natural numbers' }], - p: [{ latex: '\\P', aside: 'set of primes' }], - q: [{ latex: '\\Q', aside: 'set of rational numbers' }], - r: [{ latex: '\\R', aside: 'set of real numbers' }], - z: [{ latex: '\\Z', aside: 'set of integers' }], - 'x-var': [ - 'y', - 'z', - 't', - 'r', - { latex: 'f(#?)', classes: 'small' }, - { latex: 'g(#?)', classes: 'small' }, - 'x^2', - 'x^n', - 'x_n', - 'x_{n+1}', - 'x_i', - 'x_{i+1}', - ], - 'n-var': ['i', 'j', 'p', 'k', 'a', 'u'], - ii: ['\\Re', '\\Im', '\\imaginaryJ', '\\Vert #0 \\Vert'], - logic: [ - { latex: '\\exists', aside: 'there is' }, - { latex: '\\nexists', aside: 'there isn’t' }, - { latex: '\\ni', aside: 'such that' }, - { latex: '\\Colon', aside: 'such that' }, - { latex: '\\implies', aside: 'implies' }, - { latex: '\\impliedby', aside: 'implied by' }, - { latex: '\\iff', aside: 'if and only if' }, - { latex: '\\land', aside: 'and' }, - { latex: '\\lor', aside: 'or' }, - { latex: '\\oplus', aside: 'xor' }, - { latex: '\\lnot', aside: 'not' }, - { latex: '\\downarrow', aside: 'nor' }, - { latex: '\\uparrow', aside: 'nand' }, - { latex: '\\curlywedge', aside: 'nor' }, - { latex: '\\bar\\curlywedge', aside: 'nand' }, - { latex: '\\therefore', aside: 'therefore' }, - { latex: '\\because', aside: 'because' }, - { latex: '^\\biconditional', aside: 'biconditional' }, - '\\leftrightarrow', - '\\Leftrightarrow', - '\\to', - '\\models', - '\\vdash', - '\\gets', - '\\dashv', - '\\roundimplies', - ], - 'set-operators': [ - '\\cap', - '\\cup', - '\\setminus', - '\\smallsetminus', - '\\complement', - ], - 'set-relations': [ - '\\in', - '\\notin', - '\\ni', - '\\owns', - '\\subset', - '\\supset', - '\\subseteq', - '\\supseteq', - '\\subsetneq', - '\\supsetneq', - '\\varsubsetneq', - '\\subsetneqq', - '\\nsubset', - '\\nsupset', - '\\nsubseteq', - '\\nsupseteq', - ], - space: [ - { - latex: '\\char"203A\\!\\char"2039', - insert: '\\!', - aside: 'negative thin space
    ⁻³⧸₁₈ em', - }, - { - latex: '\\unicode{"203A}\\,\\unicode{"2039}', - insert: '\\,', - aside: 'thin space
    ³⧸₁₈ em', - }, - { - latex: '\\unicode{"203A}\\:\\unicode{"2039}', - insert: '\\:', - aside: 'medium space
    ⁴⧸₁₈ em', - }, - { - latex: '\\unicode{"203A}\\;\\unicode{"2039}', - insert: '\\;', - aside: 'thick space
    ⁵⧸₁₈ em', - }, - { - latex: '\\unicode{"203A}\\ \\unicode{"2039}', - insert: '\\ ', - aside: '⅓ em', - }, - { - latex: '\\unicode{"203A}\\enspace\\unicode{"2039}', - insert: '\\enspace', - aside: '½ em', - }, - { - latex: '\\unicode{"203A}\\quad\\unicode{"2039}', - insert: '\\quad', - aside: '1 em', - }, - { - latex: '\\unicode{"203A}\\qquad\\unicode{"2039}', - insert: '\\qquad', - aside: '2 em', - }, - ], - delete: [ - { - label: - '', - command: '"deleteAll"', - }, - ], - '->|': [], - }; - let si = {}; - const ai = { - math: - "\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ", - 'lower-roman': - "\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ", - 'upper-roman': - "\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ", - symbols: - "\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ", - 'lower-greek': - "\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ", - 'upper-greek': - "\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ", - 'lower-command': - "\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ", - 'upper-command': - "\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ", - 'symbols-command': - "\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ", - functions: - "\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ", - style: - "\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    ", - }; - function oi(t, e, i) { - t = t.replace(/(^|[^\\])#@/g, '$1#?'); - const s = he.parseTokens(n(t), 'math', e, i.config.macros), - a = te.decompose( - { mathstyle: 'displaystyle', macros: i.config.macros }, - s - ), - o = N.makeSpan(a, 'ML__base'), - r = N.makeSpan('', 'ML__strut'); - r.setStyle('height', o.height, 'em'); - const l = N.makeSpan('', 'ML__strut--bottom'); - return ( - l.setStyle('height', o.height + o.depth, 'em'), - l.setStyle('vertical-align', -o.depth, 'em'), - N.makeSpan([r, l, o], 'ML__mathlive').toMarkup() - ); - } - function ni(t, e, i) { - let s = "
    "; - const a = e.replace(/\s+/g, ' ').split(' '); - if (a.length > 1) { - const e = Object.assign( - {}, - ti, - t.config.customVirtualKeyboards || {} - ); - for (const t of a) { - if (!e[t]) break; - (s += "
    '); - } - } - return ( - (s += '
    '), - (s += `\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `), - "' - ); - } - function ri(t, e, i) { - for (let s = 0; s < e.length; ++s) { - const a = e[s]; - a.getAttribute('data-latex') - ? (a.innerHTML = oi( - a.getAttribute('data-latex').replace(/"/g, '"'), - { '?': '{\\color{#555}{\\tiny \\char"2B1A}}' }, - t - )) - : '' === a.innerHTML && a.getAttribute('data-insert') - ? (a.innerHTML = oi( - a.getAttribute('data-insert').replace(/"/g, '"'), - { '?': '{\\color{#555}{\\tiny \\char"2B1A}}' }, - t - )) - : a.getAttribute('data-content') && - (a.innerHTML = a - .getAttribute('data-content') - .replace(/"/g, '"')), - a.getAttribute('data-aside') && - (a.innerHTML += - ''), - a.getAttribute('data-classes') && - a.classList.add(a.getAttribute('data-classes')); - let o, - n = a.getAttribute('data-insert'); - if ( - (n && (n = n.replace(/"/g, '"')), - n && - ei[n] && - (a.setAttribute('data-shifted', ei[n].label), - a.setAttribute( - 'data-shifted-command', - JSON.stringify([ - 'insertAndUnshiftKeyboardLayer', - ei[n].insert, - ]) - )), - (o = a.getAttribute('data-command') - ? JSON.parse(a.getAttribute('data-command')) - : a.getAttribute('data-insert') - ? [ - 'insert', - a.getAttribute('data-insert'), - { - focus: !0, - feedback: !0, - mode: 'math', - format: 'auto', - resetStyle: !0, - }, - ] - : a.getAttribute('data-latex') - ? [ - 'insert', - a.getAttribute('data-latex'), - { - focus: !0, - feedback: !0, - mode: 'math', - format: 'auto', - resetStyle: !0, - }, - ] - : [ - 'typedText', - a.getAttribute('data-key') || a.textContent, - { - focus: !0, - feedback: !0, - simulateKeystroke: !0, - }, - ]), - i && (o = [i, o]), - a.getAttribute('data-alt-keys')) - ) { - const t = si[a.getAttribute('data-alt-keys')]; - t && - (o = { - default: o, - pressAndHoldStart: [ - 'showAlternateKeys', - a.getAttribute('data-alt-keys'), - t, - ], - pressAndHoldEnd: 'hideAlternateKeys', - }); - } - t._attachButtonHandlers(a, o); - } - } - function li(t, e) { - const i = { - qwerty: { - 'lower-1': 'qwertyuiop', - 'lower-2': ' asdfghjkl ', - 'lower-3': '^zxcvbnm~', - 'upper-1': 'QWERTYUIOP', - 'upper-2': ' ASDFGHJKL ', - 'upper-3': '^ZXCVBNM~', - 'numpad-1': '789/', - 'numpad-2': '456*', - 'numpad-3': '123-', - 'numpad-4': '0.=+', - }, - azerty: { - 'lower-1': 'azertyuiop', - 'lower-2': 'qsdfghjklm', - 'lower-3': '^ wxcvbn ~', - 'upper-1': 'AZERTYUIOP', - 'upper-2': 'QSDFGHJKLM', - 'upper-3': '^ WXCVBN ~', - }, - qwertz: { - 'lower-1': 'qwertzuiop', - 'lower-2': ' asdfghjkl ', - 'lower-3': '^yxcvbnm~', - 'upper-1': 'QWERTZUIOP', - 'upper-2': ' ASDFGHJKL', - 'upper-3': '^YXCVBNM~', - }, - dvorak: { - 'lower-1': '^ pyfgcrl ', - 'lower-2': 'aoeuidhtns', - 'lower-3': 'qjkxbmwvz~', - 'upper-1': '^ PYFGCRL ', - 'upper-2': 'AOEUIDHTNS', - 'upper-3': 'QJKXBMWVZ~', - }, - colemak: { - 'lower-1': ' qwfpgjluy ', - 'lower-2': 'arstdhneio', - 'lower-3': '^zxcvbkm~', - 'upper-1': ' QWFPGNLUY ', - 'upper-2': 'ARSTDHNEIO', - 'upper-3': '^ZXCVBKM~', - }, - }, - s = i[t.config.virtualKeyboardLayout] - ? i[t.config.virtualKeyboardLayout] - : i.qwerty; - let a, - o = e; - o = o.replace( - //g, - "\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • " - ); - let n = o.match(/()/); - for (; n; ) { - a = ''; - const t = n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g), - e = {}; - for (const i of t) { - const t = i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/); - e[t[1]] = t[3]; - } - let r = s[e.name]; - if ((r || (r = i.qwerty[e.name]), r)) - for (const t of r) { - let i = e.class || ''; - i && (i = ' ' + i), - '~' === t - ? ((a += - "
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • ')) - : ' ' === t - ? (a += "
  • ") - : '^' === t - ? (a += - "
  • ") - : '/' === t - ? (a += - "
  • ÷
  • ") - : '*' === t - ? (a += - "
  • ×
  • ") - : '-' === t - ? (a += - "
  • ") - : /tt/.test(i) - ? (a += - "
  • ' + - t + - '
  • ') - : (a += - "
  • " + - t + - '
  • '); - } - (o = o.replace(new RegExp(n[1] + n[2] + n[3]), a)), - (n = o.match(/()/)); - } - return o; - } - var ci = { - make: function(t, e) { - let i = - '\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '; - ii['foreground-color'] = []; - for (const t of ne) - ii['foreground-color'].push({ - classes: 'small-button', - content: - '', - command: '["applyStyle",{"color":"' + t + '"}]', - }); - ii['background-color'] = []; - for (const t of oe) - ii['background-color'].push({ - classes: 'small-button', - content: - '', - command: - '["applyStyle",{"backgroundColor":"' + t + '"}]', - }); - (si = { ...ii }), - Object.keys(si).forEach(t => { - si[t] = si[t].slice(); - }); - const s = 'abcdefghijklmnopqrstuvwxyz'; - for (let t = 0; t < 26; t++) { - const e = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[t]; - si[e] || (si[e] = []), - si[e].unshift({ - latex: '\\mathbb{' + e + '}', - aside: 'blackboard', - insert: '\\mathbb{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathbf{' + e + '}', - aside: 'bold', - insert: '\\mathbf{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathsf{' + e + '}', - aside: 'sans', - insert: '\\mathsf{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathtt{' + e + '}', - aside: 'monospace', - insert: '\\mathtt{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathcal{' + e + '}', - aside: 'script', - insert: '\\mathcal{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathfrak{' + e + '}', - aside: 'fraktur', - insert: '\\mathfrak{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathbb{' + s[t] + '}', - aside: 'blackboard', - insert: '\\mathbb{' + s[t] + '}', - }), - si[e].unshift({ - latex: '\\mathbf{' + s[t] + '}', - aside: 'bold', - insert: '\\mathbf{' + s[t] + '}', - }), - si[e].unshift({ - latex: '\\mathsf{' + s[t] + '}', - aside: 'sans', - insert: '\\mathsf{' + s[t] + '}', - }), - si[e].unshift({ - latex: '\\mathcal{' + s[t] + '}', - aside: 'script', - insert: '\\mathcal{' + s[t] + '}', - }), - si[e].unshift({ - latex: '\\mathfrak{' + s[t] + '}', - aside: 'fraktur', - insert: '\\mathfrak{' + s[t] + '}', - }); - } - for (let t = 0; t <= 26; t++) { - const e = s[t]; - si[e] || (si[e] = []), - si[e].unshift({ - latex: '\\mathsf{' + e + '}', - aside: 'sans', - insert: '\\mathbb{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathbf{' + e + '}', - aside: 'bold', - insert: '\\mathbf{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathtt{' + e + '}', - aside: 'monospace', - insert: '\\mathtt{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathfrak{' + e + '}', - aside: 'fraktur', - insert: '\\mathfrak{' + e + '}', - }); - } - for (let t = 0; t < 10; t++) { - const e = '0123456789'[t]; - si[e] || (si[e] = []), - si[e].unshift({ - latex: '\\mathbf{' + e + '}', - aside: 'bold', - insert: '\\mathbf{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathsf{' + e + '}', - aside: 'sans', - insert: '\\mathsf{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathtt{' + e + '}', - aside: 'monospace', - insert: '\\mathtt{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathcal{' + e + '}', - aside: 'script', - insert: '\\mathcal{' + e + '}', - }), - si[e].unshift({ - latex: '\\mathfrak{' + e + '}', - aside: 'fraktur', - insert: '\\mathfrak{' + e + '}', - }); - } - let a = t.config.virtualKeyboards; - a || (a = 'all'), - (a = a.replace( - /\ball\b/i, - 'numeric roman greek functions command' - )); - const o = Object.assign( - {}, - ai, - t.config.customVirtualKeyboardLayers || {} - ), - n = Object.assign( - {}, - ti, - t.config.customVirtualKeyboards || {} - ), - r = a.replace(/\s+/g, ' ').split(' '); - for (const e of r) { - if (!n[e]) break; - let s = n[e].layers || []; - n[e].layer && s.push(n[e].layer), - (s = Array.from(new Set(s))); - for (const n of s) { - if (!o[n]) break; - if ('object' == typeof o[n]) { - let t = ''; - if ( - (o[n].styles && - (t += ``), - o[n].backdrop && - (t += `
    `), - o[n].container && - (t += `
    `), - o[n].rows) - ) { - t += "
    "; - for (const e of o[n].rows) { - t += '
      '; - for (const i of e) - (t += '${ - i.label ? i.label : '' - }`); - t += '
    '; - } - (t += '
    '), - o[n].container && (t += ""), - o[n].backdrop && (t += ""); - } - o[n] = t; - } - (i += - "
    "), - (i += ni(t, a, e)); - const s = 'function' == typeof o[n] ? o[n]() : o[n]; - (i += li(t, s)), (i += '
    '); - } - } - const l = document.createElement('div'); - (l.className = 'ML__keyboard'), - e - ? l.classList.add(e) - : t.config.virtualKeyboardTheme - ? l.classList.add(t.config.virtualKeyboardTheme) - : /android|cros/i.test(navigator.userAgent) && - l.classList.add('material'), - (l.innerHTML = i), - ri( - t, - l.querySelectorAll( - '.keycap, .action, .fnbutton, .bigfnbutton' - ) - ); - const c = l.getElementsByClassName('layer-switch'); - for (let e = 0; e < c.length; ++e) - c[e].classList.contains('shift') - ? t._attachButtonHandlers(c[e], { - pressed: ['shiftKeyboardLayer', 'shift'], - default: [ - 'switchKeyboardLayer', - c[e].getAttribute('data-layer'), - ], - pressAndHoldEnd: 'unshiftKeyboardLayer', - }) - : t._attachButtonHandlers(c[e], { - default: [ - 'switchKeyboardLayer', - c[e].getAttribute('data-layer'), - ], - }); - const h = l.getElementsByClassName('keyboard-layer'); - return ( - Array.from(h).forEach(t => { - t.addEventListener('mousedown', t => { - t.preventDefault(), t.stopPropagation(); - }), - t.addEventListener('touchstart', t => { - t.preventDefault(), t.stopPropagation(); - }); - }), - h[0].classList.add('is-visible'), - window.addEventListener('mouseup', function() { - t.hideAlternateKeys_(), t.unshiftKeyboardLayer_(); - }), - window.addEventListener('blur', function() { - t.hideAlternateKeys_(), t.unshiftKeyboardLayer_(); - }), - window.addEventListener('touchend', function() { - t.hideAlternateKeys_(), t.unshiftKeyboardLayer_(); - }), - window.addEventListener('touchcancel', function() { - t.hideAlternateKeys_(), t.unshiftKeyboardLayer_(); - }), - l - ); - }, - makeKeycap: ri, - }; - const hi = { - '−': '-', - '-': '-', - '\\alpha': 'alpha', - '\\beta': 'beta', - '\\gamma': 'gamma', - '\\delta': 'delta', - '\\epsilon': 'epsilon', - '\\varepsilon': 'varepsilon', - '\\zeta': 'zeta', - '\\eta': 'eta', - '\\theta': 'theta', - '\\vartheta': 'vartheta', - '\\iota': 'iota', - '\\kappa': 'kappa', - '\\lambda': 'lambda', - '\\mu': 'mu', - '\\nu': 'nu', - '\\xi': 'xi', - '\\pi': 'pi', - '\\rho': 'rho', - '\\sigma': 'sigma', - '\\tau': 'tau', - '\\upsilon': 'upsilon', - '\\phi': 'phi', - '\\varphi': 'varphi', - '\\chi': 'chi', - '\\psi': 'psi', - '\\omega': 'omega', - '\\Gamma': 'Gamma', - '\\Delta': 'Delta', - '\\Theta': 'Theta', - '\\Lambda': 'Lambda', - '\\Xi': 'Xi', - '\\Pi': 'Pi', - '\\Sigma': 'Sigma', - '\\Phi': 'Phi', - '\\Psi': 'Psi', - '\\Omega': 'Omega', - }, - di = { - '\\pm': '+-', - '\\times': 'xx', - '\\colon': ':', - '\\vert': '|', - '\\Vert': '||', - '\\mid': '|', - '\\lbrace': '{', - '\\rbrace': '}', - '\\langle': '(:', - '\\rangle': ':)', - }, - pi = { - '\\pm': '±', - '\\times': '×', - '\\colon': ':', - '\\vert': '|', - '\\Vert': '∥', - '\\mid': '∣', - '\\lbrace': '{', - '\\rbrace': '}', - '\\langle': '⟨', - '\\rangle': '⟩', - '\\lfloor': '⌊', - '\\rfloor': '⌋', - '\\lceil': '⌈', - '\\rceil': '⌉', - '\\vec': '⃗', - '\\acute': '´', - '\\grave': '`', - '\\dot': '˙', - '\\ddot': '¨', - '\\tilde': '~', - '\\bar': '¯', - '\\breve': '˘', - '\\check': 'ˇ', - '\\hat': '^', - }; - function mi(t) { - return t - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>'); - } - function ui(t, e) { - return t && e.generateID ? ' extid="' + t + '"' : ''; - } - function fi(t, e, i) { - let s = !1; - e = e || t.atoms.length; - let a = '', - o = '', - n = -1, - r = -1; - const l = t.atoms[t.index]; - if ( - (t.index < e && - ('mord' === l.type || 'textord' === l.type) && - '0123456789,.'.indexOf(l.body) < 0 && - ((o = l.toMathML(i)), - l.superscript && (n = t.index), - l.subscript && (r = t.index), - (t.index += 1)), - o.length > 0) - ) { - if ( - ((s = !0), - gi(t) && ((n = t.index), (t.index += 1)), - yi(t) && ((r = t.index), (t.index += 1)), - n >= 0 && r >= 0) - ) - (a = '' + o), - (a += Si(t.atoms[r].subscript, 0, 0, i).mathML), - (a += Si(t.atoms[n].superscript, 0, 0, i).mathML), - (a += ''); - else if (n >= 0) { - if (((a = '' + o), gi(t))) { - const e = Si(t.atoms[n].superscript, 0, 0, i).mathML, - s = Si(t.atoms[n + 1].superscript, 0, 0, i).mathML; - a += - ('' !== e && '' !== e) || - ('' !== s && '' !== s) - ? '' === e || - '' === e - ? '' - : e - : ''; - } else a += Si(t.atoms[n].superscript, 0, 0, i).mathML; - a += ''; - } else - r >= 0 - ? ((a = '' + o), - (a += Si(t.atoms[r].subscript, 0, 0, i).mathML), - (a += '')) - : (a = o); - ('mi' !== t.lastType && - 'mn' !== t.lastType && - 'mtext' !== t.lastType && - 'fence' !== t.lastType) || - /^(.*)<\/mo>$/.test(a) || - (a = '' + a), - o.endsWith('>f') || o.endsWith('>g') - ? ((a += ''), - (t.lastType = 'applyfunction')) - : (t.lastType = /^(.*)<\/mo>$/.test(a) - ? 'mo' - : 'mi'), - (t.mathML += a); - } - return s; - } - function gi(t) { - return ( - t.index < t.atoms.length && - t.atoms[t.index].superscript && - 'msubsup' === t.atoms[t.index].type - ); - } - function yi(t) { - return ( - t.index < t.atoms.length && - t.atoms[t.index].subscript && - 'msubsup' === t.atoms[t.index].type - ); - } - function bi(t, e, i) { - let s = !1, - a = '', - o = e.atoms[e.index - 1]; - return ( - !!o && - (o.superscript || - o.subscript || - ((gi(e) || yi(e)) && - ((o = e.atoms[e.index]), (e.index += 1))), - !!o && - (o.superscript && o.subscript - ? ((a = '' + t), - (a += Si(o.subscript, 0, 0, i).mathML), - (a += Si(o.superscript, 0, 0, i).mathML), - (a += '')) - : o.superscript - ? ((a = '' + t), - (a += Si(o.superscript, 0, 0, i).mathML), - (a += '')) - : o.subscript && - ((a = '' + t), - (a += Si(o.subscript, 0, 0, i).mathML), - (a += '')), - a.length > 0 && - ((s = !0), (e.mathML += a), (e.lastType = '')), - s)) - ); - } - function xi(t, e, i) { - let s = !1; - e = e || t.atoms.length; - const a = t.index; - let o = ''; - for (; t.index < e && 'text' === t.atoms[t.index].mode; ) - (o += t.atoms[t.index].body ? t.atoms[t.index].body : ' '), - (t.index += 1); - return ( - o.length > 0 && - ((s = !0), - (o = - '' + o + ''), - (t.mathML += o), - (t.lastType = 'mtext')), - s - ); - } - function ki(t, e, i) { - let s = !1; - e = e || t.atoms.length; - const a = t.index; - let o = '', - n = (function(t) { - let e = -1, - i = t.index, - s = !1, - a = !1; - for (; i < t.atoms.length && !s && !a; ) - (s = - 'mord' !== t.atoms[i].type || - '0123456789,.'.indexOf(t.atoms[i].body) < 0), - (a = !s && t.atoms[i].superscript), - i++; - return a && (e = i - 1), e; - })(t); - for ( - n >= 0 && n < e && (e = n); - t.index < e && - 'mord' === t.atoms[t.index].type && - '0123456789,.'.indexOf(t.atoms[t.index].body) >= 0; - - ) - (o += t.atoms[t.index].body), (t.index += 1); - return ( - o.length > 0 && - ((s = !0), - (o = '' + o + ''), - n < 0 && gi(t) && ((n = t.index), (t.index += 1)), - n >= 0 && - ((o = '' + o), - (o += Si(t.atoms[n].superscript, 0, 0, i).mathML), - (o += '')), - (t.mathML += o), - (t.lastType = 'mn')), - s - ); - } - function vi(t, e, i) { - let s = !1; - e = e || t.atoms.length; - let a = '', - o = ''; - if (t.index < e && 'mopen' === t.atoms[t.index].type) { - let n = !1, - r = 0; - const l = t.index; - let c = -1, - h = l + 1; - for (; h < e && !n; ) - 'mopen' === t.atoms[h].type - ? (r += 1) - : 'mclose' === t.atoms[h].type && (r -= 1), - -1 === r && ((n = !0), (c = h)), - (h += 1); - n && - ((a = ''), - (a += Ai(t.atoms[l], i)), - (a += Si(t.atoms, l + 1, c, i).mathML), - (a += Ai(t.atoms[c], i)), - (a += ''), - ('mi' !== t.lastType && - 'mn' !== t.lastType && - 'mfrac' !== t.lastType && - 'fence' !== t.lastType) || - (a = '' + a), - (t.index = c + 1), - bi(a, t, i) && ((s = !0), (t.lastType = ''), (a = '')), - (o = 'fence')); - } - return ( - a.length > 0 && ((s = !0), (t.mathML += a), (t.lastType = o)), s - ); - } - function wi(t, e, i) { - let s = !1; - e = e || t.atoms.length; - let a = '', - o = ''; - const n = t.atoms[t.index]; - if (t.index < e && ('mbin' === n.type || 'mrel' === n.type)) - (a += t.atoms[t.index].toMathML(i)), (t.index += 1), (o = 'mo'); - else if (t.index < e && 'mop' === n.type) { - if ('limits' === n.limits && (n.superscript || n.subscript)) { - const t = Ai(n, i); - n.superscript && n.subscript - ? ((a += - ('nolimits' !== n.limits - ? '' - : '') + t), - (a += Si(n.subscript, 0, 0, i).mathML), - (a += Si(n.superscript, 0, 0, i).mathML), - (a += - 'nolimits' !== n.limits - ? '' - : '')) - : n.superscript - ? ((a += - ('nolimits' !== n.limits ? '' : '') + - t), - (a += Si(n.superscript, 0, 0, i).mathML), - (a += - 'nolimits' !== n.limits ? '' : '')) - : ((a += - ('nolimits' !== n.limits - ? '' - : '') + t), - (a += Si(n.subscript, 0, 0, i).mathML), - (a += - 'nolimits' !== n.limits - ? '' - : '')), - (o = 'mo'); - } else { - const e = t.atoms[t.index], - n = 0 === e.latex.indexOf('\\operatorname'), - r = n - ? '' + - Mi(e.body) + - '' - : Ai(e, i); - (a += r), - (t.index += 1), - bi(a, t, i) && ((s = !0), (t.lastType = ''), (a = '')), - (t.index -= 1), - n || /^(.*)<\/mo>$/.test(r) - ? (o = n ? 'mi' : 'mo') - : ((a += ''), - (o = 'applyfunction')); - } - ('mi' !== t.lastType && 'mn' !== t.lastType) || - /^(.*)<\/mo>$/.test(a) || - (a = '' + a), - (t.index += 1); - } - return ( - a.length > 0 && ((s = !0), (t.mathML += a), (t.lastType = o)), s - ); - } - function Si(t, e, i, s) { - const a = { atoms: t, index: e || 0, mathML: '', lastType: '' }; - if ( - ((i = i || (t ? t.length : 0)), - 'number' == typeof t || 'boolean' == typeof t) - ) - a.mathML = t.toString(); - else if ('string' == typeof t) a.mathML = t; - else if (t && 'function' == typeof t.toMathML) - a.mathML = t.toMathML(s); - else if (Array.isArray(t)) { - let t = 0; - for (; a.index < i; ) - if ( - xi(a, i, s) || - ki(a, i, s) || - fi(a, i, s) || - wi(a, i, s) || - vi(a, i, s) - ) - t += 1; - else if (a.index < i) { - let e = a.atoms[a.index].toMathML(s); - 'mn' === a.lastType && - e.length > 0 && - 'genfrac' === a.atoms[a.index].type && - (e = '' + e), - 'genfrac' === a.atoms[a.index].type - ? (a.lastType = 'mfrac') - : (a.lastType = ''), - e.length > 0 && ((a.mathML += e), (t += 1)), - (a.index += 1); - } - t > 1 && (a.mathML = '' + a.mathML + ''); - } - return a; - } - function Ai(t, e) { - let i = ''; - const s = Mi(t.body); - return s && (i = '' + s + ''), i; - } - function Mi(t) { - if (!t) return ''; - if ('string' == typeof t) return mi(t); - if (!Array.isArray(t) && 'string' == typeof t.body) - return mi(t.body); - let e = ''; - for (const i of t) 'string' == typeof i.body && (e += i.body); - return mi(e); - } - (te.MathAtom.prototype.toMathML = function(t) { - const e = { - '\\exponentialE': 'ⅇ', - '\\imaginaryI': 'ⅈ', - '\\differentialD': 'ⅆ', - '\\capitalDifferentialD': 'ⅅ', - '\\alpha': 'α', - '\\pi': 'π', - '\\infty': '∞', - '\\forall': '∀', - '\\nexists': '∄', - '\\exists': '∃', - '\\hbar': 'ℏ', - '\\cdotp': '⋅', - '\\ldots': '…', - '\\cdots': '⋯', - '\\ddots': '⋱', - '\\vdots': '⋮', - '\\ldotp': '.', - }, - i = { - '\\!': -3 / 18, - '\\ ': 6 / 18, - '\\,': 3 / 18, - '\\:': 4 / 18, - '\\;': 5 / 18, - '\\enspace': 0.5, - '\\quad': 1, - '\\qquad': 2, - '\\enskip': 0.5, - }; - let s, - a, - o, - n, - r, - l, - c = '', - h = '', - d = - { - cal: 'script', - frak: 'fraktur', - bb: 'double-struck', - scr: 'script', - cmtt: 'monospace', - cmss: 'sans-serif', - }[this.fontFamily || this.font] || ''; - d && (d = ' mathvariant="' + d + '"'); - const p = this.latex ? this.latex.trim() : null; - if ('text' === this.mode) - c = '' + this.body + ''; - else - switch (this.type) { - case 'first': - break; - case 'group': - case 'root': - c = Si(this.body, 0, 0, t).mathML; - break; - case 'array': - if ( - (((this.lFence && '.' !== this.lFence) || - (this.rFence && '.' !== this.rFence)) && - ((c += ''), - this.lFence && - '.' !== this.lFence && - (c += - '' + - (pi[this.lFence] || this.lFence) + - '')), - (c += '' + - Si(this.array[a][s], 0, 0, t).mathML + - ''; - c += ''; - } - (c += ''), - ((this.lFence && '.' !== this.lFence) || - (this.rFence && '.' !== this.rFence)) && - (this.rFence && - '.' !== this.rFence && - (c += - '' + - (pi[this.lFence] || this.rFence) + - ''), - (c += '')); - break; - case 'genfrac': - (this.leftDelim || this.rightDelim) && (c += ''), - this.leftDelim && - '.' !== this.leftDelim && - (c += - '' + - (pi[this.leftDelim] || this.leftDelim) + - ''), - this.hasBarLine - ? ((c += ''), - (c += - Si(this.numer, 0, 0, t).mathML || - ' '), - (c += - Si(this.denom, 0, 0, t).mathML || - ' '), - (c += '')) - : ((c += ''), - (c += - '' + - Si(this.numer, 0, 0, t).mathML + - ''), - (c += - '' + - Si(this.denom, 0, 0, t).mathML + - ''), - (c += '')), - this.rightDelim && - '.' !== this.rightDelim && - (c += - '' + - (pi[this.rightDelim] || this.rightDelim) + - ''), - (this.leftDelim || this.rightDelim) && - (c += ''); - break; - case 'surd': - this.index - ? ((c += ''), - (c += Si(this.body, 0, 0, t).mathML), - (c += Si(this.index, 0, 0, t).mathML), - (c += '')) - : ((c += ''), - (c += Si(this.body, 0, 0, t).mathML), - (c += '')); - break; - case 'leftright': - (c = ''), - this.leftDelim && - '.' !== this.leftDelim && - (c += - '' + - (pi[this.leftDelim] || this.leftDelim) + - ''), - this.body && (c += Si(this.body, 0, 0, t).mathML), - this.rightDelim && - '.' !== this.rightDelim && - (c += - '' + - (pi[this.rightDelim] || this.rightDelim) + - ''), - (c += ''); - break; - case 'sizeddelim': - case 'delim': - c += - '' + - (pi[this.delim] || this.delim) + - ''; - break; - case 'accent': - (c += ''), - (c += Si(this.body, 0, 0, t).mathML), - (c += '' + (pi[p] || this.accent) + ''), - (c += ''); - break; - case 'line': - case 'overlap': - break; - case 'overunder': - (r = this.overscript), - (n = this.underscript), - r && n - ? (l = this.body) - : r - ? ((l = this.body), - this.body[0] && this.body[0].underscript - ? ((n = this.body[0].underscript), - (l = this.body[0].body)) - : this.body[0] && - 'first' === this.body[0].type && - this.body[1] && - this.body[1].underscript && - ((n = this.body[1].underscript), - (l = this.body[1].body))) - : n && - ((l = this.body), - this.body[0] && this.body[0].overscript - ? ((r = this.body[0].overscript), - (l = this.body[0].body)) - : this.body[0] && - 'first' === this.body[0].type && - this.body[1] && - this.body[1].overscript && - ((r = this.body[1].overscript), - (l = this.body[1].body))), - r && n - ? ((c += - '' + - Si(l, 0, 0, t).mathML), - (c += Si(n, 0, 0, t).mathML), - (c += Si(r, 0, 0, t).mathML), - (c += '')) - : r - ? ((c += - '' + - Si(l, 0, 0, t).mathML), - (c += Si(r, 0, 0, t).mathML), - (c += '')) - : n && - ((c += - '' + - Si(l, 0, 0, t).mathML), - (c += Si(n, 0, 0, t).mathML), - (c += '')); - break; - case 'placeholder': - case 'mord': { - c = - e[p] || - p || - ('string' == typeof this.body ? this.body : ''); - const i = p - ? p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/) - : null; - i - ? (c = '&#x' + i[1] + ';') - : c.length > 0 && - '\\' === c.charAt(0) && - (c = - 'string' == typeof this.body && - this.body.charCodeAt(0) > 255 - ? '&#x' + - ( - '000000' + - this.body.charCodeAt(0).toString(16) - ).substr(-4) + - ';' - : 'string' == typeof this.body - ? this.body.charAt(0) - : this.body); - const s = /\d/.test(c) ? 'mn' : 'mi'; - c = - '<' + - s + - d + - ui(this.id, t) + - '>' + - mi(c) + - ''; - break; - } - case 'mbin': - case 'mrel': - case 'textord': - case 'minner': - c = - p && e[p] - ? '' + e[p] + '' - : p && pi[p] - ? '' + pi[p] + '' - : Ai(this, t); - break; - case 'mpunct': - c = - '' + - (pi[p] || p) + - ''; - break; - case 'mop': - '​' !== this.body && - ((c = ''), - (c += - '\\operatorname' === p - ? this.body - : p || this.body), - (c += '')); - break; - case 'mathstyle': - break; - case 'box': - (c = '' + - Si(this.body, 0, 0, t).mathML + - ''); - break; - case 'spacing': - c += ''; - break; - case 'enclose': - c = '' + - Si(this.body, 0, 0, t).mathML + - ''; - break; - case 'space': - c += ' '; - } - return c; - }), - (te.toMathML = function(t, e) { - return Si(t, 0, 0, e).mathML; - }); - const Ci = { - '\\imaginaryI': 'ⅈ', - '\\imaginaryJ': 'ⅉ', - '\\pi': 'π', - '\\exponentialE': 'ℯ', - '﹢': '+', - '+': '+', - '−': '-', - '-': '-', - '﹣': '-', - '-': '-', - '\\times': '*', - '\\cdot': '*', - '⨉': '*', - '️✖': '*', - '️×': '*', - '.': '*', - '÷': '/', - '⁄': '/', - '/': '/', - '!': 'factorial', - '\\mp': 'minusplus', - '\\ne': '!=', - '\\coloneq': ':=', - '\\questeq': '?=', - '\\approx': 'approx', - '\\cong': 'congruent', - '\\sim': 'similar', - '\\equiv': 'equiv', - '\\pm': 'plusminus', - '\\land': 'and', - '\\wedge': 'and', - '\\lor': 'or', - '\\vee': 'or', - '\\oplus': 'xor', - '\\veebar': 'xor', - '\\lnot': 'not', - '\\neg': 'not', - '\\exists': 'exists', - '\\nexists': '!exists', - '\\forall': 'forAll', - '\\backepsilon': 'suchThat', - '\\therefore': 'therefore', - '\\because': 'because', - '\\nabla': 'nabla', - '\\circ': 'circle', - '\\ominus': 'ominus', - '\\odot': 'odot', - '\\otimes': 'otimes', - '\\zeta': 'Zeta', - '\\Gamma': 'Gamma', - '\\min': 'min', - '\\max': 'max', - '\\mod': 'mod', - '\\lim': 'lim', - '\\sum': 'sum', - '\\prod': 'prod', - '\\int': 'integral', - '\\iint': 'integral2', - '\\iiint': 'integral3', - '\\Re': 'Re', - '\\gothicCapitalR': 'Re', - '\\Im': 'Im', - '\\gothicCapitalI': 'Im', - '\\binom': 'nCr', - '\\partial': 'partial', - '\\differentialD': 'differentialD', - '\\capitalDifferentialD': 'capitalDifferentialD', - '\\Finv': 'Finv', - '\\Game': 'Game', - '\\wp': 'wp', - '\\ast': 'ast', - '\\star': 'star', - '\\asymp': 'asymp', - '\\to': 'to', - '\\gets': 'gets', - '\\in': 'elementof', - '\\notin': '!elementof', - '\\ni': 'ownedby', - '\\owns': 'ownedby', - '\\subset': 'subset', - '\\supset': 'superset', - '\\complement': 'complement', - '\\rightarrow': 'shortLogicalImplies', - '\\leftarrow': 'shortLogicalImpliedBy', - '\\leftrightarrow': 'shortLogicalEquivalent', - '\\longrightarrow': 'logicalImplies', - '\\longleftarrow': 'logicalImpliedBy', - '\\longleftrightarrow': 'logicalEquivalent', - '\\Rightarrow': 'shortImplies', - '\\Leftarrow': 'shortImpliedBy', - '\\Leftrightarrow': 'shortEquivalent', - '\\implies': 'implies', - '\\Longrightarrow': 'implies', - '\\impliedby': 'impliedBy', - '\\Longleftarrow': 'impliedBy', - '\\iff': 'equivalent', - '\\Longleftrightarrow': 'equivalent', - }, - _i = { - '+': 'add', - '*': 'multiply', - '-': 'subtract', - '/': 'divide', - '=': 'equal', - ':=': 'assign', - '!=': 'ne', - '?=': 'questeq', - approx: 'approx', - congruent: 'congruent', - similar: 'similar', - equiv: 'equiv', - '<': 'lt', - '>': 'gt', - '<=': 'le', - '>=': 'ge', - '≤': 'le', - '≥': 'ge', - '>>': 'gg', - '<<': 'll', - '**': 'pow', - '++': 'increment', - '--': 'decrement', - }, - Ti = { - equal: '%0 = %1', - ne: '%0 \\ne %1', - questeq: '%0 \\questeq %1', - approx: '%0 \\approx %1', - congruent: '%0 \\cong %1', - similar: '%0 \\sim %1', - equiv: '%0 \\equiv %1', - assign: '%0 := %1', - lt: '%0 < %1', - gt: '%0 > %1', - le: '%0 \\le %1', - ge: '%0 \\ge %1', - sin: '\\sin%_%^ %0', - cos: '\\cos%_%^ %0', - tan: '\\tan%_%^ %0', - cot: '\\cot%_%^ %0', - sec: '\\sec%_%^ %0', - csc: '\\csc%_%^ %0', - sinh: '\\sinh %0', - cosh: '\\cosh %0', - tanh: '\\tanh %0', - csch: '\\csch %0', - sech: '\\sech %0', - coth: '\\coth %0', - arcsin: '\\arcsin %0', - arccos: '\\arccos %0', - arctan: '\\arctan %0', - arccot: '\\arcctg %0', - arcsec: '\\arcsec %0', - arccsc: '\\arccsc %0', - arsinh: '\\arsinh %0', - arcosh: '\\arcosh %0', - artanh: '\\artanh %0', - arcsch: '\\arcsch %0', - arsech: '\\arsech %0', - arcoth: '\\arcoth %0', - ln: '\\ln%_%^ %', - log: '\\log%_%^ %', - lg: '\\lg %', - lb: '\\lb %', - sum: '\\sum%_%^ %0', - prod: '\\prod%_%^ %0', - Zeta: '\\zeta%_%^ %', - Gamma: '\\Gamma %', - min: '\\min%_%^ %', - max: '\\max%_%^ %', - mod: '\\mod%_%^ %', - lim: '\\lim%_%^ %', - binom: '\\binom %', - nabla: '\\nabla %', - curl: '\\nabla\\times %0', - div: '\\nabla\\cdot %0', - floor: '\\lfloor %0 \\rfloor%_%^', - ceil: '\\lceil %0 \\rceil%_%^', - abs: '\\left| %0 \\right|%_%^', - norm: '\\lVert %0 \\rVert%_%^', - ucorner: '\\ulcorner %0 \\urcorner%_%^', - lcorner: '\\llcorner %0 \\lrcorner%_%^', - angle: '\\langle %0 \\rangle%_%^', - group: '\\lgroup %0 \\rgroup%_%^', - moustache: '\\lmoustache %0 \\rmoustache%_%^', - brace: '\\lbrace %0 \\rbrace%_%^', - 'sqrt[]': '\\sqrt[%^]{%0}', - sqrt: '\\sqrt{%0}', - lcm: '\\operatorname{lcm}%', - gcd: '\\operatorname{gcd}%', - erf: '\\operatorname{erf}%', - erfc: '\\operatorname{erfc}%', - randomReal: '\\operatorname{randomReal}%', - randomInteger: '\\operatorname{randomInteger}%', - and: '%0 \\land %1', - or: '%0 \\lor %1', - xor: '%0 \\oplus %1', - not: '%0 \\lnot %1', - circle: '%0 \\circ %1', - ast: '%0 \\ast %1', - star: '%0 \\star %1', - asymp: '%0 \\asymp %1', - '/': '\\frac{%0}{%1}', - Re: '\\Re{%0}', - Im: '\\Im{%0}', - factorial: '%0!', - factorial2: '%0!!', - }, - Li = { - degree: 880, - nabla: 740, - curl: 740, - partial: 740, - differentialD: 740, - capitalDifferentialD: 740, - '**': 720, - odot: 710, - not: 680, - div: 660, - solidus: 660, - '/': 660, - setminus: 650, - '%': 640, - otimes: 410, - union: 350, - intersection: 350, - '*': 390, - ast: 390, - '.': 390, - oplus: 300, - ominus: 300, - '+': 275, - '-': 275, - '+-': 275, - '-+': 275, - circle: 265, - circledast: 265, - circledcirc: 265, - star: 265, - '..': 263, - to: 262, - in: 262, - '|': 261, - congruent: 265, - equiv: 260, - '=': 260, - '!=': 255, - '?=': 255, - similar: 250, - approx: 247, - '<': 245, - '>': 243, - '>=': 242, - '≥': 242, - '<=': 241, - complement: 240, - subset: 240, - superset: 240, - elementof: 240, - '!elementof': 240, - exists: 230, - '!exists': 230, - forall: 230, - and: 200, - xor: 195, - or: 190, - suchThat: 110, - ':': 100, - assign: 80, - ':=': 80, - therefore: 70, - because: 70, - shortLogicalImplies: 52, - shortImplies: 51, - logicalImplies: 50, - implies: 49, - shortLogicalImpliedBy: 48, - shortImpliedBy: 47, - logicalImpliedBy: 46, - impliedBy: 45, - shortLogicalEquivalent: 44, - shortEquivalent: 43, - logicalEquivalent: 42, - equivalent: 41, - ',': 40, - ';': 30, - }; - function Fi(t, e) { - return Array.isArray(t.arg) ? t.arg[e] : void 0; - } - function Di(t) { - return (t && Li[t]) || -1; - } - function zi(t) { - return /=|=>/.test(t) ? 'right' : 'left'; - } - function Ei(t) { - if ('f' === t || 'g' === t) return !0; - const e = Ti[t]; - return !!e && !!/%[^01_^]?/.test(e); - } - function qi(t) { - t = (t || '').trim(); - let e = Ci[t]; - if (!e) - if (/^\\[^{}]+$/.test(t)) { - const i = At.getInfo(t, 'math', {}); - e = (i && i.value) || t.slice(1); - } else e = t; - return e; - } - function Ii(t) { - if (!t) return null; - const e = qi(Ki(t)), - i = [Di(e), zi(e)]; - return i[0] <= 0 ? null : i; - } - function Pi(t) { - return null !== Ii(t); - } - const Oi = { - '\\lfloor\\rfloor': 'floor', - '\\lceil\\rceil': 'ceil', - '\\vert\\vert': 'abs', - '\\lvert\\rvert': 'abs', - '||': 'abs', - '\\Vert\\Vert': 'norm', - '\\lVert\\rVert': 'norm', - '\\ulcorner\\urcorner': 'ucorner', - '\\llcorner\\lrcorner': 'lcorner', - '\\langle\\rangle': 'angle', - '\\lgroup\\rgroup': 'group', - '\\lmoustache\\rmoustache': 'moustache', - '\\lbrace\\rbrace': 'brace', - }, - Bi = { - '!': 'factorial', - '\\dag': 'dagger', - '\\dagger': 'dagger', - '\\ddagger': 'dagger2', - '\\maltese': 'maltese', - '\\backprime': 'backprime', - '\\backdoubleprime': 'backprime2', - '\\prime': 'prime', - '\\doubleprime': 'prime2', - '\\$': '$', - '\\%': '%', - '\\_': '_', - '\\degree': 'degree', - }, - $i = { - '+': 'add', - '-': 'add', - '*': 'multiply', - '=': 'equal', - ',': 'list', - ';': 'list2', - and: 'and', - or: 'or', - xor: 'xor', - union: 'union', - shortLogicalEquivalent: 'logicalEquivalent', - logicalEquivalent: 'logicalEquivalent', - shortEquivalent: 'equivalent', - equivalent: 'equivalent', - }, - Ri = { ',': 'list', ';': 'list2' }; - function Ki(t) { - if ('string' == typeof t) return t; - if (Array.isArray(t)) { - let e = ''; - for (const i of t) e += Ki(i); - return e; - } - if ( - t.latex && - !/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex) - ) - return t.latex.trim(); - if ('leftright' === t.type) return ''; - if ('string' == typeof t.body) return t.body; - if (Array.isArray(t.body)) { - let e = ''; - for (const i of t.body) e += Ki(i); - return e; - } - return ''; - } - function Ni(t) { - return 'string' == typeof t.sym - ? (function(t) { - let e = Ti[t]; - if (e) - return e - .replace('%1', '') - .replace('%0', '') - .replace('%', ''); - if (t.length > 1) { - const i = At.getInfo('\\' + t, 'math'); - !i || - (i.fontFamily && - 'cmr' !== i.fontFamily && - 'ams' !== i.fontFamily) || - (e = '\\' + t); - } - return e || (e = At.unicodeStringToLatex('math', t)), e; - })(t.sym) || t.sym - : ''; - } - function Wi(t) { - return parseFloat(t.num); - } - function Hi(t) { - return 'object' == typeof t && void 0 !== t.num; - } - function Vi(t) { - let e = 0; - return ( - Hi(t) && - (e = - 'object' == typeof t.num - ? void 0 !== t.num.re - ? hs(t.num.re) - : 0 - : parseFloat(t.num)), - e - ); - } - function Ui(t) { - let e = 0; - return ( - Hi(t) && - 'object' == typeof t.num && - (e = void 0 !== t.num.im ? hs(t.num.im) : 0), - e - ); - } - function ji(t) { - return t && void 0 !== t.sup; - } - function Gi(t) { - return t && void 0 !== t.sub; - } - function Zi(t, e, i) { - let s = !1; - const a = t.atoms[t.index]; - return a && a.type === e && (s = void 0 === i || Ki(a) === i), s; - } - function Xi(t, ...e) { - const i = { fn: t }; - if (e) { - const t = []; - for (const i of e) i && t.push(i); - t.length > 0 && (i.arg = t); - } - return i; - } - function Ji(t) { - return 'number' == typeof t - ? { num: t.toString() } - : 'string' == typeof t - ? { num: t } - : 'object' == typeof t - ? { num: t } - : void 0; - } - function Yi(t) { - if (Hi(t)) { - const e = Vi(t), - i = Ui(t); - return ( - 0 !== i - ? (0 !== e && (t.num.re = (-e).toString()), - (t.num.im = (-i).toString())) - : (t.num = (-e).toString()), - t - ); - } - return Xi('negate', t); - } - function Qi(t) { - const e = t.atoms[t.index + 1]; - return e && 'msubsup' === e.type; - } - function ts(t, e) { - let i = t.atoms[t.index]; - return ( - !i || (void 0 === i.superscript && void 0 === i.subscript) - ? (i = null) - : (t.index += 1), - i || - ((i = t.atoms[t.index + 1]), - i && 'msubsup' === i.type && (i.superscript || i.subscript) - ? (t.index += 2) - : (i = null)), - i - ? (void 0 !== i.subscript && - (t.ast.sub = rs(i.subscript, e)), - void 0 !== i.superscript && - ('msubsup' === i.type - ? /['\u2032]|\\prime/.test(Ki(i.superscript)) - ? ((t.index += 1), - (i = t.atoms[t.index + 1]), - i && - 'msubsup' === i.type && - /['\u2032]|\\prime/.test(Ki(i.superscript)) - ? (t.ast.sup = { sym: '″' }) - : ((t.ast.sup = { sym: '′' }), - (t.index -= 1))) - : /['\u2033]|\\doubleprime/.test( - Ki(i.superscript) - ) - ? (t.ast.sup = { sym: '″' }) - : t.ast && (t.ast.sup = rs(i.superscript, e)) - : (t.ast.sup = rs(i.superscript, e)))) - : (t.index += 1), - t - ); - } - function es(t, e) { - const i = t.ast; - if (ss(t, '!!')) - return ( - (t.index += 1), - (t.ast = Xi('factorial2', i)), - es((t = ts(t, e)), e) - ); - if (ss(t, '++')) - return ( - (t.index += 1), - (t.ast = Xi('increment', i)), - es((t = ts(t, e)), e) - ); - if (ss(t, '--')) - return ( - (t.index += 1), - (t.ast = Xi('decrement', i)), - es((t = ts(t, e)), e) - ); - const s = t.atoms[t.index]; - return ( - s && - s.latex && - Bi[s.latex.trim()] && - ((t.ast = Xi(Bi[s.latex.trim()], i)), - (t = es((t = ts(t, e)), e))), - t - ); - } - function is(t, e, i, s) { - if ( - ((t.index = t.index || 0), - 0 === t.atoms.length || t.index >= t.atoms.length) - ) - return (t.ast = void 0), t; - const a = t.minPrec; - t.minPrec = 0; - let o = t.atoms[t.index]; - if (e) { - if ('mopen' === o.type && Ki(o) === e) - (t.index += 1), - (o = (t = os(t, s)).atoms[t.index]), - o && - 'mclose' === o.type && - Ki(o) === i && - (Qi(t) && (t.ast = { group: t.ast }), - (t = es((t = ts(t, s)), s))); - else if ('textord' === o.type && Ki(o) === e) - (t.index += 1), - (o = (t = os(t, s)).atoms[t.index]), - o && - 'textord' === o.type && - Ki(o) === i && - ((t.index += 1), (t = es((t = ts(t, s)), s))); - else if ( - '\\lVert' === e && - 'textord' === o.type && - '|' === o.latex - ) { - if ( - ((o = t.atoms[t.index + 1]), - o && 'textord' === o.type && '|' === o.latex) - ) { - (t.index += 2), (o = (t = os(t, s)).atoms[t.index]); - const e = t.atoms[t.index + 1]; - o && - 'textord' === o.type && - '|' === o.latex && - e && - 'textord' === e.type && - '|' === e.latex && - ((t.index += 2), (t = es((t = ts(t, s)), s))); - } - } else if ('sizeddelim' === o.type && o.delim === e) - (t.index += 1), - (o = (t = os(t, s)).atoms[t.index]), - o && - 'sizeddelim' === o.type && - o.delim === i && - ((t.index += 1), (t = es((t = ts(t, s)), s))); - else { - if ( - 'leftright' !== o.type || - o.leftDelim !== e || - ('?' !== o.rightDelim && o.rightDelim !== i) - ) - return; - (t.ast = rs(o.body, s)), - Qi(t) && (t.ast = { group: t.ast }), - (t = es((t = ts(t, s)), s)); - } - return (t.minPrec = a), t; - } - { - let s = !0; - if ( - ('mopen' === o.type - ? ((e = o.latex.trim()), (i = At.RIGHT_DELIM[e])) - : 'sizeddelim' === o.type - ? ((e = o.delim), (i = At.RIGHT_DELIM[e])) - : 'leftright' === o.type - ? ((s = !1), - (e = o.leftDelim), - '?' === (i = o.rightDelim) && (i = At.RIGHT_DELIM[e])) - : 'textord' === o.type && - ((e = o.latex.trim()), (i = At.RIGHT_DELIM[e])), - e && i) - ) { - if ('|' === e && '|' === i) { - const s = t.atoms[t.index + 1]; - s && - 'textord' === s.type && - '|' === s.latex && - ((e = '\\lVert'), (i = '\\rVert')); - } - if ((t = is(t, e, i))) - return ( - s && (t.index += 1), - (t.ast = { fn: Oi[e + i] || e + i, arg: [t.ast] }), - (t.minPrec = a), - t - ); - } - } - } - function ss(t, e) { - return ( - (t.index = t.index || 0), - !(t.atoms.length <= 1 || t.index >= t.atoms.length - 1) && - e === Ki(t.atoms[t.index]) + Ki(t.atoms[t.index + 1]) - ); - } - function as(t) { - if ( - ((t.index = t.index || 0), - !(t.atoms.length <= 1 || t.index >= t.atoms.length - 1)) - ) { - if (!Zi(t, 'textord', '\\nabla')) { - const e = - t.atoms[t.index].latex + t.atoms[t.index + 1].latex, - i = /^(>=|<=|>>|<<|:=|!=)$/.test(e) ? e : ''; - return i && (t.index += 1), i; - } - return ( - (t.index += 1), - Zi(t, 'mbin', '\\times') - ? ((t.index += 1), (t.ast = 'curl'), t) - : Zi(t, 'mbin', '\\cdot') - ? ((t.index += 1), (t.ast = 'div'), t) - : void (t.index -= 1) - ); - } - } - function os(t, e) { - if ( - ((t.index = t.index || 0), - (t.ast = void 0), - 0 === t.atoms.length || t.index >= t.atoms.length) - ) - return t; - t.minPrec = t.minPrec || 0; - let i = (function t(e, i) { - if ( - ((e.index = e.index || 0), - (e.ast = void 0), - 0 === e.atoms.length || e.index >= e.atoms.length) - ) - return e; - let s = e.atoms[e.index]; - if ('text' === s.mode) { - let t = ''; - for ( - ; - e.atoms[e.index] && - 'text' === e.atoms[e.index].mode; - - ) - (t += e.atoms[e.index].body), (e.index += 1); - return (e.ast = { text: t }), e; - } - const a = qi(Ki(s)); - if (as(e)) e.ast = Xi(e.ast, t(e, i).ast); - else { - if ('root' === s.type) - return (e.index = 0), (e.atoms = s.body), t(e, i); - if ('mbin' === s.type && '-' === a) - (e.index += 1), ((e = t(e, i)).ast = Yi(e.ast)); - else if ('mbin' === s.type && '+' === a) - (e.index += 1), - ((e = t(e, i)).ast = Xi('add', e.ast)); - else if ( - 'mord' === s.type && - /^[0-9.]$/.test(s.latex) - ) { - let a = '', - o = !1, - n = /^[0-9.eEdD]$/; - for ( - ; - e.index < e.atoms.length && - !o && - (Zi(e, 'spacing') || - ((Zi(e, 'mord') || - Zi(e, 'mpunct', ',') || - Zi(e, 'mbin')) && - n.test(e.atoms[e.index].latex))); - - ) - if ('spacing' === e.atoms[e.index].type) - e.index += 1; - else if ( - void 0 !== e.atoms[e.index].superscript || - void 0 !== e.atoms[e.index].subscript - ) - o = !0; - else { - let t = e.atoms[e.index].latex; - 'd' === t || 'D' === t - ? ((t = 'e'), (n = /^[0-9+-.]$/)) - : 'e' === t || 'E' === t - ? Qi(e) - ? ((t = ''), - (e.index -= 1), - (o = !0)) - : ((t = 'E'), (n = /^[0-9+-.]$/)) - : n === /^[0-9+-.]$/ && (n = /^[0-9]$/), - (a += ',' === t ? '' : t), - (e.index += 1); - } - if ( - ((e.ast = a ? Ji(a) : void 0), - (s = e.atoms[e.index]), - s && 'genfrac' === s.type && !isNaN(e.ast.num)) - ) { - const s = e.ast; - (e = t(e, i)).ast = Xi('add', s, e.ast); - } - if ( - s && - 'group' === s.type && - s.latex && - s.latex.startsWith('\\nicefrac') - ) { - const s = e.ast; - (e = t(e, i)).ast = Xi('add', s, e.ast); - } - s && 'msubsup' === s.type && (e = ts(e, i)), - (e = es(e, i)); - } else if ('genfrac' === s.type || 'surd' === s.type) - (e.ast = s.toAST(i)), (e = es((e = ts(e, i)), i)); - else if ('mord' === s.type || 'mbin' === s.type) { - if (Ei(a) && !Pi(s)) { - e.ast = { fn: a }; - const s = (e = ts(e, i)).ast, - o = t(e, i).ast; - o && /^(list0|list|list2)$/.test(o.fn) - ? (s.arg = o.arg) - : o && (s.arg = [o]), - (e.ast = s); - } else - (e.ast = s.toAST(i)), - 'ⅈ' === e.ast.sym && - (e.ast = Ji({ im: '1' })), - (e = ts(e)); - e = es(e, i); - } else if ('textord' === s.type) { - if ( - !Pi(s) && - !At.RIGHT_DELIM[ - s.latex ? s.latex.trim() : s.body - ] - ) - if (Ei(a)) { - e.ast = { fn: a }; - const s = (e = ts(e, i)).ast; - (e.index += 1), - (s.arg = [t(e, i).ast]), - (e.ast = s), - (e = es(e, i)); - } else - (e.ast = s.toAST(i)), - void 0 === s.superscript && - (e.index += 1), - (e = es((e = ts(e, i)), i)); - } else if ('mop' === s.type) { - if ( - (/^\\(mathop|operatorname|operatorname\*)/.test( - s.latex - ) || - Ei(a)) && - !Pi(s) - ) - if ( - ((e.ast = { - fn: /^\\(mathop|operatorname|operatorname\*)/.test( - s.latex - ) - ? Ki(s.body) - : a, - }), - ji((e = ts(e, i)).ast)) - ) { - const s = { - sin: 'arcsin', - cos: 'arccos', - tan: 'arctan', - cot: 'arccot', - sec: 'arcsec', - csc: 'arccsc', - sinh: 'arsinh', - cosh: 'arcosh', - tanh: 'artanh', - csch: 'arcsch', - sech: 'arsech', - coth: 'arcoth', - }; - if (-1 === Wi(e.ast.sup) && s[a]) - e.ast = Xi(s[a], t(e, i).ast); - else { - const s = e.ast; - (s.arg = [t(e, i).ast]), (e.ast = s); - } - } else { - const s = e.ast, - a = t(e, i).ast; - a && /^(list0|list|list2)$/.test(a.fn) - ? (s.arg = a.arg) - : a && (s.arg = [a]), - (e.ast = s); - } - } else if ('array' === s.type) - (e.index += 1), (e.ast = s.toAST(i)); - else if ('group' === s.type) - (e.index += 1), (e.ast = s.toAST(i)); - else { - if ('mclose' === s.type) return e; - if ('error' === s.type) - return ( - (e.index += 1), - (e.ast = { error: s.latex }), - e - ); - } - } - if (void 0 === e.ast) { - const t = is(e, '(', ')', i) || is(e, null, null, i); - t - ? (e = t) - : Pi(s) || - ('placeholder' === s.type - ? (e.ast = Ji(0)) - : ((e.ast = { text: '?' }), - (e.ast.error = - "Unexpected token '" + s.type + "'"), - s.latex - ? (e.ast.latex = s.latex) - : s.body && - s.toLatex && - (e.ast.latex = s.toLatex())), - (e.index += 1)); - } - if ( - ((s = e.atoms[e.index]), - s && - ('mord' === s.type || - 'surd' === s.type || - 'mop' === s.type || - 'mopen' === s.type || - 'sizeddelim' === s.type || - 'leftright' === s.type)) - ) { - if ('sizeddelim' === s.type) - for (const t in At.RIGHT_DELIM) - if (s.delim === At.RIGHT_DELIM[t]) - return (e.index += 1), e; - if ( - ('mord' === s.type || - 'textord' === s.type || - 'mop' === s.type) && - Pi(s) - ) - return e; - const a = e.ast; - (e.ast = {}), - (e = t(e, i)) && e.ast && a - ? (Ei(a.fn) && void 0 === a.arg) || - (Array.isArray(a.arg) && 0 === a.arg.length) - ? 'list2' === e.ast.fn || - 'list' === e.ast.fn - ? (e.ast = Xi(a.fn, e.ast.arg)) - : (e.ast = Xi('multiply', a, e.ast)) - : 'multiply' === e.ast.fn - ? e.ast.arg.unshift(a) - : 0 === Ui(a) && - 0 !== Vi(a) && - 1 === Ui(e.ast) && - 0 === Vi(e.ast) - ? (e.ast = Ji({ im: Vi(a).toString() })) - : (e.ast = Xi('multiply', a, e.ast)) - : (e.ast = a); - } - return e; - })(t, e).ast, - s = !1; - const a = t.minPrec; - for (; !s; ) { - const o = t.atoms[t.index], - n = as(t); - let r, l; - if ( - ((s = !o || 'text' === o.mode || (!n && !Pi(o))), - s || (([r, l] = n ? [Di(n), zi(n)] : Ii(o)), (s = r < a)), - !s) - ) { - const a = n || qi(Ki(o)); - if ( - ((t.minPrec = 'left' === l ? r + 1 : r), - (t.index += 1), - '|' === a) - ) - if ( - void 0 !== o.subscript || - (t.atoms[t.index] && - void 0 !== t.atoms[t.index].subscript && - 'msubsup' === t.atoms[t.index].type) - ) { - t.ast = {}; - const s = ts(t, e).ast.sub; - if ( - ((i = Xi('bind', i)), - s && 'equal' === s.fn && i.arg) - ) - i.arg.push(Fi(s, 0)), i.arg.push(Fi(s, 1)); - else if ( - s && - i.arg && - ('list' === s.fn || 'list2' === s.fn) - ) { - let t = { sym: 'x' }; - for (let e = 0; e < s.arg.length; e++) - 'equal' === s.arg[e].fn - ? ((t = Fi(s.arg[e], 0)), - i.arg.push(t), - i.arg.push(Fi(s.arg[e], 1))) - : (i.arg.push(t), i.arg.push(s.arg[e])); - } else - s && (i.arg.push({ sym: 'x' }), i.arg.push(s)); - } else s = !0; - else { - const s = os(t, e).ast; - let o = Ri[a]; - o && i && i.fn !== o && (i = Xi(o, i)), - '-' === a - ? i && i.arg && 'add' === i.fn - ? void 0 !== s && i.arg.push(Yi(s)) - : (i = - i && 'subtract' === i.fn - ? Xi( - 'add', - Fi(i, 0), - Yi(Fi(i, 1)), - Yi(s) - ) - : !Hi(i) || - ji(i) || - !Hi(s) || - ji(s) || - (void 0 !== s.num.re && - '0' !== s.num.re) || - void 0 === s.num.im - ? Xi('subtract', i, s) - : { - num: { - re: i.num, - im: (-parseFloat( - s.num.im - )).toString(), - }, - }) - : ((o = $i[a]), - 'add' === o && i && 'subtract' === i.fn - ? (i = Xi( - 'add', - Fi(i, 0), - Yi(Fi(i, 1)), - s - )) - : o && i && i.fn === o && !ji(i) - ? void 0 !== s && - (s.fn === o && !ji(s) && s.arg - ? (i.arg = [...i.arg, ...s.arg]) - : i.arg && i.arg.push(s)) - : o && s && s.arg && s.fn === o - ? (s.arg.unshift(i), (i = s)) - : (i = - 'multiply' === o && - Hi(i) && - !ji(i) && - s && - 10 === Wi(s) && - Hi(s.sup) - ? Ji( - Wi(i) * - Math.pow( - 10, - Wi(s.sup) - ) - ) - : 'add' === o && - Hi(i) && - !ji(i) && - s && - 0 !== Ui(s) && - !ji(s) - ? { - num: { - re: i.num, - im: s.num.im, - }, - } - : Xi(o || _i[a] || a, i, s))); - } - } - } - return (t.ast = i), t; - } - function ns(t) { - if (!t) return []; - let e; - if (Array.isArray(t)) { - e = []; - for (const i of t) { - const t = ns(i); - e = e.concat(t); - } - } else { - if ('spacing' === t.type) return []; - 'first' === t.type || 'box' === t.type - ? (e = ns(t.body)) - : (t.body && Array.isArray(t.body) && (t.body = ns(t.body)), - t.superscript && - Array.isArray(t.superscript) && - (t.superscript = ns(t.superscript)), - t.subscript && - Array.isArray(t.subscript) && - (t.subscript = ns(t.subscript)), - t.index && - Array.isArray(t.index) && - (t.index = ns(t.index)), - t.denom && - Array.isArray(t.denom) && - (t.denom = ns(t.denom)), - t.numer && - Array.isArray(t.numer) && - (t.numer = ns(t.numer)), - t.array && - Array.isArray(t.array) && - (t.array = t.array.map(t => t.map(t => ns(t)))), - (e = [t])); - } - return e; - } - function rs(t, e) { - return (function(t, e) { - (t.index = t.index || 0), (t.ast = void 0); - const i = []; - for (; t.atoms[t.index]; ) - if ('text' === t.atoms[t.index].mode) { - let e = ''; - for ( - ; - t.atoms[t.index] && - 'text' === t.atoms[t.index].mode; - - ) - (e += t.atoms[t.index].body), (t.index += 1); - i.push(e); - } else { - const s = os(t, e).ast; - if (!s) return; - i.push(s); - } - return i.length > 1 ? Xi('text', ...i) : i[0] || void 0; - })({ atoms: ns(t) }, e); - } - function ls(t) { - const e = Array.prototype.slice.call(arguments); - e.shift(), (t = t || '.. '); - let i = ''; - if (e.length > 0) { - '.' !== t[0] && (i += t[0]); - let s = ''; - for (const a of e) (i += s + a), (s = t[2]); - '.' !== t[1] && (i += t[1]); - } - return i; - } - function cs(t, e) { - const i = t.length; - t = t.substr(0, e.precision - 2); - for (let i = 0; i < t.length - 16; i++) { - const s = t.substr(0, i); - for (let a = 0; a < 17; a++) { - const o = t.substr(i, a + 1), - n = Math.floor((t.length - s.length) / o.length); - if (n > 1 && (s + o.repeat(n + 1)).startsWith(t)) - return '0' === o - ? s.replace(/(\d{3})/g, '$1' + e.groupSeparator) - : s.replace(/(\d{3})/g, '$1' + e.groupSeparator) + - e.beginRepeatingDigits + - o.replace( - /(\d{3})/g, - '$1' + e.groupSeparator - ) + - e.endRepeatingDigits; - } - } - return ( - i !== t.length && (t += '\\ldots'), - t.replace(/(\d{3})/g, '$1' + e.groupSeparator) - ); - } - function hs(t) { - return parseFloat(parseFloat(t).toPrecision(15)); - } - function ds(t, e) { - let i = ''; - if ('number' == typeof e.precision) { - if ('number' != typeof t) { - let i = '', - s = ''; - if ( - ('-' === t[0] - ? ((i = '-'), (t = t.substr(1))) - : '+' === t[0] && (t = t.substr(1)), - t.indexOf('.') >= 0) - ) { - const a = t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/), - o = a[1], - n = a[2].substring( - 0, - Math.min(e.precision - o.length, a[2].length) - ); - if (((s = a[4] || ''), '0' === o)) { - let s = 0; - for (; '0' === n[s] && s < n.length; ) s += 1; - let a = ''; - if (s <= 4) - (a = '0' + e.decimalMarker), - (a += n.substr(0, s)), - (a += cs(t.substr(a.length), e)); - else if (s + 1 >= e.precision) (a = '0'), (i = ''); - else { - a = t[s]; - const i = cs(t.substr(s + 1), e); - i && (a += e.decimalMarker + i); - } - '0' !== a && - (t.length - 1 > e.precision && - !a.endsWith('}') && - !a.endsWith('\\ldots') && - (a += '\\ldots'), - s > 4 && - ((a += e.exponentProduct), - e.exponentMarker - ? (a += - e.exponentMarker + - (1 - s).toString()) - : (a += - '10^{' + - (1 - s).toString() + - '}'))), - (t = a); - } else { - t = o.replace( - /\B(?=(\d{3})+(?!\d))/g, - e.groupSeparator - ); - const i = cs(n, e); - i && (t += e.decimalMarker + i); - } - } else if (t.length > e.precision) { - const i = t.length; - let s = t[0]; - const a = cs(t.substr(2), e); - a && - ((s += e.decimalMarker + a), - '}' !== s[s.length - 1] && (s += '\\ldots')), - '1' !== s ? (s += e.exponentProduct) : (s = ''), - e.exponentMarker - ? (s += e.exponentMarker + (i - 2).toString()) - : (s += '10^{' + (i - 2).toString() + '}'), - (t = s); - } else - t = t.replace( - /\B(?=(\d{3})+(?!\d))/g, - e.groupSeparator - ); - return ( - s && - (s = e.exponentMarker - ? e.exponentMarker + s - : e.exponentProduct + ' 10^{' + s + '}'), - i + t + s - ); - } - t = hs(t); - } - if ('engineering' === e.scientificNotation) - if (0 === t) i = '0'; - else { - const s = Math.abs(t); - let a = Math.round(Math.log10(s)); - (a -= a % 3), s < 1e3 && (a = 0); - let o = s / Math.pow(10, a); - const n = o.toString().match(/^(.*)\.(.*)$/); - n && n[1] && n[2] && (o = n[1] + e.decimalMarker + n[2]), - e.groupSeparator && (o = cs(o.toExponential(), e)), - (a = - 0 === a - ? '' - : e.exponentMarker - ? e.exponentMarker + a - : e.exponentProduct + ' 10^{' + a + '}'), - (i = (t < 0 ? '-' : '') + o + a); - } - else { - const s = 'string' == typeof t ? t : t.toString(); - let a, - o, - n, - r = s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i); - (a = s), - (n = ''), - r && - r[1] && - r[2] && - ((a = r[1]), - (o = e.exponentMarker - ? e.exponentMarker + r[2] - : e.exponentProduct + ' 10^{' + r[2] + '}')), - (r = a.match(/^(.*)\.(.*)$/)), - r && r[1] && r[2] && ((a = r[1]), (n = r[2])), - e.groupSeparator && - ((a = a.replace( - /\B(?=(\d{3})+(?!\d))/g, - e.groupSeparator - )), - (n = cs(n, e))), - n && (n = e.decimalMarker + n), - (i = a + n + (o || '')); - } - return i; - } - (te.MathAtom.prototype.toAST = function(t) { - let e, - i, - s, - a, - o = {}, - r = '', - l = { - bb: 'double-struck', - cal: 'script', - scr: 'script', - frak: 'fraktur', - cmrss: 'sans-serif', - cmrtt: 'monospace', - }[this.baseFontFamily || this.fontFamily], - c = ''; - 'b' === this.fontSeries && (c += 'bold'), - 'it' === this.fontShape && (c += 'italic'); - const h = this.latex ? this.latex.trim() : null; - switch (this.type) { - case 'root': - case 'group': - this.latex && this.latex.startsWith('\\nicefrac') - ? ((e = this.latex - .slice(9) - .match(/({.*}|[^}])({.*}|[^}])/)), - e - ? ((i = - 1 === e[1].length - ? e[1] - : e[1].substr(1, e[1].length - 2)), - (i = he.parseTokens( - n(i), - 'math', - null, - t.macros - )), - (s = - 1 === e[2].length - ? e[2] - : e[2].substr(1, e[2].length - 2)), - (s = he.parseTokens( - n(s), - 'math', - null, - t.macros - )), - (o = Xi('divide', rs(i, t), rs(s, t)))) - : (o.fn = 'divide')) - : (o.group = rs(this.body, t)); - break; - case 'genfrac': - o = Xi( - 'divide', - rs(this.numer, t), - this.denom && - this.denom[0] && - 'placeholder' === this.denom[0].type - ? Ji(1) - : rs(this.denom, t) - ); - break; - case 'surd': - o = this.index - ? Xi( - 'pow', - rs(this.body, t), - Xi('divide', Ji(1), rs(this.index, t)) - ) - : Xi('sqrt', rs(this.body, t)); - break; - case 'rule': - break; - case 'line': - case 'overlap': - case 'accent': - case 'overunder': - break; - case 'mord': - case 'textord': - case 'mbin': - (e = h - ? h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/) - : void 0), - e - ? (r = String.fromCodePoint(parseInt(e[1], 16))) - : ((r = qi(Ki(this))), - r.length > 0 && - '\\' === r.charAt(0) && - 'string' == typeof this.body && - (r = this.body)), - (a = At.mathVariantToUnicode(r, l, c) - .replace(/[\\]/g, '\\\\') - .replace(/["]/g, '\\"') - .replace(/[\b]/g, '\\b') - .replace(/[\f]/g, '\\f') - .replace(/[\n]/g, '\\n') - .replace(/[\r]/g, '\\r') - .replace(/[\t]/g, '\\t')), - a !== r - ? ((o = { sym: a }), (l = 'normal')) - : (o = { sym: r }); - break; - case 'minner': - case 'mop': - break; - case 'box': - o = rs(this.body, t); - break; - case 'enclose': - break; - case 'array': - if ('cardinality' === this.env.name) - o = Xi('card', rs(this.array, t)); - else if ( - /array|matrix|pmatrix|bmatrix/.test(this.env.name) - ) { - o = { fn: 'array', args: [] }; - for (const e of this.array) - o.args.push(e.map(e => rs(e, t))); - } else if ('cases' === this.env.name) { - o = { fn: 'cases', args: [] }; - for (const e of this.array) - if (e[0]) { - const i = []; - i.push(rs(e[0], t)); - let s = rs(e[1], t); - s && - 'text' === s.fn && - s.arg && - /^(if|when|for)$/i.test(s.arg[0].trim()) && - (s = s.arg.filter( - t => 'string' != typeof t - )), - i.push(s || {}), - o.args.push(i); - } - } - break; - case 'spacing': - case 'space': - case 'mathstyle': - break; - default: - o = void 0; - } - return ( - o && l && 'normal' !== l && (o.variant = l), - o && - 'string' == typeof this.cssClass && - (o.class = this.cssClass), - o && 'string' == typeof this.cssId && (o.id = this.cssId), - o - ); - }), - (te.toAST = function(t, e) { - return rs(t, e); - }); - var ps = function t(e, i) { - const s = Object.assign( - { - precision: 14, - decimalMarker: '.', - groupSeparator: '\\, ', - product: '\\cdot ', - exponentProduct: '\\cdot ', - exponentMarker: '', - arcSeparator: '\\,', - scientificNotation: 'auto', - beginRepeatingDigits: '\\overline{', - endRepeatingDigits: '}', - }, - i - ); - let a = ''; - if (void 0 === e) return ''; - if (('string' == typeof e && (e = JSON.parse(e)), e.latex)) - a = e.latex; - else if (Hi(e)) { - const i = Wi(e); - if (i === -1 / 0) a = '-\\infty '; - else if (i === 1 / 0) a = '\\infty '; - else if ( - 'object' != typeof e.num || - ('string' != typeof e.num.re && 'string' != typeof e.num.im) - ) - a = isNaN(i) ? '\\text{NaN}' : ds(e.num, s); - else { - const t = Vi(e), - i = Ui(e); - isNaN(t) || isNaN(i) - ? (a = '\\text{NaN}') - : Math.abs(i) <= Number.EPSILON && - Math.abs(t) <= Number.EPSILON - ? (a = '0') - : (Math.abs(t) > Number.EPSILON && (a = ds(t, s)), - Math.abs(i) > Number.EPSILON && - (Math.abs(t) > Number.EPSILON && - (a += i > 0 ? '+' : ''), - (a += - (1 !== Math.abs(i) ? ds(i, s) : '') + - '\\imaginaryI '))); - } - ji(e) && (a += '^{' + t(e.sup, s) + '}'), - Gi(e) && (a += '_{' + t(e.sub, s) + '}'); - } else if (e.group) - (a = t(e.group, s)), - Hi(e.group) || Ni(e.group) - ? 0 !== Ui(e.group) && (a = ls(e.fence || '(),', a)) - : (a = ls(e.fence || '(),', a)), - ji(e) && (a += '^{' + t(e.sup, s) + '}'), - Gi(e) && (a += '_{' + t(e.sub, s) + '}'); - else if (e.fn) - if ('bind' === e.fn) { - if ( - ((a = t(Fi(e, 0), s) + '|_{'), - e.arg && 2 === e.arg.length) - ) - a += t(Fi(e, 1)); - else { - let i = ''; - for (let s = 1; s < e.arg.length; s += 2) - (a += i + t(Fi(e, s)) + ' = ' + t(Fi(e, s + 1))), - (i = ', '); - } - a += '}'; - } else if ('divide' === e.fn) - a = - '\\frac{' + - t(Fi(e, 0), s) + - '}{' + - t(Fi(e, 1), s) + - '}'; - else if ('negate' === e.fn) a = '-' + t(Fi(e, 0), s); - else if ('subtract' === e.fn) - a = t(Fi(e, 0), s) + ' - ' + t(Fi(e, 1), s); - else if ( - ('add' !== e.fn && 'multiply' !== e.fn) || - !Array.isArray(e.arg) - ) - if ('list' === e.fn || 'list2' === e.fn) { - const i = []; - for (const a of e.arg) i.push(t(a, s)); - a = i.join('list2' === e.fn ? '; ' : ', '); - } else if ( - 'pow' === e.fn && - Array.isArray(e.arg) && - e.arg.length >= 2 - ) - (a = t(Fi(e, 0), s)), - Hi(Fi(e, 0)) || - Ni(Fi(e, 0)) || - (a = ls(e.fence || '(),', a)), - (a += '^{' + t(Fi(e, 1), s) + '}'); - else if ('equal' === e.fn && e.arg && e.arg.length > 2) - a = e.arg.map(e => t(e, s)).join(' = '); - else { - const i = (function(t) { - let e = Ti[t]; - return ( - e || - (e = - t.length > 1 - ? '\\operatorname{' + t + '}%^%_ %' - : t + '%^%_ %'), - e - ); - })(e.fn); - a = i; - let o = ''; - if ( - /%(?![01_^])/.test(i) && - Array.isArray(e.arg) && - e.arg.length > 1 - ) - a += ls( - e.fence || '(),', - ...e.arg.map(e => t(e, s)) - ); - else if (Array.isArray(e.arg) && e.arg.length > 0) { - const n = t(Fi(e, 0), s), - r = t(Fi(e, 1), s), - l = [...e.arg]; - /%0/.test(i) && - ((a = a.replace('%0', n)), l.shift()), - /%1/.test(i) && - ((a = a.replace('%1', r)), l.shift()), - l.length > 0 && - (o = ls( - e.fence || '(),', - ...l.map(e => t(e, s)) - )); - } else o = ls(e.fence || '(),', ''); - (a = ji(e) - ? a.replace('%^', '^{' + t(e.sup, s) + '}') - : a.replace('%^', '')), - (a = Gi(e) - ? a.replace('%_', '_{' + t(e.sub, s) + '}') - : a.replace('%_', '')), - (a = a.replace(/%(?![01_^])/, o)), - (a = a.replace('%0', '').replace('%1', '')); - } - else { - const i = []; - for (const a of e.arg) - 'add' === a.fn || 'subtract' === a.fn - ? i.push(ls('() ', t(a, s))) - : 0 !== Vi((o = a)) && 0 !== Ui(o) - ? i.push(ls('() ', t(a, s))) - : ji(e) && 0 !== Ui(a) && 1 !== Ui(a) - ? i.push(ls('() ', t(a, s))) - : i.push(t(a, s)); - if ('multiply' === e.fn) - a = - !e.arg || - 2 !== e.arg.length || - (!Hi(e.arg[0]) && 'divide' !== e.arg[0].fn) || - (Hi(e.arg[1]) && - (0 !== Vi(e.arg[1]) || 1 !== Ui(e.arg[1]))) - ? i.join(' \\times ') - : i[0] + i[1]; - else if (e.arg && 1 === e.arg.length) - a = - 'negate' === e.arg[0].fn || - (Hi(e.arg[0]) && Wi(e.arg[0]) < 0) - ? i[0] - : '+' + i[0]; - else { - a = i[0]; - for (let t = 1; t < e.arg.length; t++) - 'negate' === e.arg[t].fn || - (Hi(e.arg[t]) && Wi(e.arg[t]) < 0) - ? (a += i[t]) - : (a += ' + ' + i[t]); - } - } - else if ('string' == typeof e.sym) { - a = Ni(e); - let i = a.match(/^&#x([0-9a-f]+);$/i); - i && i[1] - ? (a = String.fromCodePoint(parseInt(i[1], 16))) - : ((i = a.match(/^&#([0-9]+);$/i)), - i && i[1] && (a = String.fromCodePoint(parseInt(i[1])))), - 'string' == typeof e.variant && - (a = - '\\' + - { - normal: 'mathrm', - 'double-struck': 'mathbb', - bold: 'mathbf', - fraktur: 'mathfrak', - script: 'mathscr', - 'sans-serif': 'mathsf', - monospace: 'mathtt', - }[e.variant] + - '{' + - a + - '}'), - ji(e) && (a += '^{' + t(e.sup, s) + '}'), - Gi(e) && (a += '_{' + t(e.sub, s) + '}'); - } else 'string' == typeof e.text && (a = '\\text{' + e.text + '}'); - var o; - return ( - 'string' == typeof e.error && - (a = '\\bbox[#F56165]{' + a + '}'), - a - ); - }; - const ms = { - '\\alpha': 'alpha ', - '\\mu': 'mew ', - '\\sigma': 'sigma ', - '\\pi': 'pie ', - '\\imaginaryI': 'eye ', - '\\sum': 'Summation ', - '\\prod': 'Product ', - a: 'a', - A: 'capital A', - '+': 'plus ', - '-': 'minus ', - ';': ' semi-colon ', - ',': ' comma ', - '|': 'Vertical bar', - '(': 'Open paren. ', - ')': ' Close paren. ', - '=': 'equals ', - '<': 'is less than ', - '\\lt': 'is less than ', - '<=': 'is less than or equal to ', - '\\le': 'is less than or equal to ', - '\\gt': 'is greater than ', - '>': 'is greater than ', - '\\ge': 'is greater than or equal to ', - '\\geq': 'is greater than or equal to ', - '\\leq': 'is less than or equal to ', - '!': 'factorial ', - '\\sin': 'sine ', - '\\cos': 'cosine ', - '​': '', - '−': 'minus ', - ':': ' such that ', - '\\colon': ' such that ', - '\\hbar': 'etch bar ', - '\\iff': - 'if, and only if, ', - '\\Longleftrightarrow': - 'if, and only if, ', - '\\land': 'and ', - '\\lor': 'or ', - '\\neg': 'not ', - '\\div': 'divided by ', - '\\forall': 'for all ', - '\\exists': 'there exists ', - '\\nexists': 'there does not exists ', - '\\in': 'element of ', - '\\N': - 'the set n', - '\\C': - 'the set c', - '\\Z': - 'the set z', - '\\Q': - 'the set q', - '\\infty': 'infinity ', - '\\nabla': 'nabla ', - '\\partial': 'partial derivative of ', - '\\cdots': 'dot dot dot ', - '\\Rightarrow': 'implies ', - '\\lbrace': 'open brace', - '\\{': 'open brace', - '\\rbrace': 'close brace', - '\\}': 'close brace', - '\\langle': - 'left angle bracket', - '\\rangle': - 'right angle bracket', - '\\lfloor': 'open floor', - '\\rfloor': 'close floor', - '\\lceil': 'open ceiling', - '\\rceil': - 'close ceiling', - '\\vert': 'vertical bar', - '\\mvert': 'divides', - '\\lvert': - 'left vertical bar', - '\\rvert': - 'right vertical bar', - '\\lbrack': - ' open square bracket ', - '\\rbrack': - ' close square bracket ', - mm: 'millimeters', - cm: 'centimeters', - km: 'kilometers', - kg: 'kilograms', - }; - function us(t) { - let e = 0; - if (t && Array.isArray(t)) - for (const i of t) 'first' !== i.type && (e += 1); - return 1 === e; - } - function fs(t) { - let e = ''; - if (t && Array.isArray(t)) - for (const i of t) - 'first' !== i.type && - 'string' == typeof i.body && - (e += i.body); - return e; - } - function gs(t, e, i, s) { - e = e.split(' '); - for (const a of e) { - const e = a.match(/(.*):(.*)/); - if (e) { - const a = s || {}; - 'active' === e[2] ? (a.passive = !1) : (a[e[2]] = !0), - t.addEventListener(e[1], i, a); - } else t.addEventListener(a, i, s); - } - } - function ys(t, e, i, s) { - e = e.split(' '); - for (const a of e) { - const e = a.match(/(.*):(.*)/); - if (e) { - const a = s || {}; - 'active' === e[2] ? (a.passive = !1) : (a[e[2]] = !0), - t.removeEventListener(e[1], i, a); - } else t.removeEventListener(a, i, s); - } - } - function bs(t, e) { - let i = document.getElementById(t); - return ( - i - ? i.setAttribute( - 'data-refcount', - parseInt(i.getAttribute('data-refcount')) + 1 - ) - : ((i = document.createElement('div')), - i.setAttribute('aria-hidden', 'true'), - i.setAttribute('data-refcount', '1'), - (i.className = e), - (i.id = t), - document.body.appendChild(i)), - i - ); - } - function xs(t) { - if (!t) return null; - const e = parseInt(t.getAttribute('data-refcount')); - return ( - e && 1 !== e - ? t.setAttribute('data-refcount', e - 1) - : t.remove(), - t - ); - } - function ks(t) { - return t.element && t.element.mathfield === t; - } - (te.toSpeakableFragment = function(t, e) { - function i(t) { - return '' + t + ''; - } - if (!t) return ''; - let s = ''; - if ( - (t.id && - 'math' === e.speechMode && - (s += ''), - Array.isArray(t)) - ) { - let a = !1, - o = !1; - for (let n = 0; n < t.length; n++) - 'text' !== t[n].mode && (o = !1), - n < t.length - 2 && - 'mopen' === t[n].type && - 'mclose' === t[n + 2].type && - 'mord' === t[n + 1].type - ? ((s += ' of '), - (s += i(te.toSpeakableFragment(t[n + 1], e))), - (n += 2)) - : 'text' === t[n].mode - ? o - ? (s += t[n].body ? t[n].body : ' ') - : ((o = !0), - (s += te.toSpeakableFragment(t[n], e))) - : 'mord' === t[n].type && - /[0123456789,.]/.test(t[n].body) - ? a - ? (s += t[n].body) - : ((a = !0), - (s += te.toSpeakableFragment(t[n], e))) - : ((a = !1), - (s += te.toSpeakableFragment(t[n], e))); - } else if ('text' === t.mode) s += t.body; - else { - let a = '', - o = '', - n = '', - r = !1; - switch (t.type) { - case 'group': - case 'root': - s += te.toSpeakableFragment(t.body, e); - break; - case 'genfrac': - if ( - ((a = te.toSpeakableFragment(t.numer, e)), - (o = te.toSpeakableFragment(t.denom, e)), - us(t.numer) && us(t.denom)) - ) { - const e = { - '1/2': ' half ', - '1/3': ' one third ', - '2/3': ' two third', - '1/4': ' one quarter ', - '3/4': ' three quarter ', - '1/5': ' one fifth ', - '2/5': ' two fifths ', - '3/5': ' three fifths ', - '4/5': ' four fifths ', - '1/6': ' one sixth ', - '5/6': ' five sixths ', - '1/8': ' one eight ', - '3/8': ' three eights ', - '5/8': ' five eights ', - '7/8': ' seven eights ', - '1/9': ' one ninth ', - '2/9': ' two ninths ', - '4/9': ' four ninths ', - '5/9': ' five ninths ', - '7/9': ' seven ninths ', - '8/9': ' eight ninths ', - }[fs(t.numer) + '/' + fs(t.denom)]; - e ? (s = e) : (s += a + ' over ' + o); - } else - s += - ' the fraction ' + - a + - ', over ' + - o + - '. End fraction.'; - break; - case 'surd': - if ( - ((n = te.toSpeakableFragment(t.body, e)), t.index) - ) { - let i = te.toSpeakableFragment(t.index, e); - i = i.trim(); - const a = i.replace(//g, ''); - s += - '3' === a - ? ' the cube root of ' + - n + - '. End cube root' - : 'n' === a - ? ' the nth root of ' + - n + - '. End root' - : ' the root with index: ' + - i + - ', of ' + - n + - '. End root'; - } else - us(t.body) - ? (s += ' the square root of ' + n + ' , ') - : (s += - ' the square root of ' + - n + - '. End square root'); - break; - case 'accent': - break; - case 'leftright': - (s += ms[t.leftDelim] || t.leftDelim), - (s += te.toSpeakableFragment(t.body, e)), - (s += ms[t.rightDelim] || t.rightDelim); - break; - case 'line': - case 'rule': - case 'overunder': - case 'overlap': - break; - case 'placeholder': - s += 'placeholder ' + t.body; - break; - case 'delim': - case 'sizeddelim': - case 'mord': - case 'minner': - case 'mbin': - case 'mrel': - case 'mpunct': - case 'mopen': - case 'mclose': - case 'textord': { - const i = t.latex ? t.latex.trim() : ''; - if ( - '\\mathbin' === i || - '\\mathrel' === i || - '\\mathopen' === i || - '\\mathclose' === i || - '\\mathpunct' === i || - '\\mathord' === i || - '\\mathinner' === i - ) { - s = te.toSpeakableFragment(t.body, e); - break; - } - let a = t.body, - o = t.latex; - if ( - (('delim' !== t.type && 'sizeddelim' !== t.type) || - (a = o = t.delim), - 'text' === e.speechMode) - ) - s += a; - else { - if ( - ('mbin' === t.type && - (s += ''), - a) - ) { - const t = ms[a] || (o ? ms[o.trim()] : ''); - if (t) s += ' ' + t; - else { - const t = o - ? (function(t) { - let e = Je.NOTES[t]; - return ( - e || - '\\' !== t.charAt(0) || - (e = - ' ' + - t.replace('\\', '') + - ' '), - Array.isArray(e) && - (e = e[0]), - e - ); - })(o.trim()) - : ''; - s += - t || - (function(t) { - let i = ''; - return ( - e.textToSpeechMarkup - ? /[a-z]/.test(t) - ? (i += - ' ' + - t + - '') - : /[A-Z]/.test(t) - ? (i += - 'capital ' + - t.toLowerCase()) - : (i += t) - : /[a-z]/.test(t) - ? (i += - " '" + - t.toUpperCase() + - "'") - : /[A-Z]/.test(t) - ? (i += - " 'capital " + - t.toUpperCase() + - "'") - : (i += t), - i - ); - })(a); - } - } else s += te.toSpeakableFragment(t.body, e); - 'mbin' === t.type && (s += ''); - } - break; - } - case 'mop': - if ('​' !== t.body) { - const a = t.latex ? t.latex.trim() : ''; - if ('\\sum' === a) - if (t.superscript && t.subscript) { - let i = te.toSpeakableFragment( - t.superscript, - e - ); - i = i.trim(); - let a = te.toSpeakableFragment( - t.subscript, - e - ); - (a = a.trim()), - (s += - ' the summation from ' + - a + - ' to ' + - i + - ' of '), - (r = !0); - } else if (t.subscript) { - let i = te.toSpeakableFragment( - t.subscript, - e - ); - (i = i.trim()), - (s += - ' the summation from ' + - i + - ' of '), - (r = !0); - } else s += ' the summation of'; - else if ('\\prod' === a) - if (t.superscript && t.subscript) { - let i = te.toSpeakableFragment( - t.superscript, - e - ); - i = i.trim(); - let a = te.toSpeakableFragment( - t.subscript, - e - ); - (a = a.trim()), - (s += - ' the product from ' + - a + - ' to ' + - i + - ' of '), - (r = !0); - } else if (t.subscript) { - let i = te.toSpeakableFragment( - t.subscript, - e - ); - (i = i.trim()), - (s += - ' the product from ' + - i + - ' of '), - (r = !0); - } else s += ' the product of '; - else if ('\\int' === a) - if (t.superscript && t.subscript) { - let a = te.toSpeakableFragment( - t.superscript, - e - ); - a = a.trim(); - let o = te.toSpeakableFragment( - t.subscript, - e - ); - (o = o.trim()), - (s += - ' the integral from ' + - i(o) + - ' to ' + - i(a) + - ' of '), - (r = !0); - } else - s += - ' the integral of '; - else if ('string' == typeof t.body) { - s += - ms[t.body] || - ms[t.latex.trim()] || - ' ' + t.body; - } else - t.latex && - t.latex.length > 0 && - ('\\' === t.latex[0] - ? (s += ' ' + t.latex.substr(1)) - : (s += ' ' + t.latex)); - } - break; - case 'enclose': - (n = te.toSpeakableFragment(t.body, e)), - us(t.body) - ? (s += ' crossed out ' + n + ' , ') - : (s += - ' crossed out ' + n + '. End cross out'); - } - if (!r && t.superscript) { - let i = te.toSpeakableFragment(t.superscript, e); - i = i.trim(); - const a = i.replace(/<[^>]*>/g, ''); - if (us(t.superscript)) { - if ('math' === e.speechMode) { - const e = (function(t) { - if (t && Array.isArray(t)) - for (const e of t) - if ('first' !== e.type && e.id) - return e.id.toString(); - return ''; - })(t.superscript); - e && (s += ''); - } - '′' === a - ? (s += ' prime ') - : '2' === a - ? (s += ' squared ') - : '3' === a - ? (s += ' cubed ') - : isNaN(parseInt(a)) - ? (s += ' to the ' + i + '; ') - : (s += - ' to the ' + - a + - ' power; '); - } else - isNaN(parseInt(a)) - ? (s += ' raised to the ' + i + '; ') - : (s += - ' raised to the ' + - a + - ' power; '); - } - if (!r && t.subscript) { - let i = te.toSpeakableFragment(t.subscript, e); - (i = i.trim()), - us(t.subscript) - ? (s += ' sub ' + i) - : (s += ' subscript ' + i + '. End subscript. '); - } - } - return s; - }), - (te.toSpeakableText = function(t, e) { - const i = e - ? JSON.parse(JSON.stringify(e)) - : { textToSpeechMarkup: '', textToSpeechRules: 'mathlive' }; - if ( - ((i.speechMode = 'math'), - window.sre && 'sre' === i.textToSpeechRules) - ) { - i.generateID = !0; - const e = te.toMathML(t, i); - return e - ? (i.textToSpeechMarkup && - ((i.textToSpeechRulesOptions = - i.textToSpeechRulesOptions || {}), - (i.textToSpeechRulesOptions.markup = - i.textToSpeechMarkup), - 'ssml' === i.textToSpeechRulesOptions.markup && - (i.textToSpeechRulesOptions.markup = - 'ssml_step'), - (i.textToSpeechRulesOptions.rate = - i.speechEngineRate)), - i.textToSpeechRulesOptions && - window.sre.System.getInstance().setupEngine( - i.textToSpeechRulesOptions - ), - window.sre.System.getInstance().toSpeech(e)) - : ''; - } - let s = te.toSpeakableFragment(t, i); - if ('ssml' === i.textToSpeechMarkup) { - let t = ''; - i.speechEngineRate && - (t = ''), - (s = - '' + - t + - '

    ' + - s + - '

    ' + - (t ? '
    ' : '') + - ''); - } else - s = - 'mac' === i.textToSpeechMarkup && - 'mac' === - (function(t) { - let e = 'other'; - return ( - navigator && - navigator.platform && - navigator.userAgent && - (/^(mac)/i.test(navigator.platform) - ? (e = 'mac') - : /^(win)/i.test(navigator.platform) - ? (e = 'win') - : /(android)/i.test( - navigator.userAgent - ) - ? (e = 'android') - : /(iphone)/i.test( - navigator.userAgent - ) || - /(ipod)/i.test( - navigator.userAgent - ) || - /(ipad)/i.test( - navigator.userAgent - ) - ? (e = 'ios') - : /\bCrOS\b/i.test( - navigator.userAgent - ) && (e = 'chromeos')), - e === t ? t : '!' + t - ); - })('mac') - ? s - .replace(//g, '') - .replace(//g, '[[emph+]]') - .replace(/<\/emphasis>/g, '') - .replace( - //g, - '[[slc $1]]' - ) - .replace(/]*>/g, '') - .replace(/<\/say-as>/g, '') - : s.replace(/<[^>]*>/g, '').replace(/\s{2,}/g, ' '); - return s; - }); - class vs { - constructor(t, e) { - this.$setConfig(e || {}), - (this.element = t), - (t.mathfield = this), - (this.originalContent = t.innerHTML); - let i = this.element.textContent; - i && (i = i.trim()); - let s = ''; - this.config.substituteTextArea - ? 'string' == typeof this.config.substituteTextArea - ? (s += this.config.substituteTextArea) - : (s += '') - : /android|ipad|ipod|iphone/i.test(navigator.userAgent) - ? (s += - "\n \n \n ") - : (s += - ''), - (s += - ''), - this.config.virtualKeyboardMode || - (this.config.virtualKeyboardMode = - window.matchMedia && - window.matchMedia('(any-pointer: coarse)').matches - ? 'onfocus' - : 'off'), - 'manual' === this.config.virtualKeyboardMode - ? ((s += `')) - : (s += ''), - (s += ''), - (s += - '\n
    \n \n \n
    \n '), - (this.element.innerHTML = s); - let a = 0; - 'function' == typeof this.config.substituteTextArea - ? (this.textarea = this.config.substituteTextArea()) - : (this.textarea = this.element.children[ - a++ - ].firstElementChild), - (this.field = this.element.children[a].children[0]), - this.field.addEventListener( - 'wheel', - t => { - t.preventDefault(), t.stopPropagation(); - let e = void 0 === t.deltaX ? t.detail : -t.deltaX; - isFinite(e) || (e = t.wheelDelta / 10), - this.field.scroll({ - top: 0, - left: this.field.scrollLeft - 5 * e, - }); - }, - { passive: !1 } - ), - (this.virtualKeyboardToggleDOMNode = this.element.children[ - a++ - ].children[1]), - this._attachButtonHandlers( - this.virtualKeyboardToggleDOMNode, - { - default: 'toggleVirtualKeyboard', - alt: 'toggleVirtualKeyboardAlt', - shift: 'toggleVirtualKeyboardShift', - } - ), - (this.ariaLiveText = this.element.children[a].children[0]), - (this.accessibleNode = this.element.children[ - a++ - ].children[1]), - (this.popover = bs( - 'mathlive-popover-panel', - 'ML__popover' - )), - (this.keystrokeCaption = bs( - 'mathlive-keystroke-caption-panel', - 'ML__keystroke-caption' - )), - (this.keystrokeCaptionVisible = !1), - (this.virtualKeyboardVisible = !1), - (this.keystrokeBuffer = ''), - (this.keystrokeBufferStates = []), - (this.keystrokeBufferResetTimer = null), - (this.suggestionIndex = 0), - (this.mode = e.defaultMode || 'math'), - (this.smartModeSuppressed = !1), - (this.style = {}), - (this.blurred = !0), - gs(this.element, 'focus', this), - gs(this.element, 'blur', this), - gs(this.textarea, 'cut', this), - gs(this.textarea, 'copy', this), - gs(this.textarea, 'paste', this), - He.delegateKeyboardEvents(this.textarea, { - container: this.element, - allowDeadKey: () => 'text' === this.mode, - typedText: this._onTypedText.bind(this), - paste: this._onPaste.bind(this), - keystroke: this._onKeystroke.bind(this), - focus: this._onFocus.bind(this), - blur: this._onBlur.bind(this), - }), - window.PointerEvent - ? gs(this.field, 'pointerdown', this) - : gs(this.field, 'touchstart:active mousedown', this), - gs(window, 'resize', this); - const o = { ...e }; - (o.onSelectionDidChange = vs.prototype._onSelectionDidChange.bind( - this - )), - (o.onContentDidChange = vs.prototype._onContentDidChange.bind( - this - )), - (o.onAnnounce = this.config.onAnnounce), - (o.macros = this.config.macros), - (o.removeExtraneousParentheses = this.config.removeExtraneousParentheses), - (this.mathlist = new Be.EditableMathlist(o, this)), - (this.undoManager = new (class { - constructor(t) { - (this.mathlist = t), - (this.maximumDepth = 1e3), - (this.record = !1), - (this.canCoalesce = !1), - this.reset(); - } - reset() { - (this.stack = []), (this.index = -1); - } - startRecording() { - this.record = !0; - } - canUndo() { - return this.index > 0; - } - canRedo() { - return this.index !== this.stack.length - 1; - } - undo(t) { - this.canUndo() && - (t && - 'function' == - typeof t.onUndoStateWillChange && - t.onUndoStateWillChange( - this.mathlist.target, - 'undo' - ), - this.restore(this.stack[this.index - 1], t), - (this.index -= 1), - t && - 'function' == - typeof t.onUndoStateDidChange && - t.onUndoStateDidChange( - this.mathlist.target, - 'undo' - ), - (this.canCoalesce = !1)); - } - redo(t) { - this.canRedo() && - (t && - 'function' === t.onUndoStateWillChange && - t.onUndoStateWillChange( - this.mathlist.target, - 'redo' - ), - (this.index += 1), - this.restore(this.stack[this.index], t), - t && - 'function' == - typeof t.onUndoStateDidChange && - t.onUndoStateDidChange( - this.mathlist.target, - 'redo' - ), - (this.canCoalesce = !1)); - } - pop() { - this.canUndo() && - ((this.index -= 1), this.stack.pop()); - } - snapshot(t) { - this.record && - (t && - 'function' === t.onUndoStateWillChange && - t.onUndoStateWillChange( - this.mathlist.target, - 'snapshot' - ), - this.stack.splice( - this.index + 1, - this.stack.length - this.index - 1 - ), - this.stack.push({ - latex: this.mathlist.root.toLatex(), - selection: this.mathlist.toString(), - }), - this.index++, - this.stack.length > this.maximumDepth && - this.stack.shift(), - t && - 'function' == - typeof t.onUndoStateDidChange && - t.onUndoStateDidChange( - this.mathlist.target, - 'snapshot' - ), - (this.canCoalesce = !1)); - } - snapshotAndCoalesce(t) { - this.canCoalesce && this.pop(), - this.snapshot(t), - (this.canCoalesce = !0); - } - save() { - return { - latex: this.mathlist.root.toLatex(), - selection: this.mathlist.toString(), - }; - } - restore(t, e) { - const i = this.mathlist.suppressChangeNotifications; - void 0 !== e.suppressChangeNotifications && - (this.mathlist.suppressChangeNotifications = - e.suppressChangeNotifications), - this.mathlist.insert(t ? t.latex : '', { - mode: 'math', - insertionMode: 'replaceAll', - selectionMode: 'after', - format: 'latex', - ...e, - }), - this.mathlist.setPath( - t - ? t.selection - : [{ relation: 'body', offset: 0 }] - ), - (this.mathlist.suppressChangeNotifications = i); - } - })(this.mathlist)), - i.length > 0 && this.$latex(i), - this.undoManager.startRecording(), - this.undoManager.snapshot(this.config); - } - handleEvent(t) { - switch (t.type) { - case 'focus': - this._onFocus(t); - break; - case 'blur': - this._onBlur(t); - break; - case 'touchstart': - case 'mousedown': - case 'pointerdown': - this._onPointerDown(t); - break; - case 'resize': - this._resizeTimer && - window.cancelAnimationFrame(this._resizeTimer), - (this._resizeTimer = window.requestAnimationFrame( - () => ks(this) && this._onResize() - )); - break; - case 'cut': - this._onCut(t); - break; - case 'copy': - this._onCopy(t); - break; - case 'paste': - this._onPaste(t); - } - } - $revertToOriginalContent() { - (this.element.innerHTML = this.originalContent), - (this.element.mathfield = null), - delete this.accessibleNode, - delete this.ariaLiveText, - delete this.field, - ys(this.textarea, 'cut', this), - ys(this.textarea, 'copy', this), - ys(this.textarea, 'paste', this), - this.textarea.remove(), - delete this.textarea, - this.virtualKeyboardToggleDOMNode.remove(), - delete this.virtualKeyboardToggleDOMNode, - xs(this.popover), - xs(this.keystrokeCaption), - xs(this.virtualKeyboard), - xs( - document.getElementById('mathlive-alternate-keys-panel') - ), - ys(this.element, 'pointerdown', this), - ys(this.element, 'touchstart:active mousedown', this), - ys(this.element, 'focus', this), - ys(this.element, 'blur', this), - ys(window, 'resize', this), - delete this.element; - } - _resetKeystrokeBuffer() { - (this.keystrokeBuffer = ''), - (this.keystrokeBufferStates = []), - clearTimeout(this.keystrokeBufferResetTimer); - } - _getCaretPosition() { - const t = (function t(e) { - if ( - e.classList.contains('ML__caret') || - e.classList.contains('ML__text-caret') || - e.classList.contains('ML__command-caret') - ) - return e; - let i; - return ( - Array.from(e.children).forEach(function(e) { - i = i || t(e); - }), - i - ); - })(this.field); - if (t) { - const e = t.getBoundingClientRect(); - return { x: e.right, y: e.bottom, height: e.height }; - } - return null; - } - _getSelectionBounds() { - const t = this.field.querySelectorAll('.ML__selected'); - if (t && t.length > 0) { - const e = { - top: 1 / 0, - bottom: -1 / 0, - left: 1 / 0, - right: -1 / 0, - }; - t.forEach(t => { - const i = t.getBoundingClientRect(); - i.left < e.left && (e.left = i.left), - i.right > e.right && (e.right = i.right), - i.bottom > e.bottom && (e.bottom = i.bottom), - i.top < e.top && (e.top = i.top); - }); - const i = this.field.getBoundingClientRect(), - s = e.right - e.left, - a = e.bottom - e.top; - return ( - (e.left = Math.ceil( - e.left - i.left + this.field.scrollLeft - )), - (e.right = e.left + s), - (e.top = Math.ceil(e.top - i.top)), - (e.bottom = e.top + a), - e - ); - } - return null; - } - _pathFromPoint(t, e, i) { - let s; - (i = i || {}).bias = i.bias || 0; - const a = (function t(e, i, s) { - let a = { - element: null, - distance: Number.POSITIVE_INFINITY, - }, - o = !0; - if (e.getAttribute('data-atom-id')) { - a.element = e; - const t = e.getBoundingClientRect(), - n = i - (t.left + t.right) / 2, - r = s - (t.top + t.bottom) / 2; - (a.distance = n * n + r * r), - (o = i >= t.left && i <= t.right); - } - return ( - o && - e.children && - Array.from(e.children).forEach(function(e) { - const o = t(e, i, s); - o.element && - o.distance <= a.distance && - (a = o); - }), - a - ); - })(this.field, t, e).element, - o = a ? a.getAttribute('data-atom-id') : null; - if (o) { - const e = this.mathlist.filter(function(t, e) { - return e.captureSelection - ? e.filter(t => t.id === o).length > 0 - : e.id === o; - }); - if (e && e.length > 0) - if ( - ((s = me.pathFromString(e[0]).path), 0 === i.bias) - ) { - const e = a.getBoundingClientRect(); - t < e.left + e.width / 2 && - !a.classList.contains('ML__placeholder') && - (s[s.length - 1].offset = Math.max( - 0, - s[s.length - 1].offset - 1 - )); - } else - i.bias < 0 && - (s[s.length - 1].offset = Math.min( - this.mathlist.siblings().length - 1, - Math.max(0, s[s.length - 1].offset + i.bias) - )); - } - return s; - } - _onPointerDown(t) { - const e = this; - let i, - s = !1, - a = !1, - o = !1; - if (1 !== t.buttons) return; - function n(t) { - window.PointerEvent - ? (ys(e.field, 'pointermove', h), - ys( - e.field, - 'pointerend pointerleave pointercancel', - n - ), - e.field.releasePointerCapture(t.pointerId)) - : (ys(e.field, 'touchmove', h), - ys(e.field, 'touchend touchleave', n), - ys(window, 'mousemove', h), - ys(window, 'mouseup blur', n)), - (s = !1), - clearInterval(c), - e.element - .querySelectorAll('.ML__scroller') - .forEach(t => t.parentNode.removeChild(t)), - t.preventDefault(), - t.stopPropagation(); - } - let r = !1, - l = !1; - const c = setInterval(() => { - r - ? e.field.scroll({ - top: 0, - left: e.field.scrollLeft - 16, - }) - : l && - e.field.scroll({ - top: 0, - left: e.field.scrollLeft + 16, - }); - }, 32); - function h(t) { - const s = t.touches ? t.touches[0].clientX : t.clientX, - o = t.touches ? t.touches[0].clientY : t.clientY, - n = 'touch' === t.pointerType ? 20 : 5; - if ( - Date.now() < m + 500 && - Math.abs(d - s) < n && - Math.abs(p - o) < n - ) - return t.preventDefault(), void t.stopPropagation(); - const c = e.field.getBoundingClientRect(); - (l = s > c.right), (r = s < c.left); - let h = i; - window.PointerEvent - ? t.isPrimary || - (h = e._pathFromPoint(t.clientX, t.clientY, { - bias: 0, - })) - : t.touches && - 2 === t.touches.length && - (h = e._pathFromPoint( - t.touches[1].clientX, - t.touches[1].clientY, - { bias: 0 } - )); - const u = e._pathFromPoint(s, o, { - bias: s <= d ? (s === d ? 0 : -1) : 1, - }); - u && - e.mathlist.setRange(h, u, { - extendToWordBoundary: a, - }) && - e._requestUpdate(), - t.preventDefault(), - t.stopPropagation(); - } - const d = t.touches ? t.touches[0].clientX : t.clientX, - p = t.touches ? t.touches[0].clientY : t.clientY, - m = Date.now(); - ws && - Math.abs(ws.x - d) < 5 && - Math.abs(ws.y - p) < 5 && - Date.now() < ws.time + 500 - ? ((Ss += 1), (ws.time = m)) - : ((ws = { x: d, y: p, time: m }), (Ss = 1)); - const u = this.field.getBoundingClientRect(); - if ( - d >= u.left && - d <= u.right && - p >= u.top && - p <= u.bottom - ) { - if ( - (this.$hasFocus() || - ((o = !0), - this.textarea.focus && this.textarea.focus()), - this._resetKeystrokeBuffer(), - (this.smartModeSuppressed = !1), - (i = this._pathFromPoint(d, p, { bias: 0 })), - i) - ) { - let r = document.createElement('div'); - (r.className = 'ML__scroller'), - this.element.appendChild(r), - (r.style.left = u.left - 200 + 'px'), - (r = document.createElement('div')), - (r.className = 'ML__scroller'), - this.element.appendChild(r), - (r.style.left = u.right + 'px'), - t.shiftKey - ? (this.mathlist.setRange( - this.mathlist.path, - i - ), - (i = me.clone(this.mathlist.path)), - (i[i.length - 1].offset -= 1)) - : this.mathlist.setPath(i, 0), - (o = !0), - (this.style = {}), - 3 === t.detail || Ss > 2 - ? (n(t), - (3 !== t.detail && 3 !== Ss) || - this.mathlist.selectAll_()) - : s || - ((s = !0), - window.PointerEvent - ? (gs(e.field, 'pointermove', h), - gs( - e.field, - 'pointerend pointercancel pointerup', - n - ), - e.field.setPointerCapture(t.pointerId)) - : (gs(window, 'blur', n), - t.touches - ? (gs(t.target, 'touchmove', h), - gs(t.target, 'touchend', n)) - : (gs(window, 'mousemove', h), - gs(window, 'mouseup', n))), - (2 !== t.detail && 2 !== Ss) || - ((a = !0), this.mathlist.selectGroup_())); - } - } else ws = null; - o && this._requestUpdate(), t.preventDefault(); - } - _onSelectionDidChange() { - this.mathlist.commitCommandStringBeforeInsertionPoint(); - let t = ''; - this.mathlist.forEachSelected(e => { - t += e.toLatex(); - }), - t - ? ((this.textarea.value = t), - this.$hasFocus() && - this.textarea.select && - this.textarea.select()) - : ((this.textarea.value = ''), - this.textarea.setAttribute('aria-label', '')); - { - const t = this.mode; - (this.mode = - this.mathlist.anchorMode() || this.config.defaultMode), - this.mode !== t && - 'function' == typeof this.config.onModeChange && - this.config.onModeChange(this, this.mode), - 'command' === t && - 'command' !== this.mode && - (Je.hidePopover(this), - this.mathlist.removeCommandString()); - } - Je.updatePopoverPosition(this, { deferred: !0 }), - 'function' == typeof this.config.onSelectionDidChange && - this.config.onSelectionDidChange(this); - } - _onContentDidChange() { - this.undoManager.canRedo() - ? this.element.classList.add('can-redo') - : this.element.classList.remove('can-redo'), - this.undoManager.canUndo() - ? this.element.classList.add('can-undo') - : this.element.classList.remove('can-undo'), - 'function' == typeof this.config.onContentDidChange && - this.config.onContentDidChange(this); - } - _nextAtomSpeechText(t) { - function e(t, e) { - return 'body' === e.relation - ? { - enclose: 'cross out', - leftright: 'fence', - surd: 'square root', - root: 'math field', - }[t.type] - : { - numer: 'numerator', - denom: 'denominator', - index: 'index', - body: 'parent', - subscript: 'subscript', - superscript: 'superscript', - }[e.relation]; - } - const i = t ? t.path : [], - s = this.mathlist.path, - a = s[s.length - 1]; - let o = ''; - for (; i.length > s.length; ) - (o += 'out of ' + e(t.parent(), i[i.length - 1]) + '; '), - i.pop(); - if (!this.mathlist.isCollapsed()) - return As(this, '', this.mathlist.getSelectedAtoms()); - const n = e(this.mathlist.parent(), a); - 0 === a.offset && - (o += (n ? 'start of ' + n : 'unknown') + ': '); - const r = this.mathlist.sibling( - Math.max(1, this.mathlist.extent) - ); - return ( - r - ? (o += As(this, '', r)) - : 0 !== a.offset && - (o += n ? 'end of ' + n : 'unknown'), - o - ); - } - _announce(t, e, i) { - 'function' == typeof this.config.onAnnounce && - this.config.onAnnounce(this, t, e, i); - } - _onFocus() { - this.config.readOnly || - (this.blurred && - ((this.blurred = !1), - this.textarea.focus && this.textarea.focus(), - 'onfocus' === this.config.virtualKeyboardMode && - this.showVirtualKeyboard_(), - Je.updatePopoverPosition(this), - this.config.onFocus && this.config.onFocus(this), - this._requestUpdate())); - } - _onBlur() { - this.blurred || - ((this.blurred = !0), - (this.ariaLiveText.textContent = ''), - 'onfocus' === this.config.virtualKeyboardMode && - this.hideVirtualKeyboard_(), - this.complete_({ discard: !0 }), - this._requestUpdate(), - this.config.onBlur && this.config.onBlur(this)); - } - _onResize() { - this.element.classList.remove( - 'ML__isNarrowWidth', - 'ML__isWideWidth', - 'ML__isExtendedWidth' - ), - window.innerWidth >= 1024 - ? this.element.classList.add('ML__isExtendedWidth') - : window.innerWidth >= 768 - ? this.element.classList.add('ML__isWideWidth') - : this.element.classList.add('ML__isNarrowWidth'), - Je.updatePopoverPosition(this); - } - toggleKeystrokeCaption_() { - (this.keystrokeCaptionVisible = !this.keystrokeCaptionVisible), - (this.keystrokeCaption.innerHTML = ''), - this.keystrokeCaptionVisible || - (this.keystrokeCaption.style.visibility = 'hidden'); - } - _showKeystroke(t) { - const e = this.keystrokeCaption; - if (e && this.keystrokeCaptionVisible) { - const i = this.element.getBoundingClientRect(); - (e.style.left = i.left + 'px'), - (e.style.top = i.top - 64 + 'px'), - (e.innerHTML = - '' + - (ve.stringify(t) || t) + - '' + - e.innerHTML), - (e.style.visibility = 'visible'), - setTimeout(function() { - e.childNodes.length > 0 && - e.removeChild( - e.childNodes[e.childNodes.length - 1] - ), - 0 === e.childNodes.length && - (e.style.visibility = 'hidden'); - }, 3e3); - } - } - $perform(t) { - if (!t) return !1; - let e, - i = !1, - s = [], - a = !1; - if ( - (Array.isArray(t) - ? ((e = t[0]), (s = t.slice(1))) - : (e = t), - (e = e.replace(/-\w/g, t => t[1].toUpperCase())), - (e += '_'), - 'function' == typeof this.mathlist[e]) - ) { - if ( - (/^(delete|transpose|add)/.test(e) && - this._resetKeystrokeBuffer(), - /^(delete|transpose|add)/.test(e) && - 'command' !== this.mode && - (this.undoManager.pop(), - this.undoManager.snapshot(this.config)), - this.mathlist[e](...s), - /^(delete|transpose|add)/.test(e) && - 'command' !== this.mode && - this.undoManager.snapshot(this.config), - /^(delete)/.test(e) && 'command' === this.mode) - ) { - const t = this.mathlist.extractCommandStringAroundInsertionPoint(), - e = At.suggest(t); - 0 === e.length - ? Je.hidePopover(this) - : Je.showPopoverWithLatex( - this, - e[0].match, - e.length > 1 - ); - } - (a = !0), (i = !0); - } else - 'function' == typeof this[e] && - ((a = this[e](...s)), (i = !0)); - return ( - (this.mathlist.isCollapsed() && - !/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test( - e - )) || - (this._resetKeystrokeBuffer(), (this.style = {})), - a && this._requestUpdate(), - i - ); - } - performWithFeedback_(t) { - return ( - this.$focus(), - this.config.keypressVibration && - navigator.vibrate && - navigator.vibrate(3), - 'moveToNextPlaceholder' === - (t = t.replace(/-\w/g, t => t[1].toUpperCase())) || - 'moveToPreviousPlaceholder' === t || - 'complete' === t - ? this.returnKeypressSound - ? (this.returnKeypressSound.load(), - this.returnKeypressSound.play().catch(t => {})) - : this.keypressSound && - (this.keypressSound.load(), - this.keypressSound.play().catch(t => {})) - : ('deletePreviousChar' !== t && - 'deleteNextChar' !== t && - 'deletePreviousWord' !== t && - 'deleteNextWord' !== t && - 'deleteToGroupStart' !== t && - 'deleteToGroupEnd' !== t && - 'deleteToMathFieldStart' !== t && - 'deleteToMathFieldEnd' !== t) || - !this.deleteKeypressSound - ? this.keypressSound && - (this.keypressSound.load(), - this.keypressSound.play().catch(t => {})) - : (this.deleteKeypressSound.load(), - this.deleteKeypressSound.play().catch(t => {})), - this.$perform(t) - ); - } - convertLastAtomsToText_(t, e) { - 'function' == typeof t && ((e = t), (t = 1 / 0)), - void 0 === t && (t = 1 / 0); - let i = 0, - s = !1; - for (this.mathlist.contentWillChange(); !s; ) { - const a = this.mathlist.sibling(i); - (s = - 0 === t || - !a || - 'math' !== a.mode || - !( - /mord|textord|mpunct/.test(a.type) || - ('mop' === a.type && /[a-zA-Z]+/.test(a.body)) - ) || - a.superscript || - a.subscript || - (e && !e(a))), - s || - (a.applyStyle({ mode: 'text' }), - (a.latex = a.body)), - (i -= 1), - (t -= 1); - } - this.mathlist.contentDidChange(); - } - convertLastAtomsToMath_(t, e) { - 'function' == typeof t && ((e = t), (t = 1 / 0)), - void 0 === t && (t = 1 / 0), - this.mathlist.contentWillChange(); - let i = 0, - s = !1; - for (; !s; ) { - const a = this.mathlist.sibling(i); - (s = - 0 === t || - !a || - 'text' !== a.mode || - ' ' === a.body || - (e && !e(a))), - s || a.applyStyle({ mode: 'math', type: 'mord' }), - (i -= 1), - (t -= 1); - } - this.removeIsolatedSpace_(), this.mathlist.contentDidChange(); - } - removeIsolatedSpace_() { - let t = 0; - for ( - ; - this.mathlist.sibling(t) && - 'math' === this.mathlist.sibling(t).mode; - - ) - t -= 1; - if ( - this.mathlist.sibling(t) && - 'text' === this.mathlist.sibling(t).mode && - ' ' === this.mathlist.sibling(t).body && - (!this.mathlist.sibling(t - 1) || - 'math' === this.mathlist.sibling(t - 1).mode) - ) { - this.mathlist.contentWillChange(), - this.mathlist.siblings().splice(t - 1, 1), - this.mathlist.contentDidChange(); - const e = this.mathlist.suppressChangeNotifications; - (this.mathlist.suppressChangeNotifications = !0), - this.mathlist.setSelection( - this.mathlist.anchorOffset() - 1 - ), - (this.mathlist.suppressChangeNotifications = e); - } - } - getTextBeforeAnchor_() { - let t = '', - e = 0, - i = !1; - for (; !i; ) { - const s = this.mathlist.sibling(e); - (i = !( - s && - (('text' === s.mode && !s.type) || - ('math' === s.mode && - /mord|textord|mpunct/.test(s.type))) - )), - i || (t = s.body + t), - (e -= 1); - } - return t; - } - smartMode_(t, e) { - if (this.smartModeSuppressed) return !1; - if ( - this.mathlist.endOffset() < - this.mathlist.siblings().length - 1 - ) - return !1; - if (!e || e.ctrlKey || e.metaKey) return !1; - const i = He.eventToChar(e); - if (i.length > 1) return !1; - if (!this.mathlist.isCollapsed()) - return !('text' !== this.mode || !/[/_^]/.test(i)); - const s = this.getTextBeforeAnchor_() + i; - if ('text' === this.mode) { - if ('Esc' === t || /[/\\]/.test(i)) return !0; - if (/[\^_]/.test(i)) - return ( - /(^|\s)[a-zA-Z][^_]$/.test(s) && - this.convertLastAtomsToMath_(1), - !0 - ); - const e = { ')': '(', '}': '{', ']': '[' }[i]; - if ( - e && - this.mathlist.parent() && - 'leftright' === this.mathlist.parent().type && - this.mathlist.parent().leftDelim === e - ) - return !0; - if (/(^|[^a-zA-Z])(a|I)[ ]$/.test(s)) return !1; - if (/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i)) return !0; - if (/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s)) - return this.convertLastAtomsToMath_(1), !1; - if (/[^0-9]\.[^0-9\s]$/.test(s)) { - this.convertLastAtomsToMath_(1); - const t = this.mathlist.sibling(0); - return ( - (t.body = '⋅'), - (t.autoFontFamily = 'cmr'), - (t.latex = '\\cdot'), - !0 - ); - } - if (/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s)) - return this.convertLastAtomsToMath_(1), !0; - if (/\.[0-9]$/.test(s)) - return this.convertLastAtomsToMath_(1), !0; - if (/[(][0-9+\-.]$/.test(s)) - return this.convertLastAtomsToMath_(1), !0; - if (/[(][a-z][,;]$/.test(s)) - return this.convertLastAtomsToMath_(2), !0; - if (/[0-9+\-=><*|]$/.test(i)) - return this.removeIsolatedSpace_(), !0; - } else { - if ('Spacebar' === t) - return ( - this.convertLastAtomsToText_(t => - /[a-z][:,;.]$/.test(t.body) - ), - !0 - ); - if ( - /[a-zA-Z]{3,}$/.test(s) && - !/(dxd|abc|xyz|uvw)$/.test(s) - ) - return ( - this.convertLastAtomsToText_(t => - /[a-zA-Z:,;.]/.test(t.body) - ), - !0 - ); - if (/(^|\W)(if|If)$/i.test(s)) - return this.convertLastAtomsToText_(1), !0; - if ( - /(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test( - s - ) && - !/(αβγ)$/.test(s) - ) - return ( - this.convertLastAtomsToText_(t => - /(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test( - t.body - ) - ), - !0 - ); - if (/\?|\./.test(i)) return !0; - } - return !1; - } - _onKeystroke(t, e) { - if ( - (this._showKeystroke(t), - clearTimeout(this.keystrokeBufferResetTimer), - this.config.onKeystroke && - !this.config.onKeystroke(this, t, e)) - ) - return ( - e && - e.preventDefault && - (e.preventDefault(), e.stopPropagation()), - !1 - ); - let i, - s, - a, - o = !1; - if ( - 'command' !== this.mode && - (!e || (!e.ctrlKey && !e.metaKey)) - ) { - const t = He.eventToChar(e); - if ('Backspace' !== t) - if (!t || t.length > 1) this._resetKeystrokeBuffer(); - else { - const e = this.keystrokeBuffer + t; - let a = 0; - for (; !i && a < e.length; ) { - let t; - if (this.keystrokeBufferStates[a]) { - const e = new Be.EditableMathlist(); - (e.root = te.makeRoot( - 'math', - he.parseTokens( - n( - this.keystrokeBufferStates[a] - .latex - ), - this.config.default, - null, - this.config.macros - ) - )), - e.setPath( - this.keystrokeBufferStates[a] - .selection - ), - (t = e.siblings()); - } else t = this.mathlist.siblings(); - (i = ve.forString( - this.mode, - t, - e.slice(a), - this.config - )), - (a += 1); - } - (s = a - 1), - (this.keystrokeBuffer += t), - this.keystrokeBufferStates.push( - this.undoManager.save() - ), - ve.startsWithString(e, this.config).length <= 1 - ? (o = !0) - : this.config.inlineShortcutTimeout && - (this.keystrokeBufferResetTimer = setTimeout( - () => { - this._resetKeystrokeBuffer(); - }, - this.config.inlineShortcutTimeout - )); - } - } - if (this.config.smartMode) { - const s = this.mode; - i - ? (this.mode = 'math') - : this.smartMode_(t, e) && - ((this.mode = { math: 'text', text: 'math' }[ - this.mode - ]), - (a = '')), - this.mode !== s && - 'function' == typeof this.config.onModeChange && - this.config.onModeChange(this, this.mode); - } - if ( - (i || a || (a = ve.selectorForKeystroke(this.mode, t)), - !i && !a) - ) - return !0; - if (this.config.readOnly && 'insert' === a[0]) return !0; - this.mathlist.decorateCommandStringAroundInsertionPoint(!1); - const r = this.mathlist.parent(); - if ( - ('moveAfterParent' === a && - r && - 'leftright' === r.type && - this.mathlist.endOffset() === - this.mathlist.siblings().length - 1 && - this.config.smartFence && - this.mathlist._insertSmartFence('.') && - ((a = ''), this._requestUpdate()), - 'math' === this.mode && 'Spacebar' === t && !i) - ) { - const t = this.mathlist.sibling(1), - e = this.mathlist.sibling(-1); - ((t && 'text' === t.mode) || (e && 'text' === e.mode)) && - this.mathlist.insert(' ', { mode: 'text' }); - } - if (((a && !this.$perform(a)) || i) && i) { - if ( - !/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test( - i - ) - ) { - const t = { - ...this.mathlist.anchorStyle(), - ...this.style, - }; - this.mathlist.insert(He.eventToChar(e), { - suppressChangeNotifications: !0, - mode: this.mode, - style: t, - }); - const i = this.mode; - this.undoManager.snapshotAndCoalesce(this.config), - this.undoManager.restore( - this.keystrokeBufferStates[s], - { - ...this.config, - suppressChangeNotifications: !0, - } - ), - (this.mode = i); - } - this.mathlist.contentWillChange(); - const t = this.mathlist.suppressChangeNotifications; - this.mathlist.suppressChangeNotifications = !0; - const a = { ...this.mathlist.anchorStyle(), ...this.style }; - this.mathlist.insert(i, { - format: 'latex', - mode: this.mode, - style: a, - smartFence: !0, - }), - this.removeIsolatedSpace_(), - i.endsWith(' ') && - ((this.mode = 'text'), - this.mathlist.insert(' ', { - mode: 'text', - style: a, - })), - (this.mathlist.suppressChangeNotifications = t), - this.mathlist.contentDidChange(), - this.undoManager.snapshot(this.config), - this._requestUpdate(), - this._announce('replacement'), - o && this._resetKeystrokeBuffer(); - } - return ( - this.scrollIntoView(), - e && - e.preventDefault && - (e.preventDefault(), e.stopPropagation()), - !1 - ); - } - _onTypedText(t, e) { - if (this.config.readOnly) return void this._announce('plonk'); - if ( - ((e = e || {}).focus && this.$focus(), - e.feedback && - (this.config.keypressVibration && - navigator.vibrate && - navigator.vibrate(3), - this.keypressSound && - (this.keypressSound.load(), - this.keypressSound.play().catch(t => {}))), - e.commandMode && - 'command' !== this.mode && - this.switchMode_('command'), - this.mathlist.decorateCommandStringAroundInsertionPoint(!1), - e.simulateKeystroke) - ) { - const e = t.charAt(0), - i = He.charToEvent(e); - if (!this.$keystroke(He.keyboardEventToString(i), i)) - return; - } - let i = '', - a = !1; - if (this.pasteInProgress) - (this.pasteInProgress = !1), - this.mathlist.insert(t, { - smartFence: this.config.smartFence, - mode: 'math', - }); - else { - const e = { ...this.mathlist.anchorStyle(), ...this.style }, - o = s(t); - for (const t of o) - if ('command' === this.mode) { - this.mathlist.removeSuggestion(), - (this.suggestionIndex = 0); - const e = this.mathlist.extractCommandStringAroundInsertionPoint(), - s = At.suggest(e + t); - (a = s.length > 1), - 0 === s.length - ? (this.mathlist.insert(t, { - mode: 'command', - }), - /^\\[a-zA-Z\\*]+$/.test(e + t) && - this.mathlist.decorateCommandStringAroundInsertionPoint( - !0 - ), - Je.hidePopover(this)) - : (this.mathlist.insert(t, { - mode: 'command', - }), - s[0].match !== e + t && - this.mathlist.insertSuggestion( - s[0].match, - -s[0].match.length + e.length + 1 - ), - (i = s[0].match)); - } else if ('math' === this.mode) { - const i = { - '^': 'moveToSuperscript', - _: 'moveToSubscript', - ' ': 'moveAfterParent', - }[t]; - if (i) { - if ('moveToSuperscript' === i) { - if ( - this._superscriptDepth() >= - this.config.scriptDepth[1] - ) - return void this._announce('plonk'); - } else if ( - 'moveToSubscript' === i && - this._subscriptDepth() >= - this.config.scriptDepth[0] - ) - return void this._announce('plonk'); - this.$perform(i); - } else - this.config.smartSuperscript && - 'superscript' === this.mathlist.relation() && - /[0-9]/.test(t) && - 0 === - this.mathlist - .siblings() - .filter(t => 'first' !== t.type).length - ? (this.mathlist.insert(t, { - mode: 'math', - style: e, - }), - this.mathlist.moveAfterParent_()) - : this.mathlist.insert(t, { - mode: 'math', - style: e, - smartFence: this.config.smartFence, - }); - } else - 'text' === this.mode && - this.mathlist.insert(t, { - mode: 'text', - style: e, - }); - } - 'command' !== this.mode && - this.undoManager.snapshotAndCoalesce(this.config), - this._requestUpdate(), - this.scrollIntoView(), - Je.showPopoverWithLatex(this, i, a); - } - _hash() { - let t = 0; - const e = this.mathlist.root.toLatex(!1); - for (let i = 0; i < e.length; i++) - (t = 31 * t + e.charCodeAt(i)), (t |= 0); - return Math.abs(t); - } - _requestUpdate() { - this.dirty || - ((this.dirty = !0), - requestAnimationFrame(t => ks(this) && this._render())); - } - _render(t) { - (t = t || {}), - (this.dirty = !1), - window.mathlive || (window.mathlive = {}), - this.mathlist.anchor() || - (this.mathlist.path = [ - { relation: 'body', offset: 0 }, - ]), - this.mathlist.forEach(t => { - (t.caret = ''), - (t.isSelected = !1), - (t.containsCaret = !1); - }); - const e = this.$hasFocus(); - if ( - (this.mathlist.isCollapsed() - ? (this.mathlist.anchor().caret = - e && !this.config.readOnly ? this.mode : '') - : this.mathlist.forEachSelected(t => { - t.isSelected = !0; - }), - e && !this.config.readOnly) - ) { - let t = this.mathlist.ancestor(1), - e = 1, - i = !1; - for (; t && !i; ) - ('surd' !== t.type && 'leftright' !== t.type) || - ((t.containsCaret = !0), (i = !0)), - (e += 1), - (t = this.mathlist.ancestor(e)); - } - const i = te.decompose( - { - mathstyle: 'displaystyle', - generateID: { - seed: this._hash(), - groupNumbers: t.forHighlighting, - }, - macros: this.config.macros, - }, - this.mathlist.root - ), - s = N.makeSpan(i, 'ML__base'); - s.attributes = { translate: 'no', 'aria-hidden': 'true' }; - const a = N.makeSpan('', 'ML__strut'); - a.setStyle('height', s.height, 'em'); - const o = [a]; - if (0 !== s.depth) { - const t = N.makeSpan('', 'ML__strut--bottom'); - t.setStyle('height', s.height + s.depth, 'em'), - t.setStyle('vertical-align', -s.depth, 'em'), - o.push(t); - } - o.push(s); - const n = N.makeSpan(o, 'ML__mathlive'); - (this.field.innerHTML = n.toMarkup( - 0, - this.config.horizontalSpacingScale - )), - this.field.classList.toggle( - 'ML__focused', - e && !this.config.readOnly - ), - (this.accessibleNode.innerHTML = - "" + - te.toMathML(this.mathlist.root, this.config) + - ''); - const r = this._getSelectionBounds(); - if (r) { - const t = document.createElement('div'); - t.classList.add('ML__selection'), - (t.style.position = 'absolute'), - (t.style.left = r.left + 'px'), - (t.style.top = r.top + 'px'), - (t.style.width = Math.ceil(r.right - r.left) + 'px'), - (t.style.height = - Math.ceil(r.bottom - r.top - 1) + 'px'), - this.field.insertBefore(t, this.field.childNodes[0]); - } - } - _onPaste() { - return (this.pasteInProgress = !0), !0; - } - _onCut() { - return ( - setTimeout( - function() { - this.$clearSelection(), this._requestUpdate(); - }.bind(this), - 0 - ), - !0 - ); - } - _onCopy(t) { - this.mathlist.isCollapsed() - ? (t.clipboardData.setData( - 'text/plain', - '$$' + this.$text('latex-expanded') + '$$' - ), - t.clipboardData.setData( - 'application/json', - this.$text('json') - ), - t.clipboardData.setData( - 'application/xml', - this.$text('mathML') - )) - : (t.clipboardData.setData( - 'text/plain', - '$$' + this.$selectedText('latex-expanded') + '$$' - ), - t.clipboardData.setData( - 'application/json', - this.$selectedText('json') - ), - t.clipboardData.setData( - 'application/xml', - this.$selectedText('mathML') - )), - t.preventDefault(); - } - formatMathlist(t, e) { - let i = ''; - if ('latex' === (e = e || 'latex') || 'latex-expanded' === e) - i = t.toLatex('latex-expanded' === e); - else if ('mathML' === e) i = t.toMathML(this.config); - else if ('spoken' === e) i = te.toSpeakableText(t, this.config); - else if ('spoken-text' === e) { - const e = this.config.textToSpeechMarkup; - (this.config.textToSpeechMarkup = ''), - (i = te.toSpeakableText(t, this.config)), - (this.config.textToSpeechMarkup = e); - } else if ( - 'spoken-ssml' === e || - 'spoken-ssml-withHighlighting' === e - ) { - const s = this.config.textToSpeechMarkup, - a = this.config.generateID; - (this.config.textToSpeechMarkup = 'ssml'), - 'spoken-ssml-withHighlighting' === e && - (this.config.generateID = !0), - (i = te.toSpeakableText(t, this.config)), - (this.config.textToSpeechMarkup = s), - (this.config.generateID = a); - } else if ('json' === e) { - const e = te.toAST(t, this.config); - i = JSON.stringify(e); - } else - 'ASCIIMath' === e && - (i = (function t(e, i) { - if (!e) return ''; - if (Array.isArray(e)) { - let i = ''; - if (0 === e.length) return ''; - if ( - ('first' === e[0].type && e.shift(), - 'text' === e[0].mode) - ) { - let s = 0; - for ( - i = '"'; - e[s] && 'text' === e[s].mode; - - ) - (i += e[s].body), s++; - i += '"' + t(e.slice(s)); - } else { - let s = 0; - for (; e[s] && 'math' === e[s].mode; ) - (i += t(e[s])), s++; - i += t(e.slice(s)); - } - return i.trim(); - } - if ('text' === e.mode) return '"' + e.body + '"'; - let s = ''; - const a = e.latex ? e.latex.trim() : null; - let o; - switch (e.type) { - case 'group': - case 'root': - s = t(e.body); - break; - case 'array': - break; - case 'genfrac': - (e.leftDelim || e.rightDelim) && - (s += - '.' !== e.leftDelim && e.leftDelim - ? e.leftDelim - : '{:'), - e.hasBarLine - ? ((s += '('), - (s += t(e.numer)), - (s += ')/('), - (s += t(e.denom)), - (s += ')')) - : ((s += '(' + t(e.numer) + '),'), - (s += '(' + t(e.denom) + ')')), - (e.leftDelim || e.rightDelim) && - (s += - '.' !== e.rightDelim && - e.rightDelim - ? e.rightDelim - : '{:'); - break; - case 'surd': - e.index - ? (s += - 'root(' + - t(e.index) + - ')(' + - t(e.body) + - ')') - : (s += 'sqrt(' + t(e.body) + ')'); - break; - case 'leftright': - (s += - '.' !== e.leftDelim && e.leftDelim - ? e.leftDelim - : '{:'), - (s += t(e.body)), - (s += - '.' !== e.rightDelim && e.rightDelim - ? e.rightDelim - : '{:'); - break; - case 'sizeddelim': - case 'delim': - case 'accent': - break; - case 'line': - case 'overlap': - case 'overunder': - break; - case 'mord': - (s = - hi[a] || - a || - ('string' == typeof e.body - ? e.body - : '')), - '\\' === s[0] && (s += ''), - (o = a - ? a.match( - /[{]?\\char"([0-9abcdefABCDEF]*)[}]?/ - ) - : null), - o - ? (s = String.fromCharCode( - parseInt('0x' + o[1]) - )) - : s.length > 0 && - '\\' === s.charAt(0) && - (s = - 'string' == typeof e.body - ? e.body.charAt(0) - : e.latex); - break; - case 'mbin': - case 'mrel': - case 'textord': - case 'minner': - s = - a && hi[a] - ? hi[a] - : a && di[a] - ? di[a] - : e.body; - break; - case 'mopen': - case 'mclose': - s += e.body; - break; - case 'mpunct': - s = di[a] || a; - break; - case 'mop': - '​' !== e.body && - ((s = ''), - (s += - '\\operatorname' === a - ? t(e.body) - : e.body || a), - (s += ' ')); - break; - case 'mathstyle': - case 'box': - case 'spacing': - case 'enclose': - break; - case 'space': - s = ' '; - } - if (e.subscript) { - s += '_'; - const i = t(e.subscript); - i.length > 1 && !/^(-)?\d+(\.\d*)?$/.test(i) - ? (s += '(' + i + ')') - : (s += i); - } - if (e.superscript) { - s += '^'; - const i = t(e.superscript); - i.length > 1 && !/^(-)?\d+(\.\d*)?$/.test(i) - ? (s += '(' + i + ')') - : (s += i); - } - return s; - })(t, this.config)); - return i; - } - $text(t) { - return this.formatMathlist(this.mathlist.root, t); - } - $selectedText(t) { - const e = this.mathlist.getSelectedAtoms(); - if (!e) return ''; - const i = te.makeRoot('math', e); - return this.formatMathlist(i, t); - } - $selectionIsCollapsed() { - return this.mathlist.isCollapsed(); - } - $selectionDepth() { - return this.mathlist.path.length; - } - _superscriptDepth() { - let t = 0, - e = 0, - i = this.mathlist.ancestor(e), - s = !1; - for (; i; ) - (i.superscript || i.subscript) && (t += 1), - i.superscript ? (s = !0) : i.subscript && (s = !1), - (e += 1), - (i = this.mathlist.ancestor(e)); - return s ? t : 0; - } - _subscriptDepth() { - let t = 0, - e = 0, - i = this.mathlist.ancestor(e), - s = !1; - for (; i; ) - (i.superscript || i.subscript) && (t += 1), - i.superscript ? (s = !1) : i.subscript && (s = !0), - (e += 1), - (i = this.mathlist.ancestor(e)); - return s ? t : 0; - } - $selectionAtStart() { - return 0 === this.mathlist.startOffset(); - } - $selectionAtEnd() { - return ( - this.mathlist.endOffset() >= - this.mathlist.siblings().length - 1 - ); - } - groupIsSelected() { - return ( - 0 === this.mathlist.startOffset() && - this.mathlist.endOffset() >= - this.mathlist.siblings().length - 1 - ); - } - $latex(t, e) { - return t - ? (t !== this.mathlist.root.toLatex() && - ((e = e || {}), - this.mathlist.insert( - t, - Object.assign({}, this.config, { - insertionMode: 'replaceAll', - selectionMode: 'after', - format: 'latex', - mode: 'math', - suppressChangeNotifications: - e.suppressChangeNotifications, - }) - ), - this.undoManager.snapshot(this.config), - this._requestUpdate()), - t) - : this.mathlist.root.toLatex(); - } - $el() { - return this.element; - } - undo() { - return this.complete_(), this.undoManager.undo(this.config), !0; - } - redo() { - return this.complete_(), this.undoManager.redo(this.config), !0; - } - scrollIntoView() { - this.dirty && this._render(); - let t = this._getCaretPosition(); - const e = this.field.getBoundingClientRect(); - if (!t) { - const i = this._getSelectionBounds(); - i && - (t = { - x: i.right + e.left - this.field.scrollLeft, - y: i.top + e.top - this.field.scrollTop, - }); - } - if (t) { - const i = t.x - window.scrollX; - i < e.left - ? this.field.scroll({ - top: 0, - left: i - e.left + this.field.scrollLeft - 20, - behavior: 'smooth', - }) - : i > e.right && - this.field.scroll({ - top: 0, - left: i - e.right + this.field.scrollLeft + 20, - behavior: 'smooth', - }); - } - } - scrollToStart() { - this.field.scroll(0, 0); - } - scrollToEnd() { - const t = this.field.getBoundingClientRect(); - this.field.scroll(t.left - window.scrollX, 0); - } - enterCommandMode_() { - this.switchMode_('command'); - } - copyToClipboard_() { - return ( - this.$focus(), - this.mathlist.isCollapsed() && this.$select(), - document.execCommand('copy'), - !1 - ); - } - cutToClipboard_() { - return this.$focus(), document.execCommand('cut'), !0; - } - pasteFromClipboard_() { - return this.$focus(), document.execCommand('paste'), !0; - } - $insert(t, e) { - if ('string' == typeof t && t.length > 0) { - if ( - ((e = e || {}).focus && this.$focus(), - e.feedback && - (this.config.keypressVibration && - navigator.vibrate && - navigator.vibrate(3), - this.keypressSound && - (this.keypressSound.load(), - this.keypressSound.play())), - '\\\\' === t) - ) - this.mathlist.addRowAfter_(); - else if ('&' === t) this.mathlist.addColumnAfter_(); - else { - const i = this.style; - this.mathlist.insert(t, { - mode: this.mode, - style: this.mathlist.anchorStyle(), - ...e, - }), - e.resetStyle && (this.style = i); - } - return ( - this.undoManager.snapshot(this.config), - this._requestUpdate(), - !0 - ); - } - return !1; - } - switchMode_(t, e, i) { - this._resetKeystrokeBuffer(), - (this.smartModeSuppressed = - /text|math/.test(this.mode) && /text|math/.test(t)), - e && - this.$insert(e, { - format: 'latex', - mode: { math: 'text', text: 'math' }[t], - }), - this.mathlist.decorateCommandStringAroundInsertionPoint(!1), - 'command' === t - ? (this.mathlist.removeSuggestion(), - Je.hidePopover(this), - (this.suggestionIndex = 0), - this.virtualKeyboardVisible && - this.switchKeyboardLayer_('lower-command'), - this.mathlist.insert('', { mode: 'math' })) - : (this.mode = t), - i && this.$insert(i, { format: 'latex', mode: t }), - 'function' == typeof this.config.onModeChange && - this.config.onModeChange(this, this.mode), - this._requestUpdate(); - } - complete_(t) { - if (((t = t || {}), Je.hidePopover(this), t.discard)) - return ( - this.mathlist.spliceCommandStringAroundInsertionPoint( - null - ), - this.switchMode_('math'), - !0 - ); - const e = this.mathlist.extractCommandStringAroundInsertionPoint( - !t.acceptSuggestion - ); - if (e) { - if ('\\(' === e || '\\)' === e) - this.mathlist.spliceCommandStringAroundInsertionPoint( - [] - ), - this.mathlist.insert(e.slice(1), { - mode: this.mode, - }); - else { - const t = 'math'; - if (At.commandAllowed(t, e)) { - const i = he.parseTokens( - n(e), - t, - null, - this.config.macros - ); - this.mathlist.spliceCommandStringAroundInsertionPoint( - i - ); - } else { - const i = he.parseTokens( - n(e), - t, - null, - this.config.macros - ); - i - ? this.mathlist.spliceCommandStringAroundInsertionPoint( - i - ) - : this.mathlist.decorateCommandStringAroundInsertionPoint( - !0 - ); - } - } - return ( - this.undoManager.snapshot(this.config), - this._announce('replacement'), - !0 - ); - } - return !1; - } - _updateSuggestion() { - this.mathlist.positionInsertionPointAfterCommitedCommand(), - this.mathlist.removeSuggestion(); - const t = this.mathlist.extractCommandStringAroundInsertionPoint(), - e = At.suggest(t); - if (0 === e.length) - Je.hidePopover(this), - this.mathlist.decorateCommandStringAroundInsertionPoint( - !0 - ); - else { - const i = this.suggestionIndex % e.length, - s = t.length - e[i].match.length; - 0 !== s && this.mathlist.insertSuggestion(e[i].match, s), - Je.showPopoverWithLatex(this, e[i].match, e.length > 1); - } - this._requestUpdate(); - } - nextSuggestion_() { - return ( - (this.suggestionIndex += 1), this._updateSuggestion(), !1 - ); - } - previousSuggestion_() { - if (((this.suggestionIndex -= 1), this.suggestionIndex < 0)) { - this.mathlist.removeSuggestion(); - const t = this.mathlist.extractCommandStringAroundInsertionPoint(), - e = At.suggest(t); - this.suggestionIndex = e.length - 1; - } - return this._updateSuggestion(), !1; - } - _attachButtonHandlers(t, e) { - const i = this; - let s, a, o, n, r; - 'object' == typeof e && (e.default || e.pressed) - ? (e.default && - t.setAttribute( - 'data-' + this.config.namespace + 'command', - JSON.stringify(e.default) - ), - e.alt && - t.setAttribute( - 'data-' + this.config.namespace + 'command-alt', - JSON.stringify(e.alt) - ), - e.altshift && - t.setAttribute( - 'data-' + - this.config.namespace + - 'command-altshift', - JSON.stringify(e.altshift) - ), - e.shift && - t.setAttribute( - 'data-' + this.config.namespace + 'command-shift', - JSON.stringify(e.shift) - ), - e.pressed && - t.setAttribute( - 'data-' + - this.config.namespace + - 'command-pressed', - JSON.stringify(e.pressed) - ), - e.pressAndHoldStart && - t.setAttribute( - 'data-' + - this.config.namespace + - 'command-pressAndHoldStart', - JSON.stringify(e.pressAndHoldStart) - ), - e.pressAndHoldEnd && - t.setAttribute( - 'data-' + - this.config.namespace + - 'command-pressAndHoldEnd', - JSON.stringify(e.pressAndHoldEnd) - )) - : t.setAttribute( - 'data-' + this.config.namespace + 'command', - JSON.stringify(e) - ), - gs(t, 'mousedown touchstart:passive', function(e) { - if ('mousedown' !== e.type || 1 === e.buttons) { - e.stopPropagation(), - e.preventDefault(), - t.classList.add('pressed'), - (s = Date.now()), - 'touchstart' === e.type && - (o = e.changedTouches[0].identifier); - const n = t.getAttribute( - 'data-' + i.config.namespace + 'command-pressed' - ); - n && i.$perform(JSON.parse(n)); - const l = t.getAttribute( - 'data-' + - i.config.namespace + - 'command-pressAndHoldStart' - ); - l && - ((a = t), - r && clearTimeout(r), - (r = window.setTimeout(function() { - t.classList.contains('pressed') && - i.$perform(JSON.parse(l)); - }, 300))); - } - }), - gs(t, 'mouseleave touchcancel', function() { - t.classList.remove('pressed'); - }), - gs(t, 'touchmove:passive', function(t) { - t.preventDefault(); - for (let e = 0; e < t.changedTouches.length; e++) - if (t.changedTouches[e].identifier === o) { - const i = document.elementFromPoint( - t.changedTouches[e].clientX, - t.changedTouches[e].clientY - ); - i !== n && - n && - (n.dispatchEvent( - new MouseEvent('mouseleave'), - { bubbles: !0 } - ), - (n = null)), - i && - ((n = i), - i.dispatchEvent( - new MouseEvent('mouseenter', { - bubbles: !0, - buttons: 1, - }) - )); - } - }), - gs(t, 'mouseenter', function(e) { - 1 === e.buttons && t.classList.add('pressed'); - }), - gs(t, 'mouseup touchend click', function(e) { - if (n) { - e.stopPropagation(), e.preventDefault(); - const t = n; - return ( - (n = null), - void t.dispatchEvent( - new MouseEvent('mouseup', { bubbles: !0 }) - ) - ); - } - if ( - (t.classList.remove('pressed'), - t.classList.add('active'), - 'click' === e.type && 0 !== e.detail) - ) - return e.stopPropagation(), void e.preventDefault(); - window.setTimeout(function() { - t.classList.remove('active'); - }, 150); - let o = t.getAttribute( - 'data-' + - i.config.namespace + - 'command-pressAndHoldEnd' - ); - const r = Date.now(); - (t !== a || r < s + 300) && (o = void 0), - !o && - e.altKey && - e.shiftKey && - (o = t.getAttribute( - 'data-' + - i.config.namespace + - 'command-altshift' - )), - !o && - e.altKey && - (o = t.getAttribute( - 'data-' + i.config.namespace + 'command-alt' - )), - !o && - e.shiftKey && - (o = t.getAttribute( - 'data-' + - i.config.namespace + - 'command-shift' - )), - o || - (o = t.getAttribute( - 'data-' + i.config.namespace + 'command' - )), - o && i.$perform(JSON.parse(o)), - e.stopPropagation(), - e.preventDefault(); - }); - } - _makeButton(t, e, i, s) { - const a = document.createElement('span'); - return ( - (a.innerHTML = t), - e && a.classList.add([].slice.call(e.split(' '))), - i && a.setAttribute('aria-label', i), - this._attachButtonHandlers(a, s), - a - ); - } - showAlternateKeys_(t, e) { - const i = bs( - 'mathlive-alternate-keys-panel', - 'ML__keyboard alternate-keys' - ); - this.virtualKeyboard.classList.contains('material') && - i.classList.add('material'), - e.length >= 7 - ? (i.style.width = '286px') - : 4 === e.length || 2 === e.length - ? (i.style.width = '146px') - : 1 === e.length - ? (i.style.width = '86px') - : (i.style.width = '146px'), - (i.style.height = 'auto'); - let s = ''; - for (const t of e) - (s += ''), - (i.innerHTML = s), - ci.makeKeycap( - this, - i.getElementsByTagName('li'), - 'performAlternateKeys' - ); - const a = this.virtualKeyboard - .querySelector( - 'div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="' + - t + - '"]' - ) - .getBoundingClientRect(); - if (a) { - a.top - i.clientHeight < 0 && - ((i.style.width = 'auto'), - e.length <= 6 - ? (i.style.height = '56px') - : e.length <= 12 - ? (i.style.height = '108px') - : (i.style.height = '205px')); - const t = (a.top - i.clientHeight + 5).toString() + 'px', - s = - Math.max( - 0, - Math.min( - window.innerWidth - i.offsetWidth, - (a.left + a.right - i.offsetWidth) / 2 - ) - ) + 'px'; - (i.style.transform = 'translate(' + s + ',' + t + ')'), - i.classList.add('is-visible'); - } - return !1; - } - hideAlternateKeys_() { - const t = document.getElementById( - 'mathlive-alternate-keys-panel' - ); - return ( - t && - (t.classList.remove('is-visible'), - (t.innerHTML = ''), - xs(t)), - !1 - ); - } - performAlternateKeys_(t) { - return this.hideAlternateKeys_(), this.$perform(t); - } - switchKeyboardLayer_(t) { - if ('off' !== this.config.virtualKeyboardMode) { - 'lower-command' !== t && - 'upper-command' !== t && - 'symbols-command' !== t && - this.complete_(), - this.showVirtualKeyboard_(), - this.hideAlternateKeys_(), - this.unshiftKeyboardLayer_(); - const e = this.virtualKeyboard.getElementsByClassName( - 'keyboard-layer' - ); - let i = !1; - for (let s = 0; s < e.length; s++) - if (e[s].dataset.layer === t) { - i = !0; - break; - } - if (i) - for (let i = 0; i < e.length; i++) - e[i].dataset.layer === t - ? e[i].classList.add('is-visible') - : e[i].classList.remove('is-visible'); - this.$focus(); - } - return !0; - } - shiftKeyboardLayer_() { - const t = this.virtualKeyboard.querySelectorAll( - 'div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action' - ); - if (t) - for (let e = 0; e < t.length; e++) { - const i = t[e]; - let s = i.getAttribute('data-shifted'); - if (s || /^[a-z]$/.test(i.innerHTML)) { - i.setAttribute( - 'data-unshifted-content', - i.innerHTML - ), - s || (s = i.innerHTML.toUpperCase()), - (i.innerHTML = s); - const t = i.getAttribute( - 'data-' + this.config.namespace + 'command' - ); - if (t) { - i.setAttribute('data-unshifted-command', t); - const e = i.getAttribute( - 'data-shifted-command' - ); - if (e) - i.setAttribute( - 'data-' + - this.config.namespace + - 'command', - e - ); - else { - const e = JSON.parse(t); - Array.isArray(e) && - (e[1] = e[1].toUpperCase()), - i.setAttribute( - 'data-' + - this.config.namespace + - 'command', - JSON.stringify(e) - ); - } - } - } - } - return !1; - } - unshiftKeyboardLayer_() { - const t = this.virtualKeyboard.querySelectorAll( - 'div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action' - ); - if (t) - for (let e = 0; e < t.length; e++) { - const i = t[e], - s = i.getAttribute('data-unshifted-content'); - s && (i.innerHTML = s); - const a = i.getAttribute('data-unshifted-command'); - a && - i.setAttribute( - 'data-' + this.config.namespace + 'command', - a - ); - } - return !1; - } - insertAndUnshiftKeyboardLayer_(t) { - return this.$insert(t), this.unshiftKeyboardLayer_(), !0; - } - toggleVirtualKeyboardAlt_() { - let t = !1; - return ( - this.virtualKeyboard && - ((t = this.virtualKeyboard.classList.contains( - 'material' - )), - this.virtualKeyboard.remove(), - delete this.virtualKeyboard, - (this.virtualKeyboard = null)), - this.showVirtualKeyboard_(t ? '' : 'material'), - !1 - ); - } - toggleVirtualKeyboardShift_() { - this.config.virtualKeyboardLayout = { - qwerty: 'azerty', - azerty: 'qwertz', - qwertz: 'dvorak', - dvorak: 'colemak', - colemak: 'qwerty', - }[this.config.virtualKeyboardLayout]; - let t = this.virtualKeyboard - ? this.virtualKeyboard.querySelector( - 'div.keyboard-layer.is-visible' - ) - : null; - return ( - (t = t ? t.id : ''), - this.virtualKeyboard && - (this.virtualKeyboard.remove(), - delete this.virtualKeyboard, - (this.virtualKeyboard = null)), - this.showVirtualKeyboard_(), - t && this.switchKeyboardLayer_(t), - !1 - ); - } - showVirtualKeyboard_(t) { - return ( - (this.virtualKeyboardVisible = !1), - this.toggleVirtualKeyboard_(t), - !1 - ); - } - hideVirtualKeyboard_() { - return ( - (this.virtualKeyboardVisible = !0), - this.toggleVirtualKeyboard_(), - !1 - ); - } - toggleVirtualKeyboard_(t) { - if ( - ((this.virtualKeyboardVisible = !this - .virtualKeyboardVisible), - this.virtualKeyboardVisible) - ) { - this.virtualKeyboard - ? this.virtualKeyboard.classList.add('is-visible') - : ((this.virtualKeyboard = ci.make(this, t)), - gs( - this.virtualKeyboard, - 'touchstart:passive mousedown', - function() { - e.$focus(); - } - ), - document.body.appendChild(this.virtualKeyboard)); - const e = this; - window.setTimeout(function() { - e.virtualKeyboard.classList.add('is-visible'); - }, 1); - } else - this.virtualKeyboard && - this.virtualKeyboard.classList.remove('is-visible'); - return ( - 'function' == typeof this.config.onVirtualKeyboardToggle && - this.config.onVirtualKeyboardToggle( - this, - this.virtualKeyboardVisible, - this.virtualKeyboard - ), - !1 - ); - } - $applyStyle(t) { - if ( - (this._resetKeystrokeBuffer(), - (t = (function(t) { - const e = {}; - return ( - 'string' == typeof t.mode && - (e.mode = t.mode.toLowerCase()), - 'string' == typeof t.color && (e.color = t.color), - 'string' == typeof t.backgroundColor && - (e.backgroundColor = t.backgroundColor), - 'string' == typeof t.fontFamily && - (e.fontFamily = t.fontFamily), - 'string' == typeof t.series && - (e.fontSeries = t.series), - 'string' == typeof t.fontSeries && - (e.fontSeries = t.fontSeries.toLowerCase()), - e.fontSeries && - (e.fontSeries = - { bold: 'b', medium: 'm', normal: 'mn' }[ - e.fontSeries - ] || e.fontSeries), - 'string' == typeof t.shape && - (e.fontShape = t.shape), - 'string' == typeof t.fontShape && - (e.fontShape = t.fontShape.toLowerCase()), - e.fontShape && - (e.fontShape = - { - italic: 'it', - up: 'n', - upright: 'n', - normal: 'n', - }[e.fontShape] || e.fontShape), - 'string' == typeof t.size - ? (e.fontSize = t.size) - : 'number' == typeof t.size && - (e.fontSize = - 'size' + - Math.min(0, Math.max(10, t.size))), - 'string' == typeof t.fontSize && - (e.fontSize = t.fontSize.toLowerCase()), - e.fontSize && - (e.fontSize = - { - tiny: 'size1', - scriptsize: 'size2', - footnotesize: 'size3', - small: 'size4', - normal: 'size5', - normalsize: 'size5', - large: 'size6', - Large: 'size7', - LARGE: 'size8', - huge: 'size9', - Huge: 'size10', - }[e.fontSize] || e.fontSize), - e - ); - })(t)).mode) - ) { - if (this.mathlist.isCollapsed()) this.switchMode_(t.mode); - else { - const t = this.mode, - e = - 'math' === - (this.mathlist.anchorMode() || - this.config.default) - ? 'text' - : 'math'; - let i = this.$selectedText('ASCIIMath'); - if ( - ('math' === e && - /^"[^"]+"$/.test(i) && - (i = i.slice(1, -1)), - this.$insert(i, { - mode: e, - selectionMode: 'item', - format: 'text' === e ? 'text' : 'ASCIIMath', - }), - (this.mode = e), - this.groupIsSelected()) - ) { - const t = this.mathlist.parent(); - !t || - ('group' !== t.type && 'root' !== t.type) || - (t.mode = e); - } - this.mode !== t && - 'function' == typeof this.config.onModeChange && - this.config.onModeChange(this, this.mode); - } - delete t.mode; - } - return ( - this.mathlist.isCollapsed() - ? (this.style.fontSeries && - t.fontSeries === this.style.fontSeries && - (t.fontSeries = 'auto'), - t.fontShape && - t.fontShape === this.style.fontShape && - (t.fontShape = 'auto'), - t.color && - t.color === this.style.color && - (t.color = 'none'), - t.backgroundColor && - t.backgroundColor === - this.style.backgroundColor && - (t.backgroundColor = 'none'), - t.fontSize && - t.fontSize === this.style.fontSize && - (t.fontSize = 'auto'), - (this.style = { ...this.style, ...t })) - : (this.mathlist._applyStyle(t), - this.undoManager.snapshot(this.config)), - !0 - ); - } - $hasFocus() { - return ( - document.hasFocus() && - document.activeElement === this.textarea - ); - } - $focus() { - this.$hasFocus() || - (this.textarea.focus && this.textarea.focus(), - this._announce('line')); - } - $blur() { - this.$hasFocus() && this.textarea.blur && this.textarea.blur(); - } - $select() { - this.mathlist.selectAll_(); - } - $clearSelection() { - this.mathlist.delete_(); - } - $keystroke(t, e) { - return this._onKeystroke(t, e); - } - $typedText(t) { - this._onTypedText(t); - } - typedText_(t, e) { - return this._onTypedText(t, e); - } - $setConfig(t) { - if ( - (this.config || - (this.config = { - namespace: '', - overrideDefaultInlineShortcuts: !1, - readOnly: !1, - removeExtraneousParentheses: !0, - scriptDepth: [1 / 0, 1 / 0], - smartFence: !0, - smartSuperscript: !0, - virtualKeyboard: '', - virtualKeyboardLayout: 'qwerty', - }), - (this.config = { ...this.config, ...t }), - void 0 !== this.config.scriptDepth && - !Array.isArray(this.config.scriptDepth)) - ) { - const t = parseInt(this.config.scriptDepth); - this.config.scriptDepth = [t, t]; - } - if ( - (void 0 === this.config.removeExtraneousParentheses && - (this.config.removeExtraneousParentheses = !0), - (this.config.onAnnounce = t.onAnnounce || Ms), - (this.config.macros = Object.assign( - {}, - At.MACROS, - this.config.macros - )), - !/^[a-z]*[-]?$/.test(this.config.namespace)) - ) - throw Error( - 'options.namespace must be a string of lowercase characters only' - ); - /-$/.test(this.config.namespace) || - (this.config.namespace += '-'), - (Qe.locale = this.config.locale || Qe.locale), - Qe.merge(this.config.strings), - (this.config.virtualKeyboardLayout = - t.virtualKeyboardLayout || - { - fr: 'azerty', - be: 'azerty', - al: 'qwertz', - ba: 'qwertz', - cz: 'qwertz', - de: 'qwertz', - hu: 'qwertz', - sk: 'qwertz', - ch: 'qwertz', - }[Qe.locale.substring(0, 2)] || - 'qwerty'), - (this.keypressSound = void 0), - (this.spacebarKeypressSound = void 0), - (this.returnKeypressSound = void 0), - (this.deleteKeypressSound = void 0), - this.config.keypressSound && - ('string' == typeof this.config.keypressSound - ? ((this.keypressSound = new Audio()), - (this.keypressSound.preload = 'none'), - (this.keypressSound.src = this.config.keypressSound), - (this.keypressSound.volume = 0.5), - (this.spacebarKeypressSound = this.keypressSound), - (this.returnKeypressSound = this.keypressSound), - (this.deleteKeypressSound = this.keypressSound)) - : ((this.keypressSound = new Audio()), - (this.keypressSound.preload = 'none'), - (this.keypressSound.src = this.config.keypressSound.default), - (this.keypressSound.volume = 0.5), - (this.spacebarKeypressSound = this.keypressSound), - (this.returnKeypressSound = this.keypressSound), - (this.deleteKeypressSound = this.keypressSound), - this.config.keypressSound.spacebar && - ((this.spacebarKeypressSound = new Audio()), - (this.spacebarKeypressSound.preload = 'none'), - (this.spacebarKeypressSound.src = this.config.keypressSound.spacebar), - (this.spacebarKeypressSound.volume = 0.5)), - this.config.keypressSound.return && - ((this.returnKeypressSound = new Audio()), - (this.returnKeypressSound.preload = 'none'), - (this.returnKeypressSound.src = this.config.keypressSound.return), - (this.returnKeypressSound.volume = 0.5)), - this.config.keypressSound.delete && - ((this.deleteKeypressSound = new Audio()), - (this.deleteKeypressSound.preload = 'none'), - (this.deleteKeypressSound.src = this.config.keypressSound.delete), - (this.deleteKeypressSound.volume = 0.5)))), - this.config.plonkSound && - ((this.plonkSound = new Audio()), - (this.plonkSound.preload = 'none'), - (this.plonkSound.src = this.config.plonkSound), - (this.plonkSound.volume = 0.5)), - this.readOnly && this._onBlur(), - this._requestUpdate(); - } - speak_(t, e) { - e = e || { withHighlighting: !1 }; - const i = (function(t, e) { - let i = null; - switch (e) { - case 'all': - i = t.mathlist.root; - break; - case 'selection': - t.mathlist.isCollapsed() || - (i = t.mathlist.getSelectedAtoms()); - break; - case 'left': { - const e = t.mathlist.siblings(), - s = t.mathlist.startOffset(); - if (s >= 1) { - i = []; - for (let t = 1; t <= s; t++) i.push(e[t]); - } - break; - } - case 'right': { - const e = t.mathlist.siblings(), - s = t.mathlist.endOffset() + 1; - if (s <= e.length - 1) { - i = []; - for (let t = s; t <= e.length - 1; t++) - i.push(e[t]); - } - break; - } - case 'start': - case 'end': - break; - case 'group': - i = t.mathlist.siblings(); - break; - case 'parent': { - const e = t.mathlist.parent(); - e && 'root' !== e.type && (i = t.mathlist.parent()); - break; - } - } - return i; - })(this, t); - if (null === i) - return ( - this.config.handleSpeak( - (function(t) { - let e = ''; - switch (t) { - case 'all': - break; - case 'selection': - e = 'no selection'; - break; - case 'left': - e = 'at start'; - break; - case 'right': - e = 'at end'; - break; - case 'group': - break; - case 'parent': - e = 'no parent'; - } - return e; - })(t) - ), - !1 - ); - const s = { ...this.config }; - (e.withHighlighting || 'amazon' === s.speechEngine) && - ((s.textToSpeechMarkup = - window.sre && 'sre' === s.textToSpeechRules - ? 'ssml_step' - : 'ssml'), - e.withHighlighting && (s.generateID = !0)); - const a = te.toSpeakableText(i, s); - return ( - e.withHighlighting - ? ((window.mathlive.readAloudMathField = this), - this._render({ forHighlighting: !0 }), - this.config.handleReadAloud && - this.config.handleReadAloud( - this.field, - a, - this.config - )) - : this.config.handleSpeak && - this.config.handleSpeak(a, s), - !1 - ); - } - } - let ws, - Ss = 0; - function As(t, e, i) { - const s = Object.assign({}, t.config); - return ( - (s.textToSpeechMarkup = ''), - (s.textToSpeechRulesOptions = s.textToSpeechRulesOptions || {}), - (s.textToSpeechRulesOptions.markup = 'none'), - e + te.toSpeakableText(i, s) - ); - } - function Ms(t, e, i, s) { - let a = ''; - 'plonk' === e - ? (t.plonkSound && - (t.plonkSound.load(), t.plonkSound.play().catch(t => {})), - t._resetKeystrokeBuffer()) - : 'delete' === e - ? (a = As(t, 'deleted: ', s)) - : 'focus' === e || /move/.test(e) - ? (a = - (t.mathlist.isCollapsed() ? '' : 'selected: ') + - t._nextAtomSpeechText(i)) - : 'replacement' === e - ? (a = As(t, '', t.mathlist.sibling(0))) - : 'line' === e - ? ((a = As(t, '', t.mathlist.root)), - (t.accessibleNode.innerHTML = - '' + - te.toMathML(t.mathlist.root, t.config) + - ''), - t.textarea.setAttribute('aria-label', 'after: ' + a)) - : (a = s ? As(t, e + ' ', s) : e); - const o = /\u00a0/.test(t.ariaLiveText.textContent) ? '   ' : '   '; - t.ariaLiveText.textContent = a + o; - } - (vs.prototype.undo_ = vs.prototype.undo), - (vs.prototype.redo_ = vs.prototype.redo), - (vs.prototype.scrollIntoView_ = vs.prototype.scrollIntoView), - (vs.prototype.scrollToStart_ = vs.prototype.scrollToStart), - (vs.prototype.scrollToEnd_ = vs.prototype.scrollToEnd), - (vs.prototype.insert_ = vs.prototype.$insert); - var Cs = { isValidMathfield: ks, MathField: vs }; - function _s(t, e, i) { - let s = i, - a = 0; - const o = t.length; - for (; s < e.length; ) { - const i = e[s]; - if (a <= 0 && e.slice(s, s + o) === t) return s; - '\\' === i ? s++ : '{' === i ? a++ : '}' === i && a--, s++; - } - return -1; - } - function Ts(t, e, i, s) { - const a = []; - for (let o = 0; o < t.length; o++) - if ('text' === t[o].type) { - const n = t[o].data; - let r, - l = !0, - c = 0; - (r = n.indexOf(e)), - -1 !== r && - ((c = r), - c > 0 && - a.push({ type: 'text', data: n.slice(0, c) }), - (l = !1)); - let h = !1; - for (; !h; ) { - if (l) { - if (((r = n.indexOf(e, c)), -1 === r)) { - h = !0; - break; - } - c !== r && - a.push({ type: 'text', data: n.slice(c, r) }), - (c = r); - } else { - if (((r = _s(i, n, c + e.length)), -1 === r)) { - h = !0; - break; - } - a.push({ - type: 'math', - data: n.slice(c + e.length, r), - rawData: n.slice(c, r + i.length), - mathstyle: s, - }), - (c = r + i.length); - } - l = !l; - } - c < n.length && a.push({ type: 'text', data: n.slice(c) }); - } else a.push(t[o]); - return a; - } - function Ls(t, e) { - let i = [{ type: 'text', data: t }]; - for (let t = 0; t < e.inline.length; t++) { - const s = e.inline[t]; - i = Ts(i, s[0], s[1], 'textstyle'); - } - for (let t = 0; t < e.display.length; t++) { - const s = e.display[t]; - i = Ts(i, s[0], s[1], 'displaystyle'); - } - return i; - } - function Fs(t, e, i, s) { - const a = (function(t, e, i, s) { - let a = document.createElement('span'); - a.setAttribute('aria-hidden', 'true'), - e.preserveOriginalContent && - (a.setAttribute( - 'data-' + e.namespace + 'original-content', - t - ), - i && - a.setAttribute( - 'data-' + e.namespace + 'original-mathstyle', - i - )); - try { - a.innerHTML = e.renderToMarkup( - t, - i || 'displaystyle', - 'html', - e.macros - ); - } catch (e) { - if (!s) return null; - a = document.createTextNode(t); - } - return a; - })(t, i, e, s); - if ( - a && - /\b(mathml|speakable-text)\b/i.test(i.renderAccessibleContent) - ) { - const e = document.createDocumentFragment(); - if ( - (/\bmathml\b/i.test(i.renderAccessibleContent) && - i.renderToMathML && - e.appendChild( - (function(t, e) { - const i = document.createElement('span'); - try { - i.innerHTML = - "" + - e.renderToMathML(t, e) + - ''; - } catch (e) { - i.textContent = t; - } - return (i.className = 'sr-only'), i; - })(t, i) - ), - /\bspeakable-text\b/i.test(i.renderAccessibleContent) && - i.renderToSpeakableText) - ) { - const s = document.createElement('span'); - (s.innerHTML = i.renderToSpeakableText(t, i)), - (s.className = 'sr-only'), - e.appendChild(s); - } - return e.appendChild(a), e; - } - return a; - } - function Ds(t, e) { - let i = null; - if (e.TeX.processEnvironments && /^\s*\\begin/.test(t)) - (i = document.createDocumentFragment()), - i.appendChild(Fs(t, void 0, e, !0)); - else { - const s = Ls(t, e.TeX.delimiters); - if (1 === s.length && 'text' === s[0].type) return null; - i = document.createDocumentFragment(); - for (let t = 0; t < s.length; t++) - 'text' === s[t].type - ? i.appendChild(document.createTextNode(s[t].data)) - : i.appendChild(Fs(s[t].data, s[t].mathstyle, e, !0)); - } - return i; - } - const zs = { - namespace: '', - skipTags: [ - 'noscript', - 'style', - 'textarea', - 'pre', - 'code', - 'annotation', - 'annotation-xml', - ], - processScriptType: 'math/tex', - ignoreClass: 'tex2jax_ignore', - processClass: 'tex2jax_process', - preserveOriginalContent: !0, - renderAccessibleContent: 'mathml', - TeX: { - disabled: !1, - processEnvironments: !0, - delimiters: { - inline: [['\\(', '\\)']], - display: [ - ['$$', '$$'], - ['\\[', '\\]'], - ], - }, - }, - }; - var Es = { - renderMathInElement: function(t, e) { - try { - if ( - (((e = Object.assign( - {}, - zs, - e - )).ignoreClassPattern = new RegExp(e.ignoreClass)), - (e.processClassPattern = new RegExp(e.processClass)), - (e.processScriptTypePattern = new RegExp( - e.processScriptType - )), - (e.macros = At.MACROS), - e.namespace) - ) { - if (!/^[a-z]+[-]?$/.test(e.namespace)) - throw Error( - 'options.namespace must be a string of lowercase characters only' - ); - /-$/.test(e.namespace) || (e.namespace += '-'); - } - !(function t(e, i) { - const s = e.getAttribute( - 'data-' + i.namespace + 'original-content' - ); - if (s) { - const t = Fs( - s, - e.getAttribute( - 'data-' + i.namespace + 'mathstyle' - ), - i, - !1 - ); - null != t && - ((e.textContent = ''), e.appendChild(t)); - } else { - if ( - 1 === e.childNodes.length && - 3 === e.childNodes[0].nodeType - ) { - const t = e.childNodes[0].textContent; - if ( - i.TeX.processEnvironments && - /^\s*\\begin/.test(t) - ) - return ( - (e.textContent = ''), - void e.appendChild(Fs(t, void 0, i, !0)) - ); - const s = Ls(t, i.TeX.delimiters); - if (1 === s.length && 'math' === s[0].type) - return ( - (e.textContent = ''), - void e.appendChild( - Fs(s[0].data, s[0].mathstyle, i, !0) - ) - ); - if (1 === s.length && 'text' === s[0].type) - return; - } - for (let s = 0; s < e.childNodes.length; s++) { - const a = e.childNodes[s]; - if (3 === a.nodeType) { - const t = Ds(a.textContent, i); - t && - ((s += t.childNodes.length - 1), - e.replaceChild(t, a)); - } else if (1 === a.nodeType) { - const e = a.nodeName.toLowerCase(); - if ( - 'script' === e && - i.processScriptTypePattern.test(a.type) - ) { - let t = 'displaystyle'; - for (const e of a.type.split(';')) { - const i = e.split('='); - 'mode' === i[0].toLowerCase() && - (t = - 'display' === - i[1].toLoweCase() - ? 'displaystyle' - : 'textstyle'); - } - const e = Fs(a.textContent, t, i, !0); - a.parentNode.replaceChild(e, a); - } else - (i.processClassPattern.test( - a.className - ) || - (!i.skipTags.includes(e) && - !i.ignoreClassPattern.test( - a.className - ))) && - t(a, i); - } - } - } - })(t, e); - } catch (t) { - Error; - } - }, - }; - function qs(t, e, i, s) { - e = e || 'displaystyle'; - const a = n(t), - o = he.parseTokens(a, 'math', null, s); - if ('mathlist' === i) return o; - let r = te.decompose({ mathstyle: e }, o); - if (((r = N.coalesce(r)), 'span' === i)) return r; - const l = N.makeSpan(r, 'ML__base'), - c = N.makeSpan('', 'ML__strut'); - c.setStyle('height', l.height, 'em'); - const h = [c]; - if (0 !== l.depth) { - const t = N.makeSpan('', 'ML__strut--bottom'); - t.setStyle('height', l.height + l.depth, 'em'), - t.setStyle('vertical-align', -l.depth, 'em'), - h.push(t); - } - return h.push(l), N.makeSpan(h, 'ML__mathlive').toMarkup(); - } - function Is(t, e) { - if (!te.toMathML) return ''; - ((e = e || {}).macros = e.macros || {}), - Object.assign(e.macros, At.MACROS); - const i = he.parseTokens(n(t), 'math', null, e.macros); - return te.toMathML(i, e); - } - function Ps(t, e) { - if (!te.toSpeakableText) return ''; - ((e = e || {}).macros = e.macros || {}), - Object.assign(e.macros, At.MACROS); - const i = he.parseTokens(n(t), 'math', null, e.macros); - return te.toSpeakableText(i, e); - } - function Os(t, e) { - if ( - (!e && - window && - window.mathlive && - (e = window.mathlive.config), - (e = e || {}).speechEngine && 'local' !== e.speechEngine) - ) - if ('amazon' === e.speechEngine) { - if (window && window.AWS) { - const i = new window.AWS.Polly({ - apiVersion: '2016-06-10', - }), - s = { - OutputFormat: 'mp3', - VoiceId: e.speechEngineVoice || 'Joanna', - Text: t, - TextType: 'ssml', - }; - i.synthesizeSpeech(s, function(t, e) { - if (t); - else if (e && e.AudioStream) { - const t = new Uint8Array(e.AudioStream), - i = new Blob([t.buffer], { - type: 'audio/mpeg', - }), - s = URL.createObjectURL(i); - new Audio(s).play().catch(t => {}); - } - }); - } - } else e.speechEngine; - else { - const e = new SpeechSynthesisUtterance(t); - window && window.speechSynthesis.speak(e); - } - } - function Bs(t, e, i) { - if (!window) return; - if ( - (!i && window.mathlive && (i = window.mathlive.config), - 'amazon' !== (i = i || {}).speechEngine) - ) - return void (i.handleSpeak && i.handleSpeak(e)); - if (!window.AWS) return; - const s = new window.AWS.Polly({ apiVersion: '2016-06-10' }), - a = { - OutputFormat: 'json', - VoiceId: i.speechEngineVoice || 'Joanna', - Text: e, - TextType: 'ssml', - SpeechMarkTypes: ['ssml'], - }; - (window.mathlive = window.mathlive || {}), - (window.mathlive.readAloudElement = t); - const o = i.onReadAloudStatus || window.mathlive.onReadAloudStatus; - s.synthesizeSpeech(a, function(t, e) { - if (t); - else if (e && e.AudioStream) { - const t = new TextDecoder('utf-8').decode( - new Uint8Array(e.AudioStream) - ); - (window.mathlive.readAloudMarks = t - .split('\n') - .map(t => (t ? JSON.parse(t) : {}))), - (window.mathlive.readAloudTokens = []); - for (const t of window.mathlive.readAloudMarks) - t.value && - window.mathlive.readAloudTokens.push(t.value); - (window.mathlive.readAloudCurrentMark = ''), - (a.OutputFormat = 'mp3'), - (a.SpeechMarkTypes = []), - s.synthesizeSpeech(a, function(t, e) { - if (t); - else if (e && e.AudioStream) { - const t = new Uint8Array(e.AudioStream), - i = new Blob([t.buffer], { - type: 'audio/mpeg', - }), - s = URL.createObjectURL(i); - window.mathlive.readAloudAudio - ? window.mathlive.readAloudAudio.pause() - : ((window.mathlive.readAloudAudio = new Audio()), - window.mathlive.readAloudAudio.addEventListener( - 'ended', - () => { - o && - o( - window.mathlive - .readAloudMathField, - 'ended' - ), - window.mathlive - .readAloudMathField - ? (window.mathlive.readAloudMathField._render(), - (window.mathlive.readAloudElement = null), - (window.mathlive.readAloudMathField = null), - (window.mathlive.readAloudTokens = []), - (window.mathlive.readAloudMarks = []), - (window.mathlive.readAloudCurrentMark = - '')) - : (function t(e) { - e.classList.remove( - 'highlight' - ), - e.children && - Array.from( - e.children - ).forEach( - e => { - t( - e - ); - } - ); - })( - window.mathlive - .readAloudElement - ); - } - ), - window.mathlive.readAloudAudio.addEventListener( - 'timeupdate', - () => { - let t = ''; - const e = - 1e3 * - window.mathlive - .readAloudAudio - .currentTime + - 100; - for (const i of window.mathlive - .readAloudMarks) - i.time < e && (t = i.value); - window.mathlive - .readAloudCurrentMark !== t && - ((window.mathlive.readAloudCurrentToken = t), - t && - t === - window.mathlive - .readAloudFinalToken - ? window.mathlive.readAloudAudio.pause() - : ((window.mathlive.readAloudCurrentMark = t), - (function t(e, i) { - i && - e.dataset.atomId !== - i - ? (e.classList.remove( - 'highlight' - ), - e.children && - e.children - .length > - 0 && - Array.from( - e.children - ).forEach( - e => { - t( - e, - i - ); - } - )) - : (e.classList.add( - 'highlight' - ), - e.children && - e.children - .length > - 0 && - Array.from( - e.children - ).forEach( - e => { - t( - e - ); - } - )); - })( - window.mathlive - .readAloudElement, - window.mathlive - .readAloudCurrentMark - ))); - } - )), - (window.mathlive.readAloudAudio.src = s), - o && - o( - window.mathlive.readAloudMathField, - 'playing' - ), - window.mathlive.readAloudAudio.play(); - } - }); - } - }); - } - function $s(t) { - let e = t; - if ('string' == typeof t && ((e = document.getElementById(t)), !e)) - throw Error(`The element with ID "${t}" could not be found.`); - return e; - } - function Rs(t, e) { - Es && - (((e = e || {}).renderToMarkup = e.renderToMarkup || qs), - (e.renderToMathML = e.renderToMathML || Is), - (e.renderToSpeakableText = e.renderToSpeakableText || Ps), - (e.macros = e.macros || At.MACROS), - Es.renderMathInElement($s(t), e)); - } - function Ks(t) { - if (t.namespace) { - if (!/^[a-z]+[-]?$/.test(t.namespace)) - throw Error( - 'options.namespace must be a string of lowercase characters only' - ); - /-$/.test(t.namespace) || (t.namespace += '-'); - } - } - return { - latexToMarkup: qs, - latexToMathML: Is, - latexToSpeakableText: Ps, - latexToAST: function(t, e) { - if (!te.toAST) return {}; - ((e = e || {}).macros = e.macros || {}), - Object.assign(e.macros, At.MACROS); - const i = he.parseTokens(n(t), 'math', null, e.macros); - return te.toAST(i, e); - }, - astToLatex: function(t, e) { - return ps(t, e); - }, - makeMathField: function(t, e) { - if (!Cs) throw Error('The MathField module is not loaded.'); - return ( - ((e = e || {}).handleSpeak = e.handleSpeak || Os), - (e.handleReadAloud = e.handleReadAloud || Bs), - new Cs.MathField($s(t), e) - ); - }, - renderMathInDocument: function(t) { - Rs(document.body, t); - }, - renderMathInElement: Rs, - revertToOriginalContent: function(t, e) { - (t = (t = $s(t)).children[1]) instanceof Cs.MathField - ? t.revertToOriginalContent() - : (Ks((e = e || {})), - (t.innerHTML = t.getAttribute( - 'data-' + (e.namespace || '') + 'original-content' - ))); - }, - getOriginalContent: function(t, e) { - return (t = (t = $s(t)).children[1]) instanceof Cs.MathField - ? t.originalContent - : (Ks((e = e || {})), - t.getAttribute( - 'data-' + (e.namespace || '') + 'original-content' - )); - }, - readAloud: Bs, - readAloudStatus: function() { - return window - ? ((window.mathlive = window.mathlive || {}), - window.mathlive.readAloudAudio - ? window.mathlive.readAloudAudio.paused - ? 'paused' - : window.mathlive.readAloudAudio.ended - ? 'ready' - : 'playing' - : 'ready') - : 'unavailable'; - }, - pauseReadAloud: function() { - window && - ((window.mathlive = window.mathlive || {}), - window.mathlive.readAloudAudio && - (window.mathlive.onReadAloudStatus && - window.mathlive.onReadAloudStatus( - window.mathlive.readAloudMathField, - 'paused' - ), - window.mathlive.readAloudAudio.pause())); - }, - resumeReadAloud: function() { - window && - ((window.mathlive = window.mathlive || {}), - window.mathlive.readAloudAudio && - (window.mathlive.onReadAloudStatus && - window.mathlive.onReadAloudStatus( - window.mathlive.readAloudMathField, - 'playing' - ), - window.mathlive.readAloudAudio.play())); - }, - playReadAloud: function(t, e) { - if ( - window && - ((window.mathlive = window.mathlive || {}), - window.mathlive.readAloudAudio) - ) { - let i = 0; - if (((window.mathlive.readAloudFinalToken = null), t)) { - window.mathlive.readAloudMarks = - window.mathlive.readAloudMarks || []; - for (const e of window.mathlive.readAloudMarks) - e.value === t && (i = e.time / 1e3); - let s = window.mathlive.readAloudTokens.indexOf(t); - s >= 0 && - ((s += e), - s < window.mathlive.readAloudTokens.length && - (window.mathlive.readAloudFinalToken = s)); - } - (window.mathlive.readAloudAudio.currentTime = i), - window.mathlive.onReadAloudStatus && - window.mathlive.onReadAloudStatus( - window.mathlive.readAloudMathField, - 'playing' - ), - window.mathlive.readAloudAudio.play(); - } - }, - }; - }), - 'object' == typeof exports && 'undefined' != typeof module - ? (module.exports = factory()) - : 'function' == typeof define && define.amd - ? define(factory) - : ((global = global || self).MathLive = factory()); +var global,factory;global=this,factory=function(){function t(t,e){e=e||0;const i=t.charCodeAt(e);if(55296<=i&&i<=56319&&e=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function O(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return O(i[0],e)}return new L(t,e)}function B(t,e,i){const s=O(e,i);return s.type=t,s}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=O([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=O(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=$(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=N.makeSymbol,Ct=N.makeSpan,_t=N.makeVlist;function Tt(t,e,i,s,a,o){const n=Mt("Size"+i+"-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,Ct(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+i)}function Ft(t,e,i,s,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Ot=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Bt(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return $t(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?It:Dt.includes(e)?Ot:Pt;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(At.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Tt(t,e,r.size,s,a,o):Ft(t,e,i,s,a,o)}function $t(t,e,i){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Rt={makeSizedDelim:function(t,e,i,s,a){return"."===e?$t(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,i,!1,s,a):zt.includes(e)?Ft(t,e,qt[i],!1,s,a):null)},makeCustomSizedDelim:Bt,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return $t(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Bt(t,e,h,!0,a,o)}};const Kt=N.makeSpan,Nt=N.makeOrd,Wt=N.makeInner,Ht=N.makeHlist,Vt=N.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=Nt(Qt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(i)+N.depth(i)+o&&(o=(o+l-(N.height(i)+N.depth(i)))/2),r.setTop(r.height-N.height(i)-(o+s));const c=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Vt(t,[i,o,c,s]);if(!this.index)return this.bind(t,Nt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Kt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,Nt([Kt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,Nt(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=N.skew(i));const a=Math.min(N.height(i),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Kt(Kt(o),"accent-body"+n);return r=Vt(t,[i,-a,r]),r.children[1].setLeft(2*s),Nt(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Qt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[i,3*s,a,s]);else{const e=Kt(i);o=Vt(t,[s,a,3*s,e],"top",N.height(e))}return Nt(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?Kt(Qt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?Kt(Qt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Yt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Kt(Qt(t,this.body),"inner");return Nt([e,Kt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=Nt("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=N.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=N.makeOp(Qt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=Nt(Qt(t,this.body)),i=Kt();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=Kt([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=Nt(Qt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=Kt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(Array.isArray(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Kt(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Kt(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-s.metrics.supDrop,l=N.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*i){l=4*i-(r-a.depth)+N.height(o);const t=.8*s.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,N.height(o)-.8*s.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Kt(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?Kt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Kt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=N.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Xt(t){const e=Kt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,i,s){const a=[];for(const o of e){const e=Kt(Qt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Vt(t,a,"individualShift")}function Yt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=Kt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+i;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=N.height(e)-i;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=N.depth(e)+i;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return N.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const i=new Zt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Zt("","first")),i},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},ie={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var se=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in ie)if(ie[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return se(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new re("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=At.getInfo("\\"+i.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new re(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=At.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=se(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=At.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new re(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=At.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new re(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[i])return ue[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=fe[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=xe(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(i.test(xe(ue[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ce(t,e){let i;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Oe()),i}function _e(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Te(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new te.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function Le(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ce(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(De(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||De(t[i],e)})))return!0;if(t.array)for(let i=_e(t.array);i>=0;i--)if(De(Ce(t.array,i),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Ie(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=qe(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Ie(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Ie(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Ie(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=qe(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=Pe(i[1],e),t+=qe(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Ie(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=qe(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=Pe(i[1],e),t+=qe(i[2],e),s=!0)),!s)if(i=Ie(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Ie(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+qe(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+qe(i.rest,e):i.match+qe(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+qe(i[2],e),s=!0)),t}function Ie(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=ve.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function Pe(t,e){let i=ve.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Oe(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},we.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new we;s.path=me.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},we.prototype.setRange=function(t,e,i){i=i||{};const s=me.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),s)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Oe()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&At.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=_e(e.array);i>=0;i--)t(Ce(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},we.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=_e(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=Se(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},we.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},we.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},we.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=At.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new te.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Oe()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Oe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Oe()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Oe()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Oe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Oe()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Oe()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Me(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=Ae(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=At.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Be={EditableMathlist:we,parseMathString:Ee};const $e={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Re={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ke={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Ne(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=Ke[t.target.value]||t.target.value),e||($e[t.key]?(e=$e[t.key],i=!1):e=Re[t.key],e||(e=Ke[t.key.toLowerCase()])),!e&&t.code&&(e=Re[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function We(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke(Ne(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke(Ne(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:Ne,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&Ze(t,i),t.popover.classList.add("is-visible")}function Ze(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Xe(t);const s=e,a=function(t,e){const i=he.parseTokens(n(t),"math",null,e.config.macros),s=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=N.makeSpan(s,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[s]||e,t),o=je(s),r=ve.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else if("mode"===e)for(;t[s]&&t[s][e]===i;)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Ye(this,this.array[s][e],t);s1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Ye(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Ye(this,this.shift,t)}em]`),i+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Ye(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ae(this.backgroundcolor)}}`),i+=`{${Ye(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Qe.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Qe.locale.substring(0,2),a="ordinal"===i.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[s]&&(o=Qe.strings[s][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const i=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ti={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ei={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ii={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let si={};const ai={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function oi(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=he.parseTokens(n(t),"math",e,i.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ni(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ti,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function ri(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ei[n]&&(a.setAttribute("data-shifted",ei[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ei[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=si[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function li(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ci={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ii["foreground-color"]=[];for(const t of ne)ii["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ii["background-color"]=[];for(const t of oe)ii["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});si={...ii},Object.keys(si).forEach(t=>{si[t]=si[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),si[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),si[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),si[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ai,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ti,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ni(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=li(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,ri(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:ri};const hi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},di={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},pi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function mi(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ui(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,gi(t)&&(n=t.index,t.index+=1),yi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=Si(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,gi(t)){const e=Si(t.atoms[n].superscript,0,0,i).mathML,s=Si(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=Si(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function gi(t){return t.index"+t,a+=Si(o.subscript,0,0,i).mathML,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=Si(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function xi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&gi(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Si(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function vi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Ai(t.atoms[l],i),a+=Si(t.atoms,l+1,c,i).mathML,a+=Ai(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function wi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Mi(e.body)+"":Ai(e,i);a+=r,t.index+=1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function Si(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Ai(t,e){let i="";const s=Mi(t.body);return s&&(i=""+s+""),i}function Mi(t){if(!t)return"";if("string"==typeof t)return mi(t);if(!Array.isArray(t)&&"string"==typeof t.body)return mi(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return mi(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Si(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(pi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+Si(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(pi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Si(this.numer,0,0,t).mathML||" ",c+=Si(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Si(this.numer,0,0,t).mathML+"",c+=""+Si(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Si(this.body,0,0,t).mathML,c+=Si(this.index,0,0,t).mathML,c+=""):(c+="",c+=Si(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Si(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(pi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Si(this.body,0,0,t).mathML,c+=""+(pi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):r?(c+=""+Si(l,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):n&&(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+ui(this.id,t)+">"+mi(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&pi[p]?""+pi[p]+"":Ai(this,t);break;case"mpunct":c='"+(pi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Si(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Si(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Si(t,0,0,e).mathML};const Ci={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_i={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ti={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Li={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fi(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Di(t){return t&&Li[t]||-1}function zi(t){return/=|=>/.test(t)?"right":"left"}function Ei(t){if("f"===t||"g"===t)return!0;const e=Ti[t];return!!e&&!!/%[^01_^]?/.test(e)}function qi(t){t=(t||"").trim();let e=Ci[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=At.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Ii(t){if(!t)return null;const e=qi(Ki(t)),i=[Di(e),zi(e)];return i[0]<=0?null:i}function Pi(t){return null!==Ii(t)}const Oi={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Bi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},$i={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Ri={",":"list",";":"list2"};function Ki(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const i of t)e+=Ki(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=Ki(i);return e}return""}function Ni(t){return"string"==typeof t.sym?function(t){let e=Ti[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=At.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Wi(t){return parseFloat(t.num)}function Hi(t){return"object"==typeof t&&void 0!==t.num}function Vi(t){let e=0;return Hi(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hs(t.num.re):0:parseFloat(t.num)),e}function Ui(t){let e=0;return Hi(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hs(t.num.im):0),e}function ji(t){return t&&void 0!==t.sup}function Gi(t){return t&&void 0!==t.sub}function Zi(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||Ki(a)===i),s}function Xi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Ji(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Yi(t){if(Hi(t)){const e=Vi(t),i=Ui(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Xi("negate",t)}function Qi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ts(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=rs(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test(Ki(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test(Ki(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ki(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=rs(i.superscript,e)):t.ast.sup=rs(i.superscript,e))):t.index+=1,t}function es(t,e){const i=t.ast;if(ss(t,"!!"))return t.index+=1,t.ast=Xi("factorial2",i),es(t=ts(t,e),e);if(ss(t,"++"))return t.index+=1,t.ast=Xi("increment",i),es(t=ts(t,e),e);if(ss(t,"--"))return t.index+=1,t.ast=Xi("decrement",i),es(t=ts(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Bi[s.latex.trim()]&&(t.ast=Xi(Bi[s.latex.trim()],i),t=es(t=ts(t,e),e)),t}function is(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ki(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"mclose"===o.type&&Ki(o)===i&&(Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s));else if("textord"===o.type&&Ki(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"textord"===o.type&&Ki(o)===i&&(t.index+=1,t=es(t=ts(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=os(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=es(t=ts(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=es(t=ts(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=rs(o.body,s),Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=At.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=At.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=is(t,e,i))return s&&(t.index+=1),t.ast={fn:Oi[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function ss(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ki(t.atoms[t.index])+Ki(t.atoms[t.index+1])}function as(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zi(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,Zi(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zi(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function os(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qi(Ki(s));if(as(e))e.ast=Xi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Yi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Xi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ns(t)))),e=[t])}return e}function rs(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=os(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Xi("text",...i):i[0]||void 0}({atoms:ns(t)},e)}function ls(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function cs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hs(t){return parseFloat(parseFloat(t).toPrecision(15))}function ds(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=cs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=cs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=cs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=hs(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=cs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=cs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}te.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=he.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=he.parseTokens(n(s),"math",null,t.macros),o=Xi("divide",rs(i,t),rs(s,t))):o.fn="divide"):o.group=rs(this.body,t);break;case"genfrac":o=Xi("divide",rs(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Ji(1):rs(this.denom,t));break;case"surd":o=this.index?Xi("pow",rs(this.body,t),Xi("divide",Ji(1),rs(this.index,t))):Xi("sqrt",rs(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qi(Ki(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=rs(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xi("card",rs(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>rs(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(rs(e[0],t));let s=rs(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return rs(t,e)};var ps=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hi(e)){const i=Wi(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":ds(e.num,s);else{const t=Vi(e),i=Ui(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ds(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?ds(i,s):"")+"\\imaginaryI "))}ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Hi(e.group)||Ni(e.group)?0!==Ui(e.group)&&(a=ls(e.fence||"(),",a)):a=ls(e.fence||"(),",a),ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fi(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Fi(e,1));else{let i="";for(let s=1;s=2)a=t(Fi(e,0),s),Hi(Fi(e,0))||Ni(Fi(e,0))||(a=ls(e.fence||"(),",a)),a+="^{"+t(Fi(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ti[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ls(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fi(e,0),s),r=t(Fi(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ls(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ls(e.fence||"(),","");a=ji(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Gi(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ls("() ",t(a,s))):0!==Vi(o=a)&&0!==Ui(o)?i.push(ls("() ",t(a,s))):ji(e)&&0!==Ui(a)&&1!==Ui(a)?i.push(ls("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hi(e.arg[0])&&"divide"!==e.arg[0].fn||Hi(e.arg[1])&&(0!==Vi(e.arg[1])||1!==Ui(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hi(e.arg[0])&&Wi(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function us(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function fs(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function gs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function ys(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function bs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function xs(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ks(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let i=te.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else us(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ms[t.leftDelim]||t.leftDelim,s+=te.toSpeakableFragment(t.body,e),s+=ms[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ms[a]||(o?ms[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ms[t.body]||ms[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),us(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(us(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),us(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},te.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=te.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=te.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class vs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gs(this.element,"focus",this),gs(this.element,"blur",this),gs(this.textarea,"cut",this),gs(this.textarea,"copy",this),gs(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gs(this.field,"pointerdown",this):gs(this.field,"touchstart:active mousedown",this),gs(window,"resize",this);const o={...e};o.onSelectionDidChange=vs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Be.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ks(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ys(this.textarea,"cut",this),ys(this.textarea,"copy",this),ys(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xs(this.popover),xs(this.keystrokeCaption),xs(this.virtualKeyboard),xs(document.getElementById("mathlive-alternate-keys-panel")),ys(this.element,"pointerdown",this),ys(this.element,"touchstart:active mousedown",this),ys(this.element,"focus",this),ys(this.element,"blur",this),ys(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=me.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){if(this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,i=this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=me.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||Ss>2?(n(t),3!==t.detail&&3!==Ss||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(gs(e.field,"pointermove",h),gs(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gs(window,"blur",n),t.touches?(gs(t.target,"touchmove",h),gs(t.target,"touchend",n)):(gs(window,"mousemove",h),gs(window,"mouseup",n))),2!==t.detail&&2!==Ss||(a=!0,this.mathlist.selectGroup_()))}}else ws=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return As(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=As(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=ve.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=At.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;iks(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),e+=1,t=this.mathlist.ancestor(e)}const i=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=N.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=hi[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&hi[a]?hi[a]:a&&di[a]?di[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=di[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=te.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const i=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=he.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Je.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gs(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),gs(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gs(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ci.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xs(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=te.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ws,Ss=0;function As(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(i,s)}function Ms(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=As(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=As(t,"",t.mathlist.sibling(0)):"line"===e?(a=As(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?As(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vs.prototype.undo_=vs.prototype.undo,vs.prototype.redo_=vs.prototype.redo,vs.prototype.scrollIntoView_=vs.prototype.scrollIntoView,vs.prototype.scrollToStart_=vs.prototype.scrollToStart,vs.prototype.scrollToEnd_=vs.prototype.scrollToEnd,vs.prototype.insert_=vs.prototype.$insert;var Cs={isValidMathfield:ks,MathField:vs};function _s(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_s(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ds(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Fs(t,void 0,e,!0));else{const s=Ls(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Bs(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function $s(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Rs(t,e){Es&&((e=e||{}).renderToMarkup=e.renderToMarkup||qs,e.renderToMathML=e.renderToMathML||Is,e.renderToSpeakableText=e.renderToSpeakableText||Ps,e.macros=e.macros||At.MACROS,Es.renderMathInElement($s(t),e))}function Ks(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}return{latexToMarkup:qs,latexToMathML:Is,latexToSpeakableText:Ps,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const i=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(i,e)},astToLatex:function(t,e){return ps(t,e)},makeMathField:function(t,e){if(!Cs)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Os,e.handleReadAloud=e.handleReadAloud||Bs,new Cs.MathField($s(t),e)},renderMathInDocument:function(t){Rs(document.body,t)},renderMathInElement:Rs,revertToOriginalContent:function(t,e){(t=(t=$s(t)).children[1])instanceof Cs.MathField?t.revertToOriginalContent():(Ks(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=$s(t)).children[1])instanceof Cs.MathField?t.originalContent:(Ks(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Bs,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s Date: Thu, 6 Feb 2020 07:13:31 -0800 Subject: [PATCH 18/28] bug: Fix #372 when substituting a multi-token argument, do not insert a group --- src/core/parser.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/core/parser.js b/src/core/parser.js index 2166d5be6..8b9b78427 100644 --- a/src/core/parser.js +++ b/src/core/parser.js @@ -1360,22 +1360,13 @@ class Parser { } } } else if (token.type === '#') { - // Parameter token in an implicit group (not as a parameter) + // Parameter token if (token.value === '?') { // '#?' indicates that a placeholder should be used result = this.placeholder(); } else if (this.args) { - result = this.args[token.value] || null; - if (Array.isArray(result) && result.length === 1) { - result = result[0]; - } else if (Array.isArray(result)) { - const group = new MathAtom(this.parseMode, 'group'); - group.body = result; - result = group; - } else { - // If there is no argument value specified, use a placeholder - result = this.placeholder(); - } + // Otherwise, substitute the token with a provided argument + result = this.args[token.value] || this.placeholder(); } } else { console.warn( From f404735385d8492baf8691f52b9ddebb25a5391c Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Thu, 6 Feb 2020 07:49:56 -0800 Subject: [PATCH 19/28] bug: fix #371 --- src/editor/editor-mathfield.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/editor/editor-mathfield.js b/src/editor/editor-mathfield.js index 9b1d39552..a09a7316e 100644 --- a/src/editor/editor-mathfield.js +++ b/src/editor/editor-mathfield.js @@ -866,7 +866,22 @@ class MathField { // smart mode this._resetKeystrokeBuffer(); this.smartModeSuppressed = false; - anchor = this._pathFromPoint(anchorX, anchorY, { bias: 0 }); + + const wrapperBounds = this.field + .querySelector('.ML__mathlive') + .getBoundingClientRect(); + if (anchorX > wrapperBounds.right) { + // If outside the bounds of the rendered formula, + // set the anchor to the last element of the root + anchor = [ + { + relation: 'body', + offset: this.mathlist.root.body.length - 1, + }, + ]; + } else { + anchor = this._pathFromPoint(anchorX, anchorY, { bias: 0 }); + } if (anchor) { // Create divs to block out pointer tracking to the left and right of // the mathfield (to avoid triggering the hover of the virtual From 0ab0500004e65bd8cbfb80db1bb0f0eac9eed88d Mon Sep 17 00:00:00 2001 From: Arno Gourdol Date: Thu, 6 Feb 2020 07:59:40 -0800 Subject: [PATCH 20/28] dist --- CHANGELOG.md | 8 ++++++++ dist/mathlive.js | 2 +- dist/mathlive.mjs | 2 +- dist/src/core/parser.js | 15 +++------------ dist/src/editor/editor-mathfield.js | 17 ++++++++++++++++- 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eeca9d140..40f659202 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0. + +### Bug Fixes + +- #371: When clicking after the last element in the mathfield, always set the anchor to be the last element in the root, i.e. as if `moveToMathFieldEnd` had been performed. For example, if the content is "x^2", clicking after the end of the field will put the caret after the last element (not after the "2" in the superscript) + +- #372: Using an argument in a macro will result in the argument to be substituted without a group being inserted. Previously, `#1` with `ax` as a value for the first argument would have resulted in `{ax}`. This was noticeable when using the `x^2` key in the virtual keyboard: if the equation was `ab`, pressing that key resulted in `{ab}^2`. It now results in `ab^2` + ## 0.34 (Feb 5, 2020) ### Bug Fixes diff --git a/dist/mathlive.js b/dist/mathlive.js index f13cf39ef..9838b12a9 100644 --- a/dist/mathlive.js +++ b/dist/mathlive.js @@ -1 +1 @@ -var global,factory;global=this,factory=function(){function t(t,e){e=e||0;const i=t.charCodeAt(e);if(55296<=i&&i<=56319&&e=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function O(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return O(i[0],e)}return new L(t,e)}function B(t,e,i){const s=O(e,i);return s.type=t,s}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=O([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=O(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=$(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=N.makeSymbol,Ct=N.makeSpan,_t=N.makeVlist;function Tt(t,e,i,s,a,o){const n=Mt("Size"+i+"-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,Ct(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+i)}function Ft(t,e,i,s,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Ot=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Bt(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return $t(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?It:Dt.includes(e)?Ot:Pt;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(At.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Tt(t,e,r.size,s,a,o):Ft(t,e,i,s,a,o)}function $t(t,e,i){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Rt={makeSizedDelim:function(t,e,i,s,a){return"."===e?$t(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,i,!1,s,a):zt.includes(e)?Ft(t,e,qt[i],!1,s,a):null)},makeCustomSizedDelim:Bt,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return $t(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Bt(t,e,h,!0,a,o)}};const Kt=N.makeSpan,Nt=N.makeOrd,Wt=N.makeInner,Ht=N.makeHlist,Vt=N.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=Nt(Qt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(i)+N.depth(i)+o&&(o=(o+l-(N.height(i)+N.depth(i)))/2),r.setTop(r.height-N.height(i)-(o+s));const c=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Vt(t,[i,o,c,s]);if(!this.index)return this.bind(t,Nt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Kt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,Nt([Kt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,Nt(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=N.skew(i));const a=Math.min(N.height(i),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Kt(Kt(o),"accent-body"+n);return r=Vt(t,[i,-a,r]),r.children[1].setLeft(2*s),Nt(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Qt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[i,3*s,a,s]);else{const e=Kt(i);o=Vt(t,[s,a,3*s,e],"top",N.height(e))}return Nt(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?Kt(Qt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?Kt(Qt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Yt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Kt(Qt(t,this.body),"inner");return Nt([e,Kt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=Nt("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=N.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=N.makeOp(Qt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=Nt(Qt(t,this.body)),i=Kt();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=Kt([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=Nt(Qt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=Kt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(Array.isArray(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Kt(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Kt(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-s.metrics.supDrop,l=N.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*i){l=4*i-(r-a.depth)+N.height(o);const t=.8*s.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,N.height(o)-.8*s.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Kt(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?Kt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Kt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=N.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Xt(t){const e=Kt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,i,s){const a=[];for(const o of e){const e=Kt(Qt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Vt(t,a,"individualShift")}function Yt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=Kt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+i;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=N.height(e)-i;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=N.depth(e)+i;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return N.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const i=new Zt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Zt("","first")),i},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},ie={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var se=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in ie)if(ie[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return se(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new re("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=At.getInfo("\\"+i.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new re(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=At.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=se(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=At.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new re(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=At.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new re(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[i])return ue[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=fe[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=xe(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(i.test(xe(ue[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ce(t,e){let i;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Oe()),i}function _e(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Te(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new te.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function Le(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ce(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(De(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||De(t[i],e)})))return!0;if(t.array)for(let i=_e(t.array);i>=0;i--)if(De(Ce(t.array,i),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Ie(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=qe(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Ie(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Ie(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Ie(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=qe(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=Pe(i[1],e),t+=qe(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Ie(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=qe(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=Pe(i[1],e),t+=qe(i[2],e),s=!0)),!s)if(i=Ie(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Ie(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+qe(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+qe(i.rest,e):i.match+qe(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+qe(i[2],e),s=!0)),t}function Ie(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=ve.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function Pe(t,e){let i=ve.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Oe(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},we.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new we;s.path=me.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},we.prototype.setRange=function(t,e,i){i=i||{};const s=me.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),s)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Oe()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&At.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=_e(e.array);i>=0;i--)t(Ce(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},we.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=_e(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=Se(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},we.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},we.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},we.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=At.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new te.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Oe()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Oe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Oe()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Oe()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Oe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Oe()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Oe()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Me(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=Ae(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=At.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Be={EditableMathlist:we,parseMathString:Ee};const $e={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Re={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ke={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Ne(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=Ke[t.target.value]||t.target.value),e||($e[t.key]?(e=$e[t.key],i=!1):e=Re[t.key],e||(e=Ke[t.key.toLowerCase()])),!e&&t.code&&(e=Re[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function We(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke(Ne(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke(Ne(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:Ne,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&Ze(t,i),t.popover.classList.add("is-visible")}function Ze(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Xe(t);const s=e,a=function(t,e){const i=he.parseTokens(n(t),"math",null,e.config.macros),s=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=N.makeSpan(s,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[s]||e,t),o=je(s),r=ve.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else if("mode"===e)for(;t[s]&&t[s][e]===i;)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Ye(this,this.array[s][e],t);s1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Ye(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Ye(this,this.shift,t)}em]`),i+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Ye(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ae(this.backgroundcolor)}}`),i+=`{${Ye(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Qe.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Qe.locale.substring(0,2),a="ordinal"===i.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[s]&&(o=Qe.strings[s][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const i=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ti={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ei={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ii={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let si={};const ai={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function oi(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=he.parseTokens(n(t),"math",e,i.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ni(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ti,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function ri(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ei[n]&&(a.setAttribute("data-shifted",ei[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ei[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=si[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function li(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ci={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ii["foreground-color"]=[];for(const t of ne)ii["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ii["background-color"]=[];for(const t of oe)ii["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});si={...ii},Object.keys(si).forEach(t=>{si[t]=si[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),si[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),si[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),si[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ai,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ti,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ni(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=li(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,ri(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:ri};const hi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},di={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},pi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function mi(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ui(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,gi(t)&&(n=t.index,t.index+=1),yi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=Si(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,gi(t)){const e=Si(t.atoms[n].superscript,0,0,i).mathML,s=Si(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=Si(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function gi(t){return t.index"+t,a+=Si(o.subscript,0,0,i).mathML,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=Si(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function xi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&gi(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Si(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function vi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Ai(t.atoms[l],i),a+=Si(t.atoms,l+1,c,i).mathML,a+=Ai(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function wi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Mi(e.body)+"":Ai(e,i);a+=r,t.index+=1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function Si(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Ai(t,e){let i="";const s=Mi(t.body);return s&&(i=""+s+""),i}function Mi(t){if(!t)return"";if("string"==typeof t)return mi(t);if(!Array.isArray(t)&&"string"==typeof t.body)return mi(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return mi(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Si(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(pi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+Si(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(pi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Si(this.numer,0,0,t).mathML||" ",c+=Si(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Si(this.numer,0,0,t).mathML+"",c+=""+Si(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Si(this.body,0,0,t).mathML,c+=Si(this.index,0,0,t).mathML,c+=""):(c+="",c+=Si(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Si(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(pi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Si(this.body,0,0,t).mathML,c+=""+(pi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):r?(c+=""+Si(l,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):n&&(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+ui(this.id,t)+">"+mi(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&pi[p]?""+pi[p]+"":Ai(this,t);break;case"mpunct":c='"+(pi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Si(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Si(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Si(t,0,0,e).mathML};const Ci={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_i={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ti={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Li={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fi(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Di(t){return t&&Li[t]||-1}function zi(t){return/=|=>/.test(t)?"right":"left"}function Ei(t){if("f"===t||"g"===t)return!0;const e=Ti[t];return!!e&&!!/%[^01_^]?/.test(e)}function qi(t){t=(t||"").trim();let e=Ci[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=At.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Ii(t){if(!t)return null;const e=qi(Ki(t)),i=[Di(e),zi(e)];return i[0]<=0?null:i}function Pi(t){return null!==Ii(t)}const Oi={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Bi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},$i={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Ri={",":"list",";":"list2"};function Ki(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const i of t)e+=Ki(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=Ki(i);return e}return""}function Ni(t){return"string"==typeof t.sym?function(t){let e=Ti[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=At.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Wi(t){return parseFloat(t.num)}function Hi(t){return"object"==typeof t&&void 0!==t.num}function Vi(t){let e=0;return Hi(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hs(t.num.re):0:parseFloat(t.num)),e}function Ui(t){let e=0;return Hi(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hs(t.num.im):0),e}function ji(t){return t&&void 0!==t.sup}function Gi(t){return t&&void 0!==t.sub}function Zi(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||Ki(a)===i),s}function Xi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Ji(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Yi(t){if(Hi(t)){const e=Vi(t),i=Ui(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Xi("negate",t)}function Qi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ts(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=rs(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test(Ki(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test(Ki(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ki(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=rs(i.superscript,e)):t.ast.sup=rs(i.superscript,e))):t.index+=1,t}function es(t,e){const i=t.ast;if(ss(t,"!!"))return t.index+=1,t.ast=Xi("factorial2",i),es(t=ts(t,e),e);if(ss(t,"++"))return t.index+=1,t.ast=Xi("increment",i),es(t=ts(t,e),e);if(ss(t,"--"))return t.index+=1,t.ast=Xi("decrement",i),es(t=ts(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Bi[s.latex.trim()]&&(t.ast=Xi(Bi[s.latex.trim()],i),t=es(t=ts(t,e),e)),t}function is(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ki(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"mclose"===o.type&&Ki(o)===i&&(Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s));else if("textord"===o.type&&Ki(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"textord"===o.type&&Ki(o)===i&&(t.index+=1,t=es(t=ts(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=os(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=es(t=ts(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=es(t=ts(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=rs(o.body,s),Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=At.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=At.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=is(t,e,i))return s&&(t.index+=1),t.ast={fn:Oi[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function ss(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ki(t.atoms[t.index])+Ki(t.atoms[t.index+1])}function as(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zi(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,Zi(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zi(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function os(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qi(Ki(s));if(as(e))e.ast=Xi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Yi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Xi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ns(t)))),e=[t])}return e}function rs(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=os(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Xi("text",...i):i[0]||void 0}({atoms:ns(t)},e)}function ls(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function cs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hs(t){return parseFloat(parseFloat(t).toPrecision(15))}function ds(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=cs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=cs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=cs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=hs(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=cs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=cs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}te.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=he.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=he.parseTokens(n(s),"math",null,t.macros),o=Xi("divide",rs(i,t),rs(s,t))):o.fn="divide"):o.group=rs(this.body,t);break;case"genfrac":o=Xi("divide",rs(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Ji(1):rs(this.denom,t));break;case"surd":o=this.index?Xi("pow",rs(this.body,t),Xi("divide",Ji(1),rs(this.index,t))):Xi("sqrt",rs(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qi(Ki(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=rs(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xi("card",rs(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>rs(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(rs(e[0],t));let s=rs(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return rs(t,e)};var ps=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hi(e)){const i=Wi(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":ds(e.num,s);else{const t=Vi(e),i=Ui(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ds(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?ds(i,s):"")+"\\imaginaryI "))}ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Hi(e.group)||Ni(e.group)?0!==Ui(e.group)&&(a=ls(e.fence||"(),",a)):a=ls(e.fence||"(),",a),ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fi(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Fi(e,1));else{let i="";for(let s=1;s=2)a=t(Fi(e,0),s),Hi(Fi(e,0))||Ni(Fi(e,0))||(a=ls(e.fence||"(),",a)),a+="^{"+t(Fi(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ti[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ls(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fi(e,0),s),r=t(Fi(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ls(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ls(e.fence||"(),","");a=ji(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Gi(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ls("() ",t(a,s))):0!==Vi(o=a)&&0!==Ui(o)?i.push(ls("() ",t(a,s))):ji(e)&&0!==Ui(a)&&1!==Ui(a)?i.push(ls("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hi(e.arg[0])&&"divide"!==e.arg[0].fn||Hi(e.arg[1])&&(0!==Vi(e.arg[1])||1!==Ui(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hi(e.arg[0])&&Wi(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function us(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function fs(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function gs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function ys(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function bs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function xs(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ks(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let i=te.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else us(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ms[t.leftDelim]||t.leftDelim,s+=te.toSpeakableFragment(t.body,e),s+=ms[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ms[a]||(o?ms[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ms[t.body]||ms[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),us(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(us(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),us(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},te.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=te.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=te.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class vs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gs(this.element,"focus",this),gs(this.element,"blur",this),gs(this.textarea,"cut",this),gs(this.textarea,"copy",this),gs(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gs(this.field,"pointerdown",this):gs(this.field,"touchstart:active mousedown",this),gs(window,"resize",this);const o={...e};o.onSelectionDidChange=vs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Be.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ks(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ys(this.textarea,"cut",this),ys(this.textarea,"copy",this),ys(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xs(this.popover),xs(this.keystrokeCaption),xs(this.virtualKeyboard),xs(document.getElementById("mathlive-alternate-keys-panel")),ys(this.element,"pointerdown",this),ys(this.element,"touchstart:active mousedown",this),ys(this.element,"focus",this),ys(this.element,"blur",this),ys(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=me.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){if(this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,i=this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=me.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||Ss>2?(n(t),3!==t.detail&&3!==Ss||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(gs(e.field,"pointermove",h),gs(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gs(window,"blur",n),t.touches?(gs(t.target,"touchmove",h),gs(t.target,"touchend",n)):(gs(window,"mousemove",h),gs(window,"mouseup",n))),2!==t.detail&&2!==Ss||(a=!0,this.mathlist.selectGroup_()))}}else ws=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return As(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=As(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=ve.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=At.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;iks(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),e+=1,t=this.mathlist.ancestor(e)}const i=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=N.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=hi[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&hi[a]?hi[a]:a&&di[a]?di[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=di[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=te.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const i=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=he.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Je.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gs(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),gs(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gs(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ci.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xs(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=te.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ws,Ss=0;function As(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(i,s)}function Ms(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=As(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=As(t,"",t.mathlist.sibling(0)):"line"===e?(a=As(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?As(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vs.prototype.undo_=vs.prototype.undo,vs.prototype.redo_=vs.prototype.redo,vs.prototype.scrollIntoView_=vs.prototype.scrollIntoView,vs.prototype.scrollToStart_=vs.prototype.scrollToStart,vs.prototype.scrollToEnd_=vs.prototype.scrollToEnd,vs.prototype.insert_=vs.prototype.$insert;var Cs={isValidMathfield:ks,MathField:vs};function _s(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_s(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ds(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Fs(t,void 0,e,!0));else{const s=Ls(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Bs(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function $s(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Rs(t,e){Es&&((e=e||{}).renderToMarkup=e.renderToMarkup||qs,e.renderToMathML=e.renderToMathML||Is,e.renderToSpeakableText=e.renderToSpeakableText||Ps,e.macros=e.macros||At.MACROS,Es.renderMathInElement($s(t),e))}function Ks(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}return{latexToMarkup:qs,latexToMathML:Is,latexToSpeakableText:Ps,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const i=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(i,e)},astToLatex:function(t,e){return ps(t,e)},makeMathField:function(t,e){if(!Cs)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Os,e.handleReadAloud=e.handleReadAloud||Bs,new Cs.MathField($s(t),e)},renderMathInDocument:function(t){Rs(document.body,t)},renderMathInElement:Rs,revertToOriginalContent:function(t,e){(t=(t=$s(t)).children[1])instanceof Cs.MathField?t.revertToOriginalContent():(Ks(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=$s(t)).children[1])instanceof Cs.MathField?t.originalContent:(Ks(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Bs,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return B(i[0],e)}return new L(t,e)}function O(t,e,i){const s=B(e,i);return s.type=t,s}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=$(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=N.makeSymbol,Ct=N.makeSpan,_t=N.makeVlist;function Tt(t,e,i,s,a,o){const n=Mt("Size"+i+"-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,Ct(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+i)}function Ft(t,e,i,s,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Bt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Ot(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return $t(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?It:Dt.includes(e)?Bt:Pt;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(At.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Tt(t,e,r.size,s,a,o):Ft(t,e,i,s,a,o)}function $t(t,e,i){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Rt={makeSizedDelim:function(t,e,i,s,a){return"."===e?$t(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,i,!1,s,a):zt.includes(e)?Ft(t,e,qt[i],!1,s,a):null)},makeCustomSizedDelim:Ot,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return $t(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Ot(t,e,h,!0,a,o)}};const Kt=N.makeSpan,Nt=N.makeOrd,Wt=N.makeInner,Ht=N.makeHlist,Vt=N.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=Nt(Qt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(i)+N.depth(i)+o&&(o=(o+l-(N.height(i)+N.depth(i)))/2),r.setTop(r.height-N.height(i)-(o+s));const c=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Vt(t,[i,o,c,s]);if(!this.index)return this.bind(t,Nt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Kt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,Nt([Kt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,Nt(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=N.skew(i));const a=Math.min(N.height(i),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Kt(Kt(o),"accent-body"+n);return r=Vt(t,[i,-a,r]),r.children[1].setLeft(2*s),Nt(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Qt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[i,3*s,a,s]);else{const e=Kt(i);o=Vt(t,[s,a,3*s,e],"top",N.height(e))}return Nt(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?Kt(Qt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?Kt(Qt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Yt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Kt(Qt(t,this.body),"inner");return Nt([e,Kt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=Nt("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=N.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=N.makeOp(Qt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=Nt(Qt(t,this.body)),i=Kt();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=Kt([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=Nt(Qt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=Kt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(Array.isArray(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Kt(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Kt(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-s.metrics.supDrop,l=N.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*i){l=4*i-(r-a.depth)+N.height(o);const t=.8*s.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,N.height(o)-.8*s.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Kt(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?Kt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Kt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=N.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Xt(t){const e=Kt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,i,s){const a=[];for(const o of e){const e=Kt(Qt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Vt(t,a,"individualShift")}function Yt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=Kt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+i;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=N.height(e)-i;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=N.depth(e)+i;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return N.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const i=new Zt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Zt("","first")),i},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},ie={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var se=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in ie)if(ie[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return se(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new re("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=At.getInfo("\\"+i.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new re(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=At.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=se(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=At.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new re(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=At.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else"#"===t.type&&("?"===t.value?e=this.placeholder():this.args&&(e=this.args[t.value]||this.placeholder()));return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[i])return ue[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=fe[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=xe(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(i.test(xe(ue[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ce(t,e){let i;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Be()),i}function _e(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Te(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new te.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function Le(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ce(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(De(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||De(t[i],e)})))return!0;if(t.array)for(let i=_e(t.array);i>=0;i--)if(De(Ce(t.array,i),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Ie(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=qe(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Ie(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Ie(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Ie(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=qe(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=Pe(i[1],e),t+=qe(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Ie(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=qe(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=Pe(i[1],e),t+=qe(i[2],e),s=!0)),!s)if(i=Ie(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Ie(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+qe(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+qe(i.rest,e):i.match+qe(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+qe(i[2],e),s=!0)),t}function Ie(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=ve.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function Pe(t,e){let i=ve.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Be(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},we.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new we;s.path=me.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},we.prototype.setRange=function(t,e,i){i=i||{};const s=me.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),s)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Be()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&At.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=_e(e.array);i>=0;i--)t(Ce(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},we.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=_e(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=Se(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},we.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},we.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},we.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=At.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new te.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Be()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Be()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Be()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Be()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Be()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Me(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=Ae(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=At.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Oe={EditableMathlist:we,parseMathString:Ee};const $e={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Re={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ke={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Ne(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=Ke[t.target.value]||t.target.value),e||($e[t.key]?(e=$e[t.key],i=!1):e=Re[t.key],e||(e=Ke[t.key.toLowerCase()])),!e&&t.code&&(e=Re[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function We(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke(Ne(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke(Ne(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:Ne,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&Ze(t,i),t.popover.classList.add("is-visible")}function Ze(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Xe(t);const s=e,a=function(t,e){const i=he.parseTokens(n(t),"math",null,e.config.macros),s=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=N.makeSpan(s,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[s]||e,t),o=je(s),r=ve.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else if("mode"===e)for(;t[s]&&t[s][e]===i;)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Ye(this,this.array[s][e],t);s1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Ye(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Ye(this,this.shift,t)}em]`),i+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Ye(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ae(this.backgroundcolor)}}`),i+=`{${Ye(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Qe.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Qe.locale.substring(0,2),a="ordinal"===i.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[s]&&(o=Qe.strings[s][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const i=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ti={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ei={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ii={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let si={};const ai={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function oi(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=he.parseTokens(n(t),"math",e,i.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ni(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ti,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function ri(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ei[n]&&(a.setAttribute("data-shifted",ei[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ei[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=si[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function li(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ci={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ii["foreground-color"]=[];for(const t of ne)ii["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ii["background-color"]=[];for(const t of oe)ii["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});si={...ii},Object.keys(si).forEach(t=>{si[t]=si[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),si[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),si[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),si[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ai,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ti,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ni(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=li(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,ri(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:ri};const hi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},di={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},pi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function mi(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ui(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,gi(t)&&(n=t.index,t.index+=1),yi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=Si(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,gi(t)){const e=Si(t.atoms[n].superscript,0,0,i).mathML,s=Si(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=Si(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function gi(t){return t.index"+t,a+=Si(o.subscript,0,0,i).mathML,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=Si(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function xi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&gi(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Si(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function vi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Ai(t.atoms[l],i),a+=Si(t.atoms,l+1,c,i).mathML,a+=Ai(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function wi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Mi(e.body)+"":Ai(e,i);a+=r,t.index+=1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function Si(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Ai(t,e){let i="";const s=Mi(t.body);return s&&(i=""+s+""),i}function Mi(t){if(!t)return"";if("string"==typeof t)return mi(t);if(!Array.isArray(t)&&"string"==typeof t.body)return mi(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return mi(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Si(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(pi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+Si(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(pi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Si(this.numer,0,0,t).mathML||" ",c+=Si(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Si(this.numer,0,0,t).mathML+"",c+=""+Si(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Si(this.body,0,0,t).mathML,c+=Si(this.index,0,0,t).mathML,c+=""):(c+="",c+=Si(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Si(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(pi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Si(this.body,0,0,t).mathML,c+=""+(pi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):r?(c+=""+Si(l,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):n&&(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+ui(this.id,t)+">"+mi(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&pi[p]?""+pi[p]+"":Ai(this,t);break;case"mpunct":c='"+(pi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Si(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Si(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Si(t,0,0,e).mathML};const Ci={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_i={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ti={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Li={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fi(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Di(t){return t&&Li[t]||-1}function zi(t){return/=|=>/.test(t)?"right":"left"}function Ei(t){if("f"===t||"g"===t)return!0;const e=Ti[t];return!!e&&!!/%[^01_^]?/.test(e)}function qi(t){t=(t||"").trim();let e=Ci[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=At.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Ii(t){if(!t)return null;const e=qi(Ki(t)),i=[Di(e),zi(e)];return i[0]<=0?null:i}function Pi(t){return null!==Ii(t)}const Bi={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Oi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},$i={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Ri={",":"list",";":"list2"};function Ki(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const i of t)e+=Ki(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=Ki(i);return e}return""}function Ni(t){return"string"==typeof t.sym?function(t){let e=Ti[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=At.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Wi(t){return parseFloat(t.num)}function Hi(t){return"object"==typeof t&&void 0!==t.num}function Vi(t){let e=0;return Hi(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hs(t.num.re):0:parseFloat(t.num)),e}function Ui(t){let e=0;return Hi(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hs(t.num.im):0),e}function ji(t){return t&&void 0!==t.sup}function Gi(t){return t&&void 0!==t.sub}function Zi(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||Ki(a)===i),s}function Xi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Ji(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Yi(t){if(Hi(t)){const e=Vi(t),i=Ui(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Xi("negate",t)}function Qi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ts(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=rs(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test(Ki(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test(Ki(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ki(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=rs(i.superscript,e)):t.ast.sup=rs(i.superscript,e))):t.index+=1,t}function es(t,e){const i=t.ast;if(ss(t,"!!"))return t.index+=1,t.ast=Xi("factorial2",i),es(t=ts(t,e),e);if(ss(t,"++"))return t.index+=1,t.ast=Xi("increment",i),es(t=ts(t,e),e);if(ss(t,"--"))return t.index+=1,t.ast=Xi("decrement",i),es(t=ts(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Oi[s.latex.trim()]&&(t.ast=Xi(Oi[s.latex.trim()],i),t=es(t=ts(t,e),e)),t}function is(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ki(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"mclose"===o.type&&Ki(o)===i&&(Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s));else if("textord"===o.type&&Ki(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"textord"===o.type&&Ki(o)===i&&(t.index+=1,t=es(t=ts(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=os(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=es(t=ts(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=es(t=ts(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=rs(o.body,s),Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=At.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=At.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=is(t,e,i))return s&&(t.index+=1),t.ast={fn:Bi[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function ss(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ki(t.atoms[t.index])+Ki(t.atoms[t.index+1])}function as(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zi(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,Zi(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zi(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function os(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qi(Ki(s));if(as(e))e.ast=Xi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Yi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Xi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ns(t)))),e=[t])}return e}function rs(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=os(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Xi("text",...i):i[0]||void 0}({atoms:ns(t)},e)}function ls(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function cs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hs(t){return parseFloat(parseFloat(t).toPrecision(15))}function ds(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=cs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=cs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=cs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=hs(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=cs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=cs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}te.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=he.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=he.parseTokens(n(s),"math",null,t.macros),o=Xi("divide",rs(i,t),rs(s,t))):o.fn="divide"):o.group=rs(this.body,t);break;case"genfrac":o=Xi("divide",rs(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Ji(1):rs(this.denom,t));break;case"surd":o=this.index?Xi("pow",rs(this.body,t),Xi("divide",Ji(1),rs(this.index,t))):Xi("sqrt",rs(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qi(Ki(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=rs(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xi("card",rs(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>rs(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(rs(e[0],t));let s=rs(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return rs(t,e)};var ps=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hi(e)){const i=Wi(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":ds(e.num,s);else{const t=Vi(e),i=Ui(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ds(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?ds(i,s):"")+"\\imaginaryI "))}ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Hi(e.group)||Ni(e.group)?0!==Ui(e.group)&&(a=ls(e.fence||"(),",a)):a=ls(e.fence||"(),",a),ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fi(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Fi(e,1));else{let i="";for(let s=1;s=2)a=t(Fi(e,0),s),Hi(Fi(e,0))||Ni(Fi(e,0))||(a=ls(e.fence||"(),",a)),a+="^{"+t(Fi(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ti[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ls(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fi(e,0),s),r=t(Fi(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ls(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ls(e.fence||"(),","");a=ji(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Gi(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ls("() ",t(a,s))):0!==Vi(o=a)&&0!==Ui(o)?i.push(ls("() ",t(a,s))):ji(e)&&0!==Ui(a)&&1!==Ui(a)?i.push(ls("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hi(e.arg[0])&&"divide"!==e.arg[0].fn||Hi(e.arg[1])&&(0!==Vi(e.arg[1])||1!==Ui(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hi(e.arg[0])&&Wi(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function us(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function fs(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function gs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function ys(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function bs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function xs(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ks(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let i=te.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else us(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ms[t.leftDelim]||t.leftDelim,s+=te.toSpeakableFragment(t.body,e),s+=ms[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ms[a]||(o?ms[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ms[t.body]||ms[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),us(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(us(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),us(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},te.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=te.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=te.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class vs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gs(this.element,"focus",this),gs(this.element,"blur",this),gs(this.textarea,"cut",this),gs(this.textarea,"copy",this),gs(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gs(this.field,"pointerdown",this):gs(this.field,"touchstart:active mousedown",this),gs(window,"resize",this);const o={...e};o.onSelectionDidChange=vs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Oe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ks(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ys(this.textarea,"cut",this),ys(this.textarea,"copy",this),ys(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xs(this.popover),xs(this.keystrokeCaption),xs(this.virtualKeyboard),xs(document.getElementById("mathlive-alternate-keys-panel")),ys(this.element,"pointerdown",this),ys(this.element,"touchstart:active mousedown",this),ys(this.element,"focus",this),ys(this.element,"blur",this),ys(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=me.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1;const r=this.field.querySelector(".ML__mathlive").getBoundingClientRect();if(i=d>r.right?[{relation:"body",offset:this.mathlist.root.body.length-1}]:this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=me.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||Ss>2?(n(t),3!==t.detail&&3!==Ss||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(gs(e.field,"pointermove",h),gs(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gs(window,"blur",n),t.touches?(gs(t.target,"touchmove",h),gs(t.target,"touchend",n)):(gs(window,"mousemove",h),gs(window,"mouseup",n))),2!==t.detail&&2!==Ss||(a=!0,this.mathlist.selectGroup_()))}}else ws=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return As(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=As(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=ve.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=At.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;iks(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),e+=1,t=this.mathlist.ancestor(e)}const i=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=N.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=hi[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&hi[a]?hi[a]:a&&di[a]?di[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=di[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=te.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const i=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=he.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Je.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gs(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),gs(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gs(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ci.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xs(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=te.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ws,Ss=0;function As(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(i,s)}function Ms(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=As(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=As(t,"",t.mathlist.sibling(0)):"line"===e?(a=As(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?As(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vs.prototype.undo_=vs.prototype.undo,vs.prototype.redo_=vs.prototype.redo,vs.prototype.scrollIntoView_=vs.prototype.scrollIntoView,vs.prototype.scrollToStart_=vs.prototype.scrollToStart,vs.prototype.scrollToEnd_=vs.prototype.scrollToEnd,vs.prototype.insert_=vs.prototype.$insert;var Cs={isValidMathfield:ks,MathField:vs};function _s(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_s(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ds(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Fs(t,void 0,e,!0));else{const s=Ls(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Os(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function $s(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Rs(t,e){Es&&((e=e||{}).renderToMarkup=e.renderToMarkup||qs,e.renderToMathML=e.renderToMathML||Is,e.renderToSpeakableText=e.renderToSpeakableText||Ps,e.macros=e.macros||At.MACROS,Es.renderMathInElement($s(t),e))}function Ks(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}return{latexToMarkup:qs,latexToMathML:Is,latexToSpeakableText:Ps,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const i=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(i,e)},astToLatex:function(t,e){return ps(t,e)},makeMathField:function(t,e){if(!Cs)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Bs,e.handleReadAloud=e.handleReadAloud||Os,new Cs.MathField($s(t),e)},renderMathInDocument:function(t){Rs(document.body,t)},renderMathInElement:Rs,revertToOriginalContent:function(t,e){(t=(t=$s(t)).children[1])instanceof Cs.MathField?t.revertToOriginalContent():(Ks(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=$s(t)).children[1])instanceof Cs.MathField?t.originalContent:(Ks(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Os,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s=1){const i=t.charCodeAt(e-1),a=s;return 55296<=i&&i<=56319?1024*(i-55296)+(a-56320)+65536:a}return s}function e(e,i){if((i=i||0)<0)return 0;if(i>=e.length-1)return e.length;let a=s(t(e,i));for(let r=i+1;r=this.s.length}get(){return this.pos="0"&&s<="9"?parseInt(s):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],s=t.toString().split(/\r?\n/);let i="",a="";for(const t of s){i+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(i+=e[0])}const n=new o(i);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,s){if("string"==typeof t){const s=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);s?(t=parseFloat(s[1]),e=s[2].toLowerCase()):t=parseFloat(t)}const i={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(s)){const e=Math.pow(10,s);return Math.round(t/h.ptPerEm*i*e)/e}return t/h.ptPerEm*i}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const s={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let i=t.charCodeAt(0);t[0]in d?i=d[t[0]].charCodeAt(0):l.test(t[0])&&(i=77);const a=r[s][i];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,s,i){this.id=t,this.size=e,this.cramped=i,this.sizeMultiplier=s,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const s of t)e+=T(s);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,s=1;this.children&&this.children.forEach(i=>{i.height>t&&(t=i.height),i.depth>e&&(e=i.depth),i.maxFontSize>s&&(s=i.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=s}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let s="Main-Regular";if(e&&(s=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&s){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=s)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let s="",i=this.body||"";if(this.children){let t="none";for(const s of this.children){let a=0;if(t){let i=s.type;i&&("textord"===i&&(i="mord"),"first"===i&&(i="none"),a=s.isTight?E[t+"+"+i]||0:F[t+"+"+i]||0,a=Math.floor(e*a))}i+=s.toMarkup(a,e),t=q(s)}}if("​"!==i&&i||this.classes&&"ML__selected"!==this.classes){if(s="1?e.filter((function(t,e,s){return t.length>0&&s.indexOf(t)===e})).join(" "):e[0],a.length>0&&(s+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?i=z[-t]+i:D[t]?i=D[t]+i:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const s in this.style)Object.prototype.hasOwnProperty.call(this.style,s)&&("background-color"===s&&e||(t+=s+":"+this.style[s]+";"));t.length>0&&(s+=' style="'+t+'"')}s+=">",this.svgOverlay?(s+='",s+=""):s+=i,s+=""}else s="";return this.caret&&"command"!==this.type&&("text"===this.caret?s+='':s+=''),s}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,s=t.children&&t.children.length>0;if(e||s)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==a.length)return!1;i.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function O(t,e){if(Array.isArray(t)){const s=[];for(const e of t)e&&s.push(e);if(1===s.length)return O(s[0],e)}return new L(t,e)}function B(t,e,s){const i=O(e,s);return i.type=t,i}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const s=new L(t,e);let i=1;return i=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),s.height*=i,s.depth*=i,s}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const s=[e[0]];for(let i=1;i0?"em":""),i.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(i,"fontsize-ensurer reset-"+t.size+" size5"):0!==s?i:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=O([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=O(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,s,i,a){a=a||"";const o=$(e,(a+=" style-wrap ")+s.adjustTo(i));o.type=t;const n=i.sizeMultiplier/s.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=i.sizeMultiplier,o},makeSVG:function(t,e,s){return t.svgOverlay=e,t.svgStyle=s,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const s of t)e+=s.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const s="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=s),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=s)}function Y(t,e,s,i,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:s===rt?lt:s,baseFontFamily:e,value:i,category:W,frequency:a}}function Q(t,e){for(let s=t;s<=e;s++){const t=String.fromCodePoint(s);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const s=String.fromCodePoint(e);if("math"===t&&tt[s])return tt[s];if(e>32&&e<127)return s;let i="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===s){i=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===s){i=t;break}return i||s}const st={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},it=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in st)if(Object.prototype.hasOwnProperty.call(st,t)&&st[t]===e){e=t;break}for(let t=0;t=it[t].start&&et.body).join("")}function yt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a=ft(e),o={category:W,params:a,parser:i,mathstyle:"displaystyle",tabular:s.tabular||!0,colFormat:s.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a={category:W,baseFontFamily:s.fontFamily,params:ft(e),allowedInText:!!s.allowedInText,infix:!!s.infix,parse:i};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,s){let i=0;for(const t of s)i=Math.max(i,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let s=e[0]||[];const i={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)i.strokeWidth=m.toPx(t[1],"px"),isFinite(i.strokeWidth)||(i.strokeWidth=1),i.strokeStyle=t[2],i.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?i.backgroundcolor=t[2]:"mathcolor"===t[1]?i.strokeColor=t[2]:"padding"===t[1]?i.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(i.shadow=t[2]))}}"dashed"===i.strokeStyle?i.svgStrokeStyle="5,5":"dotted"===i.strokeStyle&&(i.svgStrokeStyle="1,5")}i.borderStyle=i.strokeWidth+"px "+i.strokeStyle+" "+i.strokeColor,s=s.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),i.notation={};for(const t of s)i.notation[t]=!0;return i.notation.updiagonalarrow&&(i.notation.updiagonalstrike=!1),i.notation.box&&(i.notation.left=!1,i.notation.right=!1,i.notation.bottom=!1,i.notation.top=!1),i})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const s={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":s.hasBarLine=!0;break;case"\\\\atopfrac":s.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s.hasBarLine=!1,s.leftDelim="(",s.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":s.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":s.mathstyle="textstyle"}return"\\cfrac"===t&&(s.continuousFraction=!0),s})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const s=e[0],i=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:s,denom:i,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let s=parseInt(e[0]);return isFinite(s)||(s=10067),{type:"mord",body:String.fromCodePoint(s)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",s=!0;for(const i of t)"string"==typeof i.body?e+=i.body:s=!1;return s?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const s={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(s.limits="nolimits",s.isFunction=!0),s})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const s={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return s.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?s.limits="nolimits":"\\operatorname*"===t&&(s.limits="limits"),s})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,s){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!s)return t;const i=t.codePointAt(0);for(let t=0;t=it[t].offset&&i=1;)i.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?i=H[t]:vt[t]&&(i={value:vt[t]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const s in V)Object.prototype.hasOwnProperty.call(V,s)&&s.startsWith(t)&&!V[s].infix&&e.push({match:s,frequency:V[s].frequency});for(const s in H)Object.prototype.hasOwnProperty.call(H,s)&&s.startsWith(t)&&e.push({match:s,frequency:H[s].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=N.makeSymbol,Ct=N.makeSpan,_t=N.makeVlist;function Tt(t,e,s,i,a,o){const n=Mt("Size"+s+"-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,Ct(n,"delimsizing size"+s),a.mathstyle,M.TEXT,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let s="";return"Size1-Regular"===e?s=" delim-size1":"Size4-Regular"===e&&(s=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+s)}function Ft(t,e,s,i,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((s-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;i&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Ot=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Bt(t,e,s,i,a,o){if(!e||0===e.length||"."===e)return $t(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?It:Dt.includes(e)?Ot:Pt;const r=function(t,e,s,i){for(let o=Math.min(2,3-i.mathstyle.size);oe)return s[o]}var a;return s[s.length-1]}(At.getValue("math",e),s,n,a);return"small"===r.type?function(t,e,s,i,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,s,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier/s.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,i,a,o):"large"===r.type?Tt(t,e,r.size,i,a,o):Ft(t,e,s,i,a,o)}function $t(t,e,s){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(s||""))}var Rt={makeSizedDelim:function(t,e,s,i,a){return"."===e?$t(t,i,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,s,!1,i,a):zt.includes(e)?Ft(t,e,qt[s],!1,i,a):null)},makeCustomSizedDelim:Bt,makeLeftRightDelim:function(t,e,s,i,a,o){if("."===e)return $t(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=i+n,c=s-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Bt(t,e,h,!0,a,o)}};const Kt=N.makeSpan,Nt=N.makeOrd,Wt=N.makeInner,Ht=N.makeHlist,Vt=N.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,s,i){this.mode=t,this.type=e,this.body=s,this.applyStyle(i)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const s of e)for(const e of s)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const s of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[s]))for(const i of this[s])i&&(e=e.concat(i.filter(t)));if(Array.isArray(this.array))for(const s of this.array)for(const i of s)i&&(e=e.concat(i.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),s=Nt(Qt(e,this.body));return this.cssId&&(s.cssId=this.cssId),s.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),s}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const s=[];let i=0;for(const t of e)t.align&&i++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,s,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const s of e){if(s.align&&b>=u.length)break;if(s.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(s)+N.depth(s)+o&&(o=(o+l-(N.height(s)+N.depth(s)))/2),r.setTop(r.height-N.height(s)-(o+i));const c=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=i;const d=Vt(t,[s,o,c,i]);if(!this.index)return this.bind(t,Nt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Kt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,Nt([Kt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let s=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(s=this.attachSupsub(t,Nt(s),"mord"));let i=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(i=N.skew(s));const a=Math.min(N.height(s),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Kt(Kt(o),"accent-body"+n);return r=Vt(t,[s,-a,r]),r.children[1].setLeft(2*i),Nt(r,"accent")}decomposeLine(t){const e=t.mathstyle,s=Qt(t.cramp(),this.body),i=h.defaultRuleThickness/e.sizeMultiplier,a=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=i,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[s,3*i,a,i]);else{const e=Kt(s);o=Vt(t,[i,a,3*i,e],"top",N.height(e))}return Nt(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),s=t.clone({mathstyle:"scriptstyle"}),i=this.overscript?Kt(Qt(s,this.overscript),t.mathstyle.adjustTo(s.mathstyle)):null,a=this.underscript?Kt(Qt(s,this.underscript),t.mathstyle.adjustTo(s.mathstyle)):null;return Yt(t,e,0,0,i,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Kt(Qt(t,this.body),"inner");return Nt([e,Kt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,s=Nt("","rule");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return s.setStyle("border-right-width",a,"em"),s.setStyle("border-top-width",o,"em"),s.setStyle("margin-top",-(o-i),"em"),s.setStyle("border-color",t.color),s.width=a,s.height=o+i,s.depth=-i,s}decomposeOp(t){const e=t.mathstyle;let s,i=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(i=!0);let a=0,o=0;if(this.symbol){const n=i?"Size2-Regular":"Size1-Regular";s=N.makeSymbol(n,this.body,"op-symbol "+(i?"large-op":"small-op")),s.type="mop",a=(s.height-s.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=s.italic,this.bind(t,s)}else Array.isArray(this.body)?(s=N.makeOp(Qt(t,this.body)),this.bind(t,s)):s=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const i=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===i||"auto"===i&&e.size===M.DISPLAY.size?this.attachLimits(t,s,a,o):this.attachSupsub(t,s,"mop")}return this.symbol&&s.setTop(a),s}decomposeBox(t){const e=Nt(Qt(t,this.body)),s=Kt();s.setStyle("position","absolute");const i="number"==typeof this.padding?this.padding:h.fboxsep;s.setStyle("height",e.height+e.depth+2*i,"em"),0!==i?s.setStyle("width","calc(100% + "+2*i+"em)"):s.setStyle("width","100%"),s.setStyle("top",-i,"em"),s.setStyle("left",-i,"em"),s.setStyle("z-index","-1"),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.framecolor&&s.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&s.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+i,"em");const a=Kt([s,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-i+e.depth,"em"),a.height=e.height+i,a.depth=e.depth+i,a.setLeft(i),a.setRight(i),a}decomposeEnclose(t){const e=Nt(Qt(t,this.body)),s="auto"===this.padding?.2:this.padding;e.setStyle("padding",s,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-s,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let i="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(i+='0?s.setWidth(this.width):s.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";s=Kt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?s=this.decomposeBox(t):"enclose"===this.type?s=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(s=this.makeSpan(t,this.body),s.classes="",this.error&&(s.classes+=" ML__error"),this.suggestion&&(s.classes+=" ML__suggestion")):"placeholder"===this.type?s=this.makeSpan(t,"⬚"):"first"===this.type&&(s=this.makeSpan(t,"​"));if(!s)return s;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(s)?s[s.length-1].caret=this.caret:s.caret=this.caret),this.containsCaret&&(Array.isArray(s)?(s[0].classes=(s[0].classes||"")+" ML__contains-caret",s[s.length-1].classes=(s[s.length-1].classes||"")+" ML__contains-caret"):s.classes=(s.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(s)){const e=s[s.length-1];s[s.length-1]=this.attachSupsub(t,e,e.type)}else s=[this.attachSupsub(t,s,s.type)];return Array.isArray(s)?s:[s]}attachSupsub(t,e,s){if(!this.superscript&&!this.subscript)return e;const i=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Kt(e,i.adjustTo(i.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Kt(e,i.adjustTo(i.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-i.metrics.supDrop,l=N.depth(e)+i.metrics.subDrop),n=i===M.DISPLAY?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const c=M.TEXT.sizeMultiplier*i.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const s=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*s){l=4*s-(r-a.depth)+N.height(o);const t=.8*i.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,i.metrics.sub1,N.height(o)-.8*i.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Kt(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(s,[e,m])}attachLimits(t,e,s,i){const a=this.superscript?Kt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Kt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,s,i,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const s="textord"===this.type?"mord":this.type,i=N.makeSpanOfType(s,e),a=this.getStyle();i.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+o):t.parentSize!==t.size&&(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+t.size),i.maxFontSize=Math.max(i.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(i.classes+=" ML__text"),t.mathstyle.isTight()&&(i.isTight=!0),"math"!==this.mode&&(i.italic=0),i.setRight(i.italic),"number"==typeof t.opacity&&i.setStyle("opacity",t.opacity),this.bind(t,i),this.caret&&(this.superscript||this.subscript||(i.caret=this.caret,t.mathstyle.isTight()&&(i.isTight=!0))),i}}function Xt(t){const e=Kt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,s,i){const a=[];for(const o of e){const e=Kt(Qt(t,i));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-s)}return Vt(t,a,"individualShift")}function Yt(t,e,s,i,a,o,n){if(!a&&!o)return e;e=Kt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+s;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-i),c.children[2].setLeft(i)}else if(o&&!a){const a=N.height(e)-s;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-i)}else if(!o&&a){const o=N.depth(e)+s;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(i)}return N.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function s(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function i(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const s=new Zt(t=t||"math","root",e||[]);return 0!==s.body.length&&"first"===s.body[0].type||s.body.unshift(new Zt("","first")),s},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},se={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ie=function(t){const e=t.toLowerCase().split("!");let s,i,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*s,n=(1-l)*n+l*i,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*s,n=l*n+(1-l)*i,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in se)if(se[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,s){this.tokens=t,this.index=0,this.args=e,this.macros=s,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===i.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ie(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let s=10,i=/[0-9]/;this.parseLiteral("'")?(s=8,i=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(s=16,i=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(i);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(i);)a+=this.get().value;const o=t?parseInt(a,s):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),s=new re("math","group");return s.mathstyle=")"===t?"textstyle":"displaystyle",s.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),s.body&&0!==s.body.length?s:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const s=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(s),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),s=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else s.push(this.scanArg(t.type));const i=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,s,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let s=null,i=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!s?(s=this.get(),i=this.swapMathList([])):this.parseAtom();let o;if(s){const t=this.swapMathList(a),e=At.getInfo("\\"+s.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||s.value,e.parse?e.parse("\\"+s.value,[i,t]):null)]:[new re(this.parseMode,"mop",s.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let s=1;for(;!this.end()&&0!==s;)this.hasLiteral("(")&&(s+=1),this.hasLiteral(")")&&(s-=1),0!==s&&this.parseAtom();return 0===s&&this.parseLiteral(")"),t.rightDelim=0===s?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const s=At.getInfo(e,"math",this.macros);return s?"mopen"===s.type||"mclose"===s.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const s=this.scanDelim();if(!s)return null;const i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=s,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(i),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const s=this.scanArg();if(s){const i=this.lastMathAtom();i[e]=i[e]||[],i[e]=i[e].concat(s),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const s=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)i=this.scanString();else if("number"===t)i=this.scanNumber();else if("dimen"===t)i=this.scanDimen();else if("skip"===t)i=this.scanSkip();else if("colspec"===t)i=this.scanColspec();else if("color"===t)i=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ie(e);if(t)i=i||{},i.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)i=i||{},i.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(i=i||{},i.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(s);return i||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const s=this.scanToken();return this.parseMode=e,Array.isArray(s)?s:s?[s]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const s=this.parseMode;this.parseMode=t;const i=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=s;const a=this.swapMathList(i);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const s=this.scanSkip();isFinite(s)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=s),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const s=At.getInfo("\\"+t.value,this.parseMode,this.macros),i=[];let a="",o="";if(s&&s.params)for(const t of s.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)i.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,i.push([e])}else i.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(s&&!s.infix){if(s.parse){const a=s.parse("\\"+t.value,i);if(a.type)e=new re(this.parseMode,s.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new re(this.parseMode,s.type||"mop",s.value||t.value,i),s.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}s||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const s=At.getInfo(t.value,this.parseMode,this.macros);if(s){const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new re(this.parseMode,s.type,s.value||t.value,i),s.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),s&&s.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new re(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let s,i=0;"string"==typeof this.macros[t]?(s=this.macros[t],/(^|[^\\])#1/.test(s)&&(i=1),/(^|[^\\])#2/.test(s)&&(i=2),/(^|[^\\])#3/.test(s)&&(i=3),/(^|[^\\])#4/.test(s)&&(i=4),/(^|[^\\])#5/.test(s)&&(i=5),/(^|[^\\])#6/.test(s)&&(i=6),/(^|[^\\])#7/.test(s)&&(i=7),/(^|[^\\])#8/.test(s)&&(i=8),/(^|[^\\])#9/.test(s)&&(i=9)):(s=this.macros[t].def,i=this.macros[t].args||0);for(let t=1;t<=i;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(s),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=i;t++){if(o+="{",Array.isArray(e[t]))for(let s=0;s1&&(e.extent=parseInt(s[1]));const i=s[0].split("/");for(const t of i){const s=t.match(/([^:]*):(.*)/);s&&e.path.push({relation:s[1],offset:parseInt(s[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let s=0,i=-1,a=!1;for(;!a;)i+=1,a=i>=t.length||i>=e.length,a=a||!(t[i].relation===e[i].relation&&t[i].offset===e[i].offset);return s=i===t.length&&i===e.length?0:i+1===t.length&&i+1===e.length&&t[i].relation===e[i].relation?1:2,s},pathCommonAncestor:function(t,e){const s=[],i=Math.min(t.length-1,e.length-1);let a=0;for(;a<=i&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)s.push(t[a]),a+=1;return s},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,s){if(!s)return s;if("string"==typeof s)return s;if("string"==typeof s.mode&&s.mode!==t)return null;if(!e)return s?s.value:void 0;let i=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return i=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==s.after?/nothing/.test(s.after)&&i||/letter/.test(s.after)&&a||/digit/.test(s.after)&&o||/function/.test(s.after)&&n||/frac/.test(s.after)&&r||/surd/.test(s.after)&&l||/binop/.test(s.after)&&c||/relop/.test(s.after)&&h||/punct/.test(s.after)&&d||/array/.test(s.after)&&p||/openfence/.test(s.after)&&m||/closefence/.test(s.after)&&u||/text/.test(s.after)&&f||/space/.test(s.after)&&g?s.value:null:s.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let s="";Array.isArray(t)||(t=[t]);for(const i of t){let t;const a=i.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}if(t){const i="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!i&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:i?"⌘":"command",Shift:i?"⇧":"shift",Alt:i?"⌥":"alt",Ctrl:i?"⌃":"control","\n":i?"⏎":"return",Return:i?"⏎":"return",Enter:i?"⌤":"enter",Tab:i?"⇥":"tab",Esc:"esc",Backspace:i?"⌫":"backspace",Del:i?"⌦":"del",PageUp:i?"⇞":"page up",PageDown:i?"⇟":"page down",Home:i?"⤒":"home",End:i?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;s.length>0&&(s+=e||" or "),s+=o}}return s}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const s=[];for(let i=0;i<=t.length-1;i++){const a=t.substring(i);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!s.includes(t)&&s.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&s.push(t)})}return s},forString:function(t,e,s,i){let a="";i&&i.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[s]));const o=i&&i.inlineShortcuts?i.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[s])),n||a},selectorForKeystroke:function(t,e){for(const s of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[s])return ue[s];return""},forCommand:function(t){let e=[];if("string"==typeof t){const s=fe[t];Array.isArray(s)?e=s.slice():s&&e.push(s)}t=xe(t);const s=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(s.test(xe(ue[t]))){const s=t.match(/:([^:]*)$/);s&&e.push(s[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let s=0;for(let i=0;i0;)s.col+=1,(!t[s.row]||s.col>=t[s.row].length)&&(s.col=0,s.row+=1),e-=1;return s}function Ce(t,e){let s;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(s=t[e.row][e.col]||null),!s||0!==s.length&&"first"===s[0].type||s.unshift(Oe()),s}function _e(t){let e=0,s=0,i=1;for(const e of t)s+=1,e.length>i&&(i=e.length);return e=s*i,e}function Te(t,e,s){if(!t)return[];e||(e=",");let i,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?a.push(i):i=new te.MathAtom("math","mpunct",e,s),a=a.concat(o));return a}function Le(t,e,s){const i={...e};if(i.row+=s,i.row<0){if(i.col+=s,i.row=t.length-1,i.col<0)return null;for(;i.row>=0&&!Ce(t,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=t.length){for(i.col+=s,i.row=0;i.rowt.length-1)return null}return i}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const s of t)if(De(s,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(s){return s===e||De(t[s],e)})))return!0;if(t.array)for(let s=_e(t.array);s>=0;s--)if(De(Ce(t.array,s),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let s,i=!1;if(i||"^"!==t[0]&&"_"!==t[0]||(s=Ie(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+s.match+"}",t+=qe(s.rest,e),i=!0),i||(s=t.match(/^(sqrt|\u221a)(.*)/),s&&(s=Ie(s[2],{...e,noWrap:!0}),t="\\sqrt{"+s.match+"}",t+=qe(s.rest,e),i=!0)),i||(s=t.match(/^(\\cbrt|\u221b)(.*)/),s&&(s=Ie(s[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+s.match+"}",t+=qe(s.rest,e),i=!0)),i||(s=t.match(/^abs(.*)/),s&&(s=Ie(s[1],{...e,noWrap:!0}),t="\\left|"+s.match+"\\right|",t+=qe(s.rest,e),i=!0)),i||(s=t.match(/^["”“](.*?)["”“](.*)/),s&&(t="\\text{"+s[1]+"}",t+=qe(s[2],e),i=!0)),i||(s=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),s&&(t=Pe(s[1],e),t+=qe(s[2],e),i=!0)),!i&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(s=Ie(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+s.match+"\\mright)":t[0]+s.match,t+=qe(s.rest,e),i=!0),i||(s=t.match(/^([a-zA-Z]+)(.*)/),s&&(t=Pe(s[1],e),t+=qe(s[2],e),i=!0)),!i)if(s=Ie(t,{...e,noWrap:!0}),s.match&&"/"===s.rest[0]){const a=Ie(s.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+s.match+"}{"+a.match+"}"+qe(a.rest,e)),i=!0}else s.match&&(t="("===t[0]?"\\left("+s.match+"\\right)"+qe(s.rest,e):s.match+qe(s.rest,e),i=!0);return i||(s=t.match(/^(\s+)(.*)$/),s&&(t=" "+qe(s[2],e),i=!0)),t}function Ie(t,e){let s="",i=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?s=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),s="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),i=t.substring(r)):(s=t.substring(1,r),i="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let s=ve.forString("math",null,t,e);if(s)return s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),{match:s,rest:t.substring(s.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(i=t.substring(a[1].length),s=a[1]))}return{match:s,rest:i}}function Pe(t,e){let s=ve.forString("math",null,t,e);return s?(s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),s+=" "):s=t,s}function Oe(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,s)},we.prototype.filter=function(t,e){e=e<0?-1:1;const s=[],i=new we;i.path=me.clone(this.path),i.extent=this.extent,i.root=this.root,e>=0?i.collapseForward():(i.collapseBackward(),i.move(1));const a=i.anchor();do{t.bind(i)(i.path,i.anchor())&&s.push(i.toString()),e>=0?i.next({iterateAll:!0}):i.previous({iterateAll:!0})}while(a!==i.anchor());return s},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const s=this.siblings(),i=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=i;e0?0:1)},we.prototype.setRange=function(t,e,s){s=s||{};const i=me.pathDistance(t,e);if(0===i)return s.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===i){const i=e[e.length-1].offset-t[t.length-1].offset;return s.extendToWordBoundary?(t=this.wordBoundary(t,i<0?1:-1),e=this.wordBoundary(e,i<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),i)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let s=0;s0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Oe()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),s=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[s]&&"text"===t[s].mode&&At.LETTER_AND_DIGITS.test(t[s].body);)s+=1;if(s-=1,e>=s)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,s-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),s=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[s]);)s+=1;s-=1,this.setSelection(e,s-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),s=this.startOffset(),i=this.endOffset();for(let a=s;a0&&"command"===t[e].type;)e-=1;let s=this.startOffset()+1;for(;s<=t.length-1&&"command"===t[s].type;)s+=1;return s>e?{start:e+1,end:s}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const s=this.commandOffsets();if(s){const i=t?this.anchorOffset()+1:s.end,a=this.siblings();for(let t=s.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==s.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let s=e.length-1;s>=0;s--)"command"===e[s].type?e.splice(s,1):t(e[s]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let s=_e(e.array);s>=0;s--)t(Ce(e.array,s))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let s=this.startOffset();if("text"===t[s].mode)for(;s>=1&&"text"===t[s].mode;)e.unshift(t[s]),s--;else for(;s>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[s].type);)e.unshift(t[s]),s--;return e},we.prototype.setSelection=function(t,e,s){t=t||0,e=e||0;const i=this.path[this.path.length-1].relation;s||(s=i);const a=this.parent();if(!a&&"body"!==s)return!1;const o=s.startsWith("cell");if(!o&&!a[s]||o&&!a.array)return!1;const n=s!==i;this.path[this.path.length-1].relation=s;const r=this.siblings().length;this.path[this.path.length-1].relation=i;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=s,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let s=e[this.relation()];const i=this.parent();for(;s&&!i[s];)s=e[s];if(s)return void this.setSelection(0,0,s);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const s=this.anchor();if(!s.captureSelection){let t;if(s.array){t="";const e=_e(s.array);let i=e-1;for(;!t&&i0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const s=this.relation();if("denom"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,s);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const s=this.relation();if("numer"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,s);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,s=0;const i=Se(this);s=this.extent+t;const a=e+s;if(a<0&&0!==s){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",i);e=this.path[this.path.length-1].offset,s=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",i);this.isCollapsed()&&(e-=1),s-=1}this.setSelection(e,s),this._announce("move",i)},we.prototype.skip=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(s&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!s)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let s="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(s){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",i)}},we.prototype.jump=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,i.length-1));const o=t<0?0:i.length-1;s?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const i=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;s?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(i,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',s=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let i=s.indexOf(document.activeElement)+t;i<0&&(i=s.length-1),i>=s.length&&(i=0),s[i].focus()}return this.suppressChangeNotifications=s,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",i),this.selectionDidChange(),this.suppressChangeNotifications=s,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e=i.mode),s+=1,i=this.ancestor(s);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e={color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontShape:i.fontShape,fontSeries:i.fontSeries,fontSize:i.fontSize}),s+=1,i=this.ancestor(s);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let s=0,i=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(s++,i=o),"first"!==t[e].body[o].type&&a++;0===a&&1===s&&(t[e]=t[e].body[i])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const s=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const i=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,s){e&&s&&(Array.isArray(e)?e.forEach(e=>t(e,s)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(s),t(e.body,s),t(e.numer,s),t(e.denom,s),t(e.index,s),t(e.overscript,s),t(e.underscript,s),t(e.subscript,s),t(e.superscript,s))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=i,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=s},we.prototype._insertSmartFence=function(t,e){const s=this.parent();if("leftright"===s.type&&"|"!==s.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const i=At.RIGHT_DELIM[t];if(i&&("leftright"!==s.type||"|"!==s.leftDelim)){let s="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;s=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",s+=a?"?":i;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(s,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(s&&"leftright"===s.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),s.rightDelim=t,this.move(1),this.contentDidChange(),!0;const i=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==i[a].type||"?"!==i[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),i[a].rightDelim=t,i[a].body=i[a].body.concat(i.slice(a+1,this.endOffset()+1)),i.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(s&&"leftright"===s.type&&"?"===s.rightDelim){this.contentWillChange(),s.rightDelim=t;const e=i.slice(this.endOffset()+1);return i.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===i.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let s=e.start;for(;s=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const s=[],i=t.substr(e);for(const t of i){const e=new te.MathAtom("command","command",t);e.suggestion=!0,s.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(s))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(s+=1)}i.row+=1}return s}(t,e.col)){!function(t,e){let s=0;for(;s"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==s.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,s.slice(e+1,e+2)),s.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,s.slice(t,e)),s.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Oe()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Oe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Oe()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Oe()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Oe()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Oe()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Oe()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const s=this.relation();if(e.array){const i=Me(e.array,s);"after row"===t||"before row"===t?(i.col=0,i.row=i.row+("after row"===t?1:0),e.array.splice(i.row,0,[[]])):(i.col+="after column"===t?1:0,e.array[i.row].splice(i.col,0,[]));const a=Ae(e.array,i);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",s=At.getEnvironmentInfo(e),i=[[t.body]];s.parser&&Object.assign(t,s.parser(e,[],i)),t.tabularMode=s.tabular,t.parseMode=this.anchorMode(),t.env={...s},t.env.name=e,t.array=i,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function s(t,s){let i=!0;return e.forEachSelected(e=>{i=i&&e[t]===s},{recursive:!0}),i}t.color&&s("color",t.color)&&(t.color="none"),t.backgroundColor&&s("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&s("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&s("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&s("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&s("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Be={EditableMathlist:we,parseMathString:Ee};const $e={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Re={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ke={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Ne(t){let e,s=!0;"Unidentified"===t.key&&t.target&&(e=Ke[t.target.value]||t.target.value),e||($e[t.key]?(e=$e[t.key],s=!1):e=Re[t.key],e||(e=Ke[t.key.toLowerCase()])),!e&&t.code&&(e=Re[t.code]||t.code);const i=[];return t.ctrlKey&&i.push("Ctrl"),t.metaKey&&i.push("Meta"),s&&t.altKey&&i.push("Alt"),s&&t.shiftKey&&i.push("Shift"),0===i.length?e:(i.push(e),i.join("-"))}function We(t,e){let s,i=null,a=null,o=!1,n=!1;function r(t){clearTimeout(s),s=setTimeout((function(){clearTimeout(s),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const s=t.value;t.value="",s.length>0&&e.typedText(s)}const c=t||e.container;c.addEventListener("keydown",(function(s){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==s.key&&"Unidentified"!==s.key&&229!==s.keyCode)n=!1;else{n=!0,o=!1;const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i}return!(!o&&"CapsLock"!==s.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(s.code))||(i=s,a=null,e.keystroke(Ne(s),s))}),!0),c.addEventListener("keypress",(function(t){o||(i&&a&&e.keystroke(Ne(i),i),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!i||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const s=t.value;t.value="",s.length>0&&e.paste(s)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){i=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:Ne,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const s=t._getCaretPosition();s&&Ze(t,s),t.popover.classList.add("is-visible")}function Ze(t,e){const s=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>i-a?t.popover.style.left=i-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>s-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,s){if(!e||0===e.length)return void Xe(t);const i=e,a=function(t,e){const s=he.parseTokens(n(t),"math",null,e.config.macros),i=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},s),a=N.makeSpan(i,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[i]||e,t),o=je(i),r=ve.forCommand(i);let l=s?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=s?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,s){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(s&&s.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,s){let i="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";i=function t(e,s,i,a){if(0===i.length)return"";if(0===s.length)return i.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=s[0];let c=i[0][l];"fontFamily"===l&&(c=i[0].fontFamily||i[0].baseFontFamily);const h=function(t,e,s){let i=0;if("fontFamily"===e)for(;t[i]&&("mop"===t[i].type||(t[i].fontFamily||t[i].baseFontFamily)===s);)i++;else if("mode"===e)for(;t[i]&&t[i][e]===s;)i++;else for(;t[i]&&("mop"===t[i].type||t[i][e]===s);)i++;return i}(i,l,c);if("text"===i[0].mode){if("fontShape"===l&&i[0].fontShape)"it"===i[0].fontShape?(n="\\textit{",r="}"):"sl"===i[0].fontShape?(n="\\textsl{",r="}"):"sc"===i[0].fontShape?(n="\\textsc{",r="}"):"n"===i[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+i[0].fontShape+"}",r="}");else if("fontSeries"===l&&i[0].fontSeries)"b"===i[0].fontSeries?(n="\\textbf{",r="}"):"l"===i[0].fontSeries?(n="\\textlf{",r="}"):"m"===i[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+i[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(s+=" & "),s+=Ye(this,this.array[i][e],t);i1&&(s+=" "),s+=Ye(this,this.body,t),s+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?s+="("+Ye(this,this.body,t)+")":(s+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(s+=" "),s+=Ye(this,this.body,t),s+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" "));break;case"delim":case"sizeddelim":s+=n+"{"+this.delim+"}";break;case"rule":s+=n,this.shift&&(s+=`[${Ye(this,this.shift,t)}em]`),s+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":s+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":s+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?s+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?s+=this.latex+" ":"\\unicode"===n?(s+='\\unicode{"',s+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),s+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?s+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?s+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(s+="\\limits "),"nolimits"===this.limits&&(s+="\\nolimits "));break;case"box":if("\\bbox"===n){if(s+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),s+=`[${t.join(",")}]`}s+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?s+=`\\boxed{${Ye(this,this.body,t)}}`:(s+=n,this.framecolor&&(s+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(s+=`{${ae(this.backgroundcolor)}}`),s+=`{${Ye(this,this.body,t)}}`);break;case"spacing":s+=n,"\\hspace"===n||"\\hspace*"===n?(s+="{",this.width?s+=this.width+"em":s+="0em",s+="}"):(s+=" ",this.width&&(s+=this.width+"em "));break;case"enclose":if(s+=n,"\\enclose"===n){s+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(s+=t+e,t=" ");s+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(s+=`[${e}]`)}s+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":s+="\\"+this.mathstyle+" ";break;case"space":s+=this.latex;break;case"placeholder":s+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":s+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),s+="^"+e):s+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?s+="_"+e:s+="_{"+e+"}"}return s},Qe.plural=function(t,e,s){(s=s||{}).type=s.type||"cardinal";const i=Qe.locale.substring(0,2),a="ordinal"===s.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===s.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[i]&&(o=Qe.strings[i][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===s.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const s=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=s}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ts={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},es={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ss={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let is={};const as={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function os(t,e,s){t=t.replace(/(^|[^\\])#@/g,"$1#?");const i=he.parseTokens(n(t),"math",e,s.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:s.config.macros},i),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ns(t,e,s){let i="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ts,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;i+="
    "+e[t].label+"
    "}}return i+="
    ",i+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function rs(t,e,s){for(let i=0;i"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&es[n]&&(a.setAttribute("data-shifted",es[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",es[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],s&&(o=[s,o]),a.getAttribute("data-alt-keys")){const t=is[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function ls(t,e){const s={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=s[t.config.virtualKeyboardLayout]?s[t.config.virtualKeyboardLayout]:s.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const s of t){const t=s.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=i[e.name];if(r||(r=s.qwerty[e.name]),r)for(const t of r){let s=e.class||"";s&&(s=" "+s),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(s)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var cs={make:function(t,e){let s='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ss["foreground-color"]=[];for(const t of ne)ss["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ss["background-color"]=[];for(const t of oe)ss["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});is={...ss},Object.keys(is).forEach(t=>{is[t]=is[t].slice()});const i="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];is[e]||(is[e]=[]),is[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),is[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),is[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),is[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),is[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),is[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),is[e].unshift({latex:"\\mathbb{"+i[t]+"}",aside:"blackboard",insert:"\\mathbb{"+i[t]+"}"}),is[e].unshift({latex:"\\mathbf{"+i[t]+"}",aside:"bold",insert:"\\mathbf{"+i[t]+"}"}),is[e].unshift({latex:"\\mathsf{"+i[t]+"}",aside:"sans",insert:"\\mathsf{"+i[t]+"}"}),is[e].unshift({latex:"\\mathcal{"+i[t]+"}",aside:"script",insert:"\\mathcal{"+i[t]+"}"}),is[e].unshift({latex:"\\mathfrak{"+i[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+i[t]+"}"})}for(let t=0;t<=26;t++){const e=i[t];is[e]||(is[e]=[]),is[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),is[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),is[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),is[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];is[e]||(is[e]=[]),is[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),is[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),is[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),is[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),is[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},as,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ts,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let i=n[e].layers||[];n[e].layer&&i.push(n[e].layer),i=Array.from(new Set(i));for(const n of i){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const s of e)t+="${s.label?s.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}s+="
    ",s+=ns(t,a,e);const i="function"==typeof o[n]?o[n]():o[n];s+=ls(t,i),s+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=s,rs(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:rs};const hs={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},ds={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},ps={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function ms(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function us(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(i=!0,gs(t)&&(n=t.index,t.index+=1),ys(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Ss(t.atoms[r].subscript,0,0,s).mathML,a+=Ss(t.atoms[n].superscript,0,0,s).mathML,a+="";else if(n>=0){if(a=""+o,gs(t)){const e=Ss(t.atoms[n].superscript,0,0,s).mathML,i=Ss(t.atoms[n+1].superscript,0,0,s).mathML;a+=""!==e&&""!==e||""!==i&&""!==i?""===e||""===e?"":e:""}else a+=Ss(t.atoms[n].superscript,0,0,s).mathML;a+=""}else r>=0?(a=""+o,a+=Ss(t.atoms[r].subscript,0,0,s).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return i}function gs(t){return t.index"+t,a+=Ss(o.subscript,0,0,s).mathML,a+=Ss(o.superscript,0,0,s).mathML,a+=""):o.superscript?(a=""+t,a+=Ss(o.superscript,0,0,s).mathML,a+=""):o.subscript&&(a=""+t,a+=Ss(o.subscript,0,0,s).mathML,a+=""),a.length>0&&(i=!0,e.mathML+=a,e.lastType=""),i))}function xs(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(i=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),i}function ks(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,s=t.index,i=!1,a=!1;for(;s=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(i=!0,o=""+o+"",n<0&&gs(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Ss(t.atoms[n].superscript,0,0,s).mathML,o+=""),t.mathML+=o,t.lastType="mn"),i}function vs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=As(t.atoms[l],s),a+=Ss(t.atoms,l+1,c,s).mathML,a+=As(t.atoms[c],s),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bs(a,t,s)&&(i=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function ws(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Ss(n.subscript,0,0,s).mathML,a+=Ss(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Ss(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Ss(n.subscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Ms(e.body)+"":As(e,s);a+=r,t.index+=1,bs(a,t,s)&&(i=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function Ss(t,e,s,i){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(s=s||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(i);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function As(t,e){let s="";const i=Ms(t.body);return i&&(s=""+i+""),s}function Ms(t){if(!t)return"";if("string"==typeof t)return ms(t);if(!Array.isArray(t)&&"string"==typeof t.body)return ms(t.body);let e="";for(const s of t)"string"==typeof s.body&&(e+=s.body);return ms(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let i,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Ss(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(ps[this.lFence]||this.lFence)+"")),c+="",i=0;i"+Ss(this.array[a][i],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(ps[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(ps[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Ss(this.numer,0,0,t).mathML||" ",c+=Ss(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Ss(this.numer,0,0,t).mathML+"",c+=""+Ss(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(ps[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Ss(this.body,0,0,t).mathML,c+=Ss(this.index,0,0,t).mathML,c+=""):(c+="",c+=Ss(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(ps[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Ss(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(ps[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(ps[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Ss(this.body,0,0,t).mathML,c+=""+(ps[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Ss(l,0,0,t).mathML,c+=Ss(n,0,0,t).mathML,c+=Ss(r,0,0,t).mathML,c+=""):r?(c+=""+Ss(l,0,0,t).mathML,c+=Ss(r,0,0,t).mathML,c+=""):n&&(c+=""+Ss(l,0,0,t).mathML,c+=Ss(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const s=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;s?c="&#x"+s[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const i=/\d/.test(c)?"mn":"mi";c="<"+i+d+us(this.id,t)+">"+ms(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&ps[p]?""+ps[p]+"":As(this,t);break;case"mpunct":c='"+(ps[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Ss(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Ss(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Ss(t,0,0,e).mathML};const Cs={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_s={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ts={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Ls={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fs(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Ds(t){return t&&Ls[t]||-1}function zs(t){return/=|=>/.test(t)?"right":"left"}function Es(t){if("f"===t||"g"===t)return!0;const e=Ts[t];return!!e&&!!/%[^01_^]?/.test(e)}function qs(t){t=(t||"").trim();let e=Cs[t];if(!e)if(/^\\[^{}]+$/.test(t)){const s=At.getInfo(t,"math",{});e=s&&s.value||t.slice(1)}else e=t;return e}function Is(t){if(!t)return null;const e=qs(Ks(t)),s=[Ds(e),zs(e)];return s[0]<=0?null:s}function Ps(t){return null!==Is(t)}const Os={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Bs={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},$s={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Rs={",":"list",";":"list2"};function Ks(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const s of t)e+=Ks(s);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const s of t.body)e+=Ks(s);return e}return""}function Ns(t){return"string"==typeof t.sym?function(t){let e=Ts[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const s=At.getInfo("\\"+t,"math");!s||s.fontFamily&&"cmr"!==s.fontFamily&&"ams"!==s.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Ws(t){return parseFloat(t.num)}function Hs(t){return"object"==typeof t&&void 0!==t.num}function Vs(t){let e=0;return Hs(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hi(t.num.re):0:parseFloat(t.num)),e}function Us(t){let e=0;return Hs(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hi(t.num.im):0),e}function js(t){return t&&void 0!==t.sup}function Gs(t){return t&&void 0!==t.sub}function Zs(t,e,s){let i=!1;const a=t.atoms[t.index];return a&&a.type===e&&(i=void 0===s||Ks(a)===s),i}function Xs(t,...e){const s={fn:t};if(e){const t=[];for(const s of e)s&&t.push(s);t.length>0&&(s.arg=t)}return s}function Js(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Ys(t){if(Hs(t)){const e=Vs(t),s=Us(t);return 0!==s?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-s).toString()):t.num=(-e).toString(),t}return Xs("negate",t)}function Qs(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ti(t,e){let s=t.atoms[t.index];return!s||void 0===s.superscript&&void 0===s.subscript?s=null:t.index+=1,s||(s=t.atoms[t.index+1],s&&"msubsup"===s.type&&(s.superscript||s.subscript)?t.index+=2:s=null),s?(void 0!==s.subscript&&(t.ast.sub=ri(s.subscript,e)),void 0!==s.superscript&&("msubsup"===s.type?/['\u2032]|\\prime/.test(Ks(s.superscript))?(t.index+=1,s=t.atoms[t.index+1],s&&"msubsup"===s.type&&/['\u2032]|\\prime/.test(Ks(s.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ks(s.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=ri(s.superscript,e)):t.ast.sup=ri(s.superscript,e))):t.index+=1,t}function ei(t,e){const s=t.ast;if(ii(t,"!!"))return t.index+=1,t.ast=Xs("factorial2",s),ei(t=ti(t,e),e);if(ii(t,"++"))return t.index+=1,t.ast=Xs("increment",s),ei(t=ti(t,e),e);if(ii(t,"--"))return t.index+=1,t.ast=Xs("decrement",s),ei(t=ti(t,e),e);const i=t.atoms[t.index];return i&&i.latex&&Bs[i.latex.trim()]&&(t.ast=Xs(Bs[i.latex.trim()],s),t=ei(t=ti(t,e),e)),t}function si(t,e,s,i){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ks(o)===e)t.index+=1,o=(t=oi(t,i)).atoms[t.index],o&&"mclose"===o.type&&Ks(o)===s&&(Qs(t)&&(t.ast={group:t.ast}),t=ei(t=ti(t,i),i));else if("textord"===o.type&&Ks(o)===e)t.index+=1,o=(t=oi(t,i)).atoms[t.index],o&&"textord"===o.type&&Ks(o)===s&&(t.index+=1,t=ei(t=ti(t,i),i));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=oi(t,i)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=ei(t=ti(t,i),i))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=oi(t,i)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===s&&(t.index+=1,t=ei(t=ti(t,i),i));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==s)return;t.ast=ri(o.body,i),Qs(t)&&(t.ast={group:t.ast}),t=ei(t=ti(t,i),i)}return t.minPrec=a,t}{let i=!0;if("mopen"===o.type?(e=o.latex.trim(),s=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,s=At.RIGHT_DELIM[e]):"leftright"===o.type?(i=!1,e=o.leftDelim,"?"===(s=o.rightDelim)&&(s=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),s=At.RIGHT_DELIM[e]),e&&s){if("|"===e&&"|"===s){const i=t.atoms[t.index+1];i&&"textord"===i.type&&"|"===i.latex&&(e="\\lVert",s="\\rVert")}if(t=si(t,e,s))return i&&(t.index+=1),t.ast={fn:Os[e+s]||e+s,arg:[t.ast]},t.minPrec=a,t}}}function ii(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ks(t.atoms[t.index])+Ks(t.atoms[t.index+1])}function ai(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zs(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,s=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return s&&(t.index+=1),s}return t.index+=1,Zs(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zs(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function oi(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let s=function t(e,s){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let i=e.atoms[e.index];if("text"===i.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qs(Ks(i));if(ai(e))e.ast=Xs(e.ast,t(e,s).ast);else{if("root"===i.type)return e.index=0,e.atoms=i.body,t(e,s);if("mbin"===i.type&&"-"===a)e.index+=1,(e=t(e,s)).ast=Ys(e.ast);else if("mbin"===i.type&&"+"===a)e.index+=1,(e=t(e,s)).ast=Xs("add",e.ast);else if("mord"===i.type&&/^[0-9.]$/.test(i.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ni(t)))),e=[t])}return e}function ri(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const s=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;s.push(e)}else{const i=oi(t,e).ast;if(!i)return;s.push(i)}return s.length>1?Xs("text",...s):s[0]||void 0}({atoms:ni(t)},e)}function li(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let s="";if(e.length>0){"."!==t[0]&&(s+=t[0]);let i="";for(const a of e)s+=i+a,i=t[2];"."!==t[1]&&(s+=t[1])}return s}function ci(t,e){const s=t.length;t=t.substr(0,e.precision-2);for(let s=0;s1&&(i+o.repeat(n+1)).startsWith(t))return"0"===o?i.replace(/(\d{3})/g,"$1"+e.groupSeparator):i.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return s!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hi(t){return parseFloat(parseFloat(t).toPrecision(15))}function di(t,e){let s="";if("number"==typeof e.precision){if("number"!=typeof t){let s="",i="";if("-"===t[0]?(s="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(i=a[4]||"","0"===o){let i=0;for(;"0"===n[i]&&i=e.precision)a="0",s="";else{a=t[i];const s=ci(t.substr(i+1),e);s&&(a+=e.decimalMarker+s)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),i>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-i).toString():a+="10^{"+(1-i).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const s=ci(n,e);s&&(t+=e.decimalMarker+s)}}else if(t.length>e.precision){const s=t.length;let i=t[0];const a=ci(t.substr(2),e);a&&(i+=e.decimalMarker+a,"}"!==i[i.length-1]&&(i+="\\ldots")),"1"!==i?i+=e.exponentProduct:i="",e.exponentMarker?i+=e.exponentMarker+(s-2).toString():i+="10^{"+(s-2).toString()+"}",t=i}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return i&&(i=e.exponentMarker?e.exponentMarker+i:e.exponentProduct+" 10^{"+i+"}"),s+t+i}t=hi(t)}if("engineering"===e.scientificNotation)if(0===t)s="0";else{const i=Math.abs(t);let a=Math.round(Math.log10(i));a-=a%3,i<1e3&&(a=0);let o=i/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=ci(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",s=(t<0?"-":"")+o+a}else{const i="string"==typeof t?t:t.toString();let a,o,n,r=i.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=i,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=ci(n,e)),n&&(n=e.decimalMarker+n),s=a+n+(o||"")}return s}te.MathAtom.prototype.toAST=function(t){let e,s,i,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(s=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),s=he.parseTokens(n(s),"math",null,t.macros),i=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),i=he.parseTokens(n(i),"math",null,t.macros),o=Xs("divide",ri(s,t),ri(i,t))):o.fn="divide"):o.group=ri(this.body,t);break;case"genfrac":o=Xs("divide",ri(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Js(1):ri(this.denom,t));break;case"surd":o=this.index?Xs("pow",ri(this.body,t),Xs("divide",Js(1),ri(this.index,t))):Xs("sqrt",ri(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qs(Ks(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=ri(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xs("card",ri(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>ri(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const s=[];s.push(ri(e[0],t));let i=ri(e[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(t=>"string"!=typeof t)),s.push(i||{}),o.args.push(s)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return ri(t,e)};var pi=function t(e,s){const i=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},s);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hs(e)){const s=Ws(e);if(s===-1/0)a="-\\infty ";else if(s===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(s)?"\\text{NaN}":di(e.num,i);else{const t=Vs(e),s=Us(e);isNaN(t)||isNaN(s)?a="\\text{NaN}":Math.abs(s)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=di(t,i)),Math.abs(s)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=s>0?"+":""),a+=(1!==Math.abs(s)?di(s,i):"")+"\\imaginaryI "))}js(e)&&(a+="^{"+t(e.sup,i)+"}"),Gs(e)&&(a+="_{"+t(e.sub,i)+"}")}else if(e.group)a=t(e.group,i),Hs(e.group)||Ns(e.group)?0!==Us(e.group)&&(a=li(e.fence||"(),",a)):a=li(e.fence||"(),",a),js(e)&&(a+="^{"+t(e.sup,i)+"}"),Gs(e)&&(a+="_{"+t(e.sub,i)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fs(e,0),i)+"|_{",e.arg&&2===e.arg.length)a+=t(Fs(e,1));else{let s="";for(let i=1;i=2)a=t(Fs(e,0),i),Hs(Fs(e,0))||Ns(Fs(e,0))||(a=li(e.fence||"(),",a)),a+="^{"+t(Fs(e,1),i)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,i)).join(" = ");else{const s=function(t){let e=Ts[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=s;let o="";if(/%(?![01_^])/.test(s)&&Array.isArray(e.arg)&&e.arg.length>1)a+=li(e.fence||"(),",...e.arg.map(e=>t(e,i)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fs(e,0),i),r=t(Fs(e,1),i),l=[...e.arg];/%0/.test(s)&&(a=a.replace("%0",n),l.shift()),/%1/.test(s)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=li(e.fence||"(),",...l.map(e=>t(e,i))))}else o=li(e.fence||"(),","");a=js(e)?a.replace("%^","^{"+t(e.sup,i)+"}"):a.replace("%^",""),a=Gs(e)?a.replace("%_","_{"+t(e.sub,i)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const s=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?s.push(li("() ",t(a,i))):0!==Vs(o=a)&&0!==Us(o)?s.push(li("() ",t(a,i))):js(e)&&0!==Us(a)&&1!==Us(a)?s.push(li("() ",t(a,i))):s.push(t(a,i));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hs(e.arg[0])&&"divide"!==e.arg[0].fn||Hs(e.arg[1])&&(0!==Vs(e.arg[1])||1!==Us(e.arg[1]))?s.join(" \\times "):s[0]+s[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hs(e.arg[0])&&Ws(e.arg[0])<0?s[0]:"+"+s[0];else{a=s[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function ui(t){let e=0;if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&(e+=1);return 1===e}function fi(t){let e="";if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&"string"==typeof s.body&&(e+=s.body);return e}function gi(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],s,a)}else t.addEventListener(a,s,i)}}function yi(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],s,a)}else t.removeEventListener(a,s,i)}}function bi(t,e){let s=document.getElementById(t);return s?s.setAttribute("data-refcount",parseInt(s.getAttribute("data-refcount"))+1):(s=document.createElement("div"),s.setAttribute("aria-hidden","true"),s.setAttribute("data-refcount","1"),s.className=e,s.id=t,document.body.appendChild(s)),s}function xi(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ki(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function s(t){return""+t+""}if(!t)return"";let i="";if(t.id&&"math"===e.speechMode&&(i+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let s=te.toSpeakableFragment(t.index,e);s=s.trim();const a=s.replace(//g,"");i+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+s+', of '+n+'. End root'}else ui(t.body)?i+=" the square root of "+n+" , ":i+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":i+=mi[t.leftDelim]||t.leftDelim,i+=te.toSpeakableFragment(t.body,e),i+=mi[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":i+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=t.latex?t.latex.trim():"";if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){i=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)i+=a;else{if("mbin"===t.type&&(i+=''),a){const t=mi[a]||(o?mi[o.trim()]:"");if(t)i+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";i+=t||function(t){let s="";return e.textToSpeechMarkup?/[a-z]/.test(t)?s+=' '+t+"":/[A-Z]/.test(t)?s+="capital "+t.toLowerCase():s+=t:/[a-z]/.test(t)?s+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?s+=" 'capital "+t.toUpperCase()+"'":s+=t,s}(a)}}else i+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(i+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let s=te.toSpeakableFragment(t.superscript,e);s=s.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the summation from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=te.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the summation from '+s+' of ',r=!0}else i+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let s=te.toSpeakableFragment(t.superscript,e);s=s.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the product from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=te.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the product from '+s+' of ',r=!0}else i+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),i+=' the integral from '+s(o)+' to '+s(a)+' of ',r=!0}else i+=' the integral of ';else if("string"==typeof t.body){i+=mi[t.body]||mi[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?i+=" "+t.latex.substr(1):i+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),ui(t.body)?i+=" crossed out "+n+" , ":i+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let s=te.toSpeakableFragment(t.superscript,e);s=s.trim();const a=s.replace(/<[^>]*>/g,"");if(ui(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(i+='')}"′"===a?i+=" prime ":"2"===a?i+=" squared ":"3"===a?i+=" cubed ":isNaN(parseInt(a))?i+=" to the "+s+"; ":i+=' to the '+a+" power; "}else isNaN(parseInt(a))?i+=" raised to the "+s+"; ":i+=' raised to the '+a+" power; "}if(!r&&t.subscript){let s=te.toSpeakableFragment(t.subscript,e);s=s.trim(),ui(t.subscript)?i+=" sub "+s:i+=" subscript "+s+". End subscript. "}}return i},te.toSpeakableText=function(t,e){const s=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(s.speechMode="math",window.sre&&"sre"===s.textToSpeechRules){s.generateID=!0;const e=te.toMathML(t,s);return e?(s.textToSpeechMarkup&&(s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup=s.textToSpeechMarkup,"ssml"===s.textToSpeechRulesOptions.markup&&(s.textToSpeechRulesOptions.markup="ssml_step"),s.textToSpeechRulesOptions.rate=s.speechEngineRate),s.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(s.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let i=te.toSpeakableFragment(t,s);if("ssml"===s.textToSpeechMarkup){let t="";s.speechEngineRate&&(t=''),i=''+t+"

    "+i+"

    "+(t?"
    ":"")+""}else i="mac"===s.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?i.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):i.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return i};class vi{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let s=this.element.textContent;s&&(s=s.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?i+="\n \n \n ":i+='',i+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(i+=`"):i+="",i+="",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=i;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bi("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bi("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gi(this.element,"focus",this),gi(this.element,"blur",this),gi(this.textarea,"cut",this),gi(this.textarea,"copy",this),gi(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gi(this.field,"pointerdown",this):gi(this.field,"touchstart:active mousedown",this),gi(window,"resize",this);const o={...e};o.onSelectionDidChange=vi.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vi.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Be.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const s=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=s}}(this.mathlist),s.length>0&&this.$latex(s),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ki(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,yi(this.textarea,"cut",this),yi(this.textarea,"copy",this),yi(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xi(this.popover),xi(this.keystrokeCaption),xi(this.virtualKeyboard),xi(document.getElementById("mathlive-alternate-keys-panel")),yi(this.element,"pointerdown",this),yi(this.element,"touchstart:active mousedown",this),yi(this.element,"focus",this),yi(this.element,"blur",this),yi(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let s;return Array.from(e.children).forEach((function(e){s=s||t(e)})),s}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const s=t.getBoundingClientRect();s.lefte.right&&(e.right=s.right),s.bottom>e.bottom&&(e.bottom=s.bottom),s.top=t.left&&s<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,s,i);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(i=me.pathFromString(e[0]).path,0===s.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const i=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=i=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){if(this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,s=this._pathFromPoint(d,p,{bias:0}),s){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,s),s=me.clone(this.mathlist.path),s[s.length-1].offset-=1):this.mathlist.setPath(s,0),o=!0,this.style={},3===t.detail||Si>2?(n(t),3!==t.detail&&3!==Si||this.mathlist.selectAll_()):i||(i=!0,window.PointerEvent?(gi(e.field,"pointermove",h),gi(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gi(window,"blur",n),t.touches?(gi(t.target,"touchmove",h),gi(t.target,"touchend",n)):(gi(window,"mousemove",h),gi(window,"mouseup",n))),2!==t.detail&&2!==Si||(a=!0,this.mathlist.selectGroup_()))}}else wi=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const s=t?t.path:[],i=this.mathlist.path,a=i[i.length-1];let o="";for(;s.length>i.length;)o+="out of "+e(t.parent(),s[s.length-1])+"; ",s.pop();if(!this.mathlist.isCollapsed())return Ai(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=Ai(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,s)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const s=this.element.getBoundingClientRect();e.style.left=s.left+"px",e.style.top=s.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,s=!1,i=[],a=!1;if(Array.isArray(t)?(e=t[0],i=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...i),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,s=!0}else"function"==typeof this[e]&&(a=this[e](...i),s=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),s}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let s=0,i=!1;for(this.mathlist.contentWillChange();!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),i||(a.applyStyle({mode:"text"}),a.latex=a.body),s-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let s=0,i=!1;for(;!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),i||a.applyStyle({mode:"math",type:"mord"}),s-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,s=!1;for(;!s;){const i=this.mathlist.sibling(e);s=!(i&&("text"===i.mode&&!i.type||"math"===i.mode&&/mord|textord|mpunct/.test(i.type))),s||(t=i.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(s));const i=this.getTextBeforeAnchor_()+s;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(s))return!0;if(/[\^_]/.test(s))return/(^|\s)[a-zA-Z][^_]$/.test(i)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[s];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(i))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(s))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(i))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(i)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(i))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(s))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(i)&&!/(dxd|abc|xyz|uvw)$/.test(i))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(i))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(i)&&!/(αβγ)$/.test(i))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(s))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let s,i,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!s&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const i=this.mode;s?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==i&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(s||a||(a=ve.selectorForKeystroke(this.mode,t)),!s&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!s){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||s)&&s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const s=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[i],{...this.config,suppressChangeNotifications:!0}),this.mode=s}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(s,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),s.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),s=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(s),s))return}let s="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=i(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),i=At.suggest(e+t);a=i.length>1,0===i.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),i[0].match!==e+t&&this.mathlist.insertSuggestion(i[0].match,-i[0].match.length+e.length+1),s=i[0].match)}else if("math"===this.mode){const s={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(s){if("moveToSuperscript"===s){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===s&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(s)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,s,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let s=0;ski(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,s=!1;for(;t&&!s;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,s=!0),e+=1,t=this.mathlist.ancestor(e)}const s=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),i=N.makeSpan(s,"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",i.height,"em");const o=[a];if(0!==i.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",i.height+i.depth,"em"),t.setStyle("vertical-align",-i.depth,"em"),o.push(t)}o.push(i);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let s="";if("latex"===(e=e||"latex")||"latex-expanded"===e)s=t.toLatex("latex-expanded"===e);else if("mathML"===e)s=t.toMathML(this.config);else if("spoken"===e)s=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",s=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const i=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),s=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=i,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);s=JSON.stringify(e)}else"ASCIIMath"===e&&(s=function t(e,s){if(!e)return"";if(Array.isArray(e)){let s="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let i=0;for(s='"';e[i]&&"text"===e[i].mode;)s+=e[i].body,i++;s+='"'+t(e.slice(i))}else{let i=0;for(;e[i]&&"math"===e[i].mode;)s+=t(e[i]),i++;s+=t(e.slice(i))}return s.trim()}if("text"===e.mode)return'"'+e.body+'"';let i="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":i=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(i+="(",i+=t(e.numer),i+=")/(",i+=t(e.denom),i+=")"):(i+="("+t(e.numer)+"),",i+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?i+="root("+t(e.index)+")("+t(e.body)+")":i+="sqrt("+t(e.body)+")";break;case"leftright":i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",i+=t(e.body),i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":i=hs[a]||a||("string"==typeof e.body?e.body:""),"\\"===i[0]&&(i+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?i=String.fromCharCode(parseInt("0x"+o[1])):i.length>0&&"\\"===i.charAt(0)&&(i="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":i=a&&hs[a]?hs[a]:a&&ds[a]?ds[a]:e.body;break;case"mopen":case"mclose":i+=e.body;break;case"mpunct":i=ds[a]||a;break;case"mop":"​"!==e.body&&(i="",i+="\\operatorname"===a?t(e.body):e.body||a,i+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":i=" "}if(e.subscript){i+="_";const s=t(e.subscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}if(e.superscript){i+="^";const s=t(e.superscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}return i}(t,this.config));return s}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const s=te.makeRoot("math",e);return this.formatMathlist(s,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!0:s.subscript&&(i=!1),e+=1,s=this.mathlist.ancestor(e);return i?t:0}_subscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!1:s.subscript&&(i=!0),e+=1,s=this.mathlist.ancestor(e);return i?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const s=this._getSelectionBounds();s&&(t={x:s.right+e.left-this.field.scrollLeft,y:s.top+e.top-this.field.scrollTop})}if(t){const s=t.x-window.scrollX;se.right&&this.field.scroll({top:0,left:s-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const s=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=s)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,s){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,s&&this.$insert(s,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const s=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(s)}else{const s=he.parseTokens(n(e),t,null,this.config.macros);s?this.mathlist.spliceCommandStringAroundInsertionPoint(s):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const s=this.suggestionIndex%e.length,i=t.length-e[s].match.length;0!==i&&this.mathlist.insertSuggestion(e[s].match,i),Je.showPopoverWithLatex(this,e[s].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const s=this;let i,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gi(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),i=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+s.config.namespace+"command-pressed");n&&s.$perform(JSON.parse(n));const l=t.getAttribute("data-"+s.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&s.$perform(JSON.parse(l))}),300))}})),gi(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gi(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?s.style.width="286px":4===e.length||2===e.length?s.style.width="146px":1===e.length?s.style.width="86px":s.style.width="146px",s.style.height="auto";let i="";for(const t of e)i+="";i="
      "+i+"
    ",s.innerHTML=i,cs.makeKeycap(this,s.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-s.clientHeight<0&&(s.style.width="auto",e.length<=6?s.style.height="56px":e.length<=12?s.style.height="108px":s.style.height="205px");const t=(a.top-s.clientHeight+5).toString()+"px",i=Math.max(0,Math.min(window.innerWidth-s.offsetWidth,(a.left+a.right-s.offsetWidth)/2))+"px";s.style.transform="translate("+i+","+t+")",s.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xi(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let s=!1;for(let i=0;i=1){s=[];for(let t=1;t<=i;t++)s.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),i=t.mathlist.endOffset()+1;if(i<=e.length-1){s=[];for(let t=i;t<=e.length-1;t++)s.push(e[t])}break}case"start":case"end":break;case"group":s=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(s=t.mathlist.parent());break}}return s}(this,t);if(null===s)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const i={...this.config};(e.withHighlighting||"amazon"===i.speechEngine)&&(i.textToSpeechMarkup=window.sre&&"sre"===i.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(i.generateID=!0));const a=te.toSpeakableText(s,i);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,i),!1}}let wi,Si=0;function Ai(t,e,s){const i=Object.assign({},t.config);return i.textToSpeechMarkup="",i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(s,i)}function Mi(t,e,s,i){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=Ai(t,"deleted: ",i):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(s):"replacement"===e?a=Ai(t,"",t.mathlist.sibling(0)):"line"===e?(a=Ai(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=i?Ai(t,e+" ",i):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vi.prototype.undo_=vi.prototype.undo,vi.prototype.redo_=vi.prototype.redo,vi.prototype.scrollIntoView_=vi.prototype.scrollIntoView,vi.prototype.scrollToStart_=vi.prototype.scrollToStart,vi.prototype.scrollToEnd_=vi.prototype.scrollToEnd,vi.prototype.insert_=vi.prototype.$insert;var Ci={isValidMathfield:ki,MathField:vi};function _i(t,e,s){let i=s,a=0;const o=t.length;for(;i0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_i(s,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+s.length),mathstyle:i}),c=r+s.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){s.textContent=t}return s.className="sr-only",s}(t,s)),/\bspeakable-text\b/i.test(s.renderAccessibleContent)&&s.renderToSpeakableText){const i=document.createElement("span");i.innerHTML=s.renderToSpeakableText(t,s),i.className="sr-only",e.appendChild(i)}return e.appendChild(a),e}return a}function Di(t,e){let s=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))s=document.createDocumentFragment(),s.appendChild(Fi(t,void 0,e,!0));else{const i=Li(t,e.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;s=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Bi(t,e,s){if(!window)return;if(!s&&window.mathlive&&(s=window.mathlive.config),"amazon"!==(s=s||{}).speechEngine)return void(s.handleSpeak&&s.handleSpeak(e));if(!window.AWS)return;const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:s.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=s.onReadAloudStatus||window.mathlive.onReadAloudStatus;i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),s=new Blob([t.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(s);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const s of window.mathlive.readAloudMarks)s.time0&&Array.from(e.children).forEach(e=>{t(e,s)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=i,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function $i(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Ri(t,e){Ei&&((e=e||{}).renderToMarkup=e.renderToMarkup||qi,e.renderToMathML=e.renderToMathML||Ii,e.renderToSpeakableText=e.renderToSpeakableText||Pi,e.macros=e.macros||At.MACROS,Ei.renderMathInElement($i(t),e))}function Ki(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const Ni={latexToMarkup:qi,latexToMathML:Ii,latexToSpeakableText:Pi,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const s=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(s,e)},astToLatex:function(t,e){return pi(t,e)},makeMathField:function(t,e){if(!Ci)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Oi,e.handleReadAloud=e.handleReadAloud||Bi,new Ci.MathField($i(t),e)},renderMathInDocument:function(t){Ri(document.body,t)},renderMathInElement:Ri,revertToOriginalContent:function(t,e){(t=(t=$i(t)).children[1])instanceof Ci.MathField?t.revertToOriginalContent():(Ki(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=$i(t)).children[1])instanceof Ci.MathField?t.originalContent:(Ki(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Bi,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let s=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(s=e.time/1e3);let i=window.mathlive.readAloudTokens.indexOf(t);i>=0&&(i+=e,i=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return B(i[0],e)}return new L(t,e)}function O(t,e,i){const s=B(e,i);return s.type=t,s}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=$(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=N.makeSymbol,Ct=N.makeSpan,_t=N.makeVlist;function Tt(t,e,i,s,a,o){const n=Mt("Size"+i+"-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,Ct(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+i)}function Ft(t,e,i,s,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Bt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Ot(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return $t(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?It:Dt.includes(e)?Bt:Pt;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(At.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Tt(t,e,r.size,s,a,o):Ft(t,e,i,s,a,o)}function $t(t,e,i){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Rt={makeSizedDelim:function(t,e,i,s,a){return"."===e?$t(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,i,!1,s,a):zt.includes(e)?Ft(t,e,qt[i],!1,s,a):null)},makeCustomSizedDelim:Ot,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return $t(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Ot(t,e,h,!0,a,o)}};const Kt=N.makeSpan,Nt=N.makeOrd,Wt=N.makeInner,Ht=N.makeHlist,Vt=N.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=Nt(Qt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(i)+N.depth(i)+o&&(o=(o+l-(N.height(i)+N.depth(i)))/2),r.setTop(r.height-N.height(i)-(o+s));const c=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Vt(t,[i,o,c,s]);if(!this.index)return this.bind(t,Nt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Kt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,Nt([Kt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,Nt(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=N.skew(i));const a=Math.min(N.height(i),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Kt(Kt(o),"accent-body"+n);return r=Vt(t,[i,-a,r]),r.children[1].setLeft(2*s),Nt(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Qt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[i,3*s,a,s]);else{const e=Kt(i);o=Vt(t,[s,a,3*s,e],"top",N.height(e))}return Nt(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?Kt(Qt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?Kt(Qt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Yt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Kt(Qt(t,this.body),"inner");return Nt([e,Kt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=Nt("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=N.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=N.makeOp(Qt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=Nt(Qt(t,this.body)),i=Kt();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=Kt([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=Nt(Qt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=Kt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(Array.isArray(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Kt(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Kt(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-s.metrics.supDrop,l=N.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*i){l=4*i-(r-a.depth)+N.height(o);const t=.8*s.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,N.height(o)-.8*s.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Kt(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?Kt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Kt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=N.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Xt(t){const e=Kt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,i,s){const a=[];for(const o of e){const e=Kt(Qt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Vt(t,a,"individualShift")}function Yt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=Kt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+i;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=N.height(e)-i;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=N.depth(e)+i;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return N.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const i=new Zt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Zt("","first")),i},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},ie={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var se=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in ie)if(ie[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return se(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new re("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=At.getInfo("\\"+i.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new re(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=At.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=se(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=At.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new re(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=At.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else"#"===t.type&&("?"===t.value?e=this.placeholder():this.args&&(e=this.args[t.value]||this.placeholder()));return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[i])return ue[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=fe[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=xe(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(i.test(xe(ue[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ce(t,e){let i;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Be()),i}function _e(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Te(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new te.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function Le(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ce(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(De(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||De(t[i],e)})))return!0;if(t.array)for(let i=_e(t.array);i>=0;i--)if(De(Ce(t.array,i),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Ie(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=qe(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Ie(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Ie(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Ie(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=qe(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=Pe(i[1],e),t+=qe(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Ie(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=qe(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=Pe(i[1],e),t+=qe(i[2],e),s=!0)),!s)if(i=Ie(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Ie(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+qe(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+qe(i.rest,e):i.match+qe(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+qe(i[2],e),s=!0)),t}function Ie(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=ve.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function Pe(t,e){let i=ve.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Be(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},we.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new we;s.path=me.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},we.prototype.setRange=function(t,e,i){i=i||{};const s=me.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),s)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Be()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&At.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=_e(e.array);i>=0;i--)t(Ce(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},we.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=_e(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=Se(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},we.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},we.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},we.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=At.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new te.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Be()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Be()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Be()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Be()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Be()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Me(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=Ae(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=At.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Oe={EditableMathlist:we,parseMathString:Ee};const $e={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Re={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ke={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Ne(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=Ke[t.target.value]||t.target.value),e||($e[t.key]?(e=$e[t.key],i=!1):e=Re[t.key],e||(e=Ke[t.key.toLowerCase()])),!e&&t.code&&(e=Re[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function We(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke(Ne(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke(Ne(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:Ne,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&Ze(t,i),t.popover.classList.add("is-visible")}function Ze(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Xe(t);const s=e,a=function(t,e){const i=he.parseTokens(n(t),"math",null,e.config.macros),s=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=N.makeSpan(s,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[s]||e,t),o=je(s),r=ve.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else if("mode"===e)for(;t[s]&&t[s][e]===i;)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Ye(this,this.array[s][e],t);s1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Ye(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Ye(this,this.shift,t)}em]`),i+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Ye(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ae(this.backgroundcolor)}}`),i+=`{${Ye(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Qe.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Qe.locale.substring(0,2),a="ordinal"===i.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[s]&&(o=Qe.strings[s][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const i=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ti={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ei={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ii={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let si={};const ai={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function oi(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=he.parseTokens(n(t),"math",e,i.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ni(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ti,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function ri(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ei[n]&&(a.setAttribute("data-shifted",ei[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ei[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=si[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function li(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ci={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ii["foreground-color"]=[];for(const t of ne)ii["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ii["background-color"]=[];for(const t of oe)ii["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});si={...ii},Object.keys(si).forEach(t=>{si[t]=si[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),si[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),si[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),si[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ai,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ti,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ni(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=li(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,ri(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:ri};const hi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},di={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},pi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function mi(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ui(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,gi(t)&&(n=t.index,t.index+=1),yi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=Si(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,gi(t)){const e=Si(t.atoms[n].superscript,0,0,i).mathML,s=Si(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=Si(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function gi(t){return t.index"+t,a+=Si(o.subscript,0,0,i).mathML,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=Si(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function xi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&gi(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Si(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function vi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Ai(t.atoms[l],i),a+=Si(t.atoms,l+1,c,i).mathML,a+=Ai(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function wi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Mi(e.body)+"":Ai(e,i);a+=r,t.index+=1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function Si(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Ai(t,e){let i="";const s=Mi(t.body);return s&&(i=""+s+""),i}function Mi(t){if(!t)return"";if("string"==typeof t)return mi(t);if(!Array.isArray(t)&&"string"==typeof t.body)return mi(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return mi(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Si(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(pi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+Si(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(pi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Si(this.numer,0,0,t).mathML||" ",c+=Si(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Si(this.numer,0,0,t).mathML+"",c+=""+Si(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Si(this.body,0,0,t).mathML,c+=Si(this.index,0,0,t).mathML,c+=""):(c+="",c+=Si(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Si(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(pi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Si(this.body,0,0,t).mathML,c+=""+(pi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):r?(c+=""+Si(l,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):n&&(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+ui(this.id,t)+">"+mi(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&pi[p]?""+pi[p]+"":Ai(this,t);break;case"mpunct":c='"+(pi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Si(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Si(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Si(t,0,0,e).mathML};const Ci={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_i={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ti={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Li={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fi(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Di(t){return t&&Li[t]||-1}function zi(t){return/=|=>/.test(t)?"right":"left"}function Ei(t){if("f"===t||"g"===t)return!0;const e=Ti[t];return!!e&&!!/%[^01_^]?/.test(e)}function qi(t){t=(t||"").trim();let e=Ci[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=At.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Ii(t){if(!t)return null;const e=qi(Ki(t)),i=[Di(e),zi(e)];return i[0]<=0?null:i}function Pi(t){return null!==Ii(t)}const Bi={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Oi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},$i={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Ri={",":"list",";":"list2"};function Ki(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const i of t)e+=Ki(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=Ki(i);return e}return""}function Ni(t){return"string"==typeof t.sym?function(t){let e=Ti[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=At.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Wi(t){return parseFloat(t.num)}function Hi(t){return"object"==typeof t&&void 0!==t.num}function Vi(t){let e=0;return Hi(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hs(t.num.re):0:parseFloat(t.num)),e}function Ui(t){let e=0;return Hi(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hs(t.num.im):0),e}function ji(t){return t&&void 0!==t.sup}function Gi(t){return t&&void 0!==t.sub}function Zi(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||Ki(a)===i),s}function Xi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Ji(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Yi(t){if(Hi(t)){const e=Vi(t),i=Ui(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Xi("negate",t)}function Qi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ts(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=rs(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test(Ki(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test(Ki(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ki(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=rs(i.superscript,e)):t.ast.sup=rs(i.superscript,e))):t.index+=1,t}function es(t,e){const i=t.ast;if(ss(t,"!!"))return t.index+=1,t.ast=Xi("factorial2",i),es(t=ts(t,e),e);if(ss(t,"++"))return t.index+=1,t.ast=Xi("increment",i),es(t=ts(t,e),e);if(ss(t,"--"))return t.index+=1,t.ast=Xi("decrement",i),es(t=ts(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Oi[s.latex.trim()]&&(t.ast=Xi(Oi[s.latex.trim()],i),t=es(t=ts(t,e),e)),t}function is(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ki(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"mclose"===o.type&&Ki(o)===i&&(Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s));else if("textord"===o.type&&Ki(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"textord"===o.type&&Ki(o)===i&&(t.index+=1,t=es(t=ts(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=os(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=es(t=ts(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=es(t=ts(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=rs(o.body,s),Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=At.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=At.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=is(t,e,i))return s&&(t.index+=1),t.ast={fn:Bi[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function ss(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ki(t.atoms[t.index])+Ki(t.atoms[t.index+1])}function as(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zi(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,Zi(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zi(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function os(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qi(Ki(s));if(as(e))e.ast=Xi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Yi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Xi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ns(t)))),e=[t])}return e}function rs(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=os(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Xi("text",...i):i[0]||void 0}({atoms:ns(t)},e)}function ls(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function cs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hs(t){return parseFloat(parseFloat(t).toPrecision(15))}function ds(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=cs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=cs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=cs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=hs(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=cs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=cs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}te.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=he.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=he.parseTokens(n(s),"math",null,t.macros),o=Xi("divide",rs(i,t),rs(s,t))):o.fn="divide"):o.group=rs(this.body,t);break;case"genfrac":o=Xi("divide",rs(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Ji(1):rs(this.denom,t));break;case"surd":o=this.index?Xi("pow",rs(this.body,t),Xi("divide",Ji(1),rs(this.index,t))):Xi("sqrt",rs(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qi(Ki(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=rs(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xi("card",rs(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>rs(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(rs(e[0],t));let s=rs(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return rs(t,e)};var ps=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hi(e)){const i=Wi(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":ds(e.num,s);else{const t=Vi(e),i=Ui(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ds(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?ds(i,s):"")+"\\imaginaryI "))}ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Hi(e.group)||Ni(e.group)?0!==Ui(e.group)&&(a=ls(e.fence||"(),",a)):a=ls(e.fence||"(),",a),ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fi(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Fi(e,1));else{let i="";for(let s=1;s=2)a=t(Fi(e,0),s),Hi(Fi(e,0))||Ni(Fi(e,0))||(a=ls(e.fence||"(),",a)),a+="^{"+t(Fi(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ti[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ls(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fi(e,0),s),r=t(Fi(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ls(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ls(e.fence||"(),","");a=ji(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Gi(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ls("() ",t(a,s))):0!==Vi(o=a)&&0!==Ui(o)?i.push(ls("() ",t(a,s))):ji(e)&&0!==Ui(a)&&1!==Ui(a)?i.push(ls("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hi(e.arg[0])&&"divide"!==e.arg[0].fn||Hi(e.arg[1])&&(0!==Vi(e.arg[1])||1!==Ui(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hi(e.arg[0])&&Wi(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function us(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function fs(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function gs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function ys(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function bs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function xs(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ks(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let i=te.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else us(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ms[t.leftDelim]||t.leftDelim,s+=te.toSpeakableFragment(t.body,e),s+=ms[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ms[a]||(o?ms[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ms[t.body]||ms[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),us(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(us(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),us(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},te.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=te.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=te.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class vs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gs(this.element,"focus",this),gs(this.element,"blur",this),gs(this.textarea,"cut",this),gs(this.textarea,"copy",this),gs(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gs(this.field,"pointerdown",this):gs(this.field,"touchstart:active mousedown",this),gs(window,"resize",this);const o={...e};o.onSelectionDidChange=vs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Oe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ks(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ys(this.textarea,"cut",this),ys(this.textarea,"copy",this),ys(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xs(this.popover),xs(this.keystrokeCaption),xs(this.virtualKeyboard),xs(document.getElementById("mathlive-alternate-keys-panel")),ys(this.element,"pointerdown",this),ys(this.element,"touchstart:active mousedown",this),ys(this.element,"focus",this),ys(this.element,"blur",this),ys(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=me.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1;const r=this.field.querySelector(".ML__mathlive").getBoundingClientRect();if(i=d>r.right?[{relation:"body",offset:this.mathlist.root.body.length-1}]:this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=me.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||Ss>2?(n(t),3!==t.detail&&3!==Ss||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(gs(e.field,"pointermove",h),gs(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gs(window,"blur",n),t.touches?(gs(t.target,"touchmove",h),gs(t.target,"touchend",n)):(gs(window,"mousemove",h),gs(window,"mouseup",n))),2!==t.detail&&2!==Ss||(a=!0,this.mathlist.selectGroup_()))}}else ws=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return As(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=As(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=ve.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=At.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;iks(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),e+=1,t=this.mathlist.ancestor(e)}const i=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=N.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=hi[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&hi[a]?hi[a]:a&&di[a]?di[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=di[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=te.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const i=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=he.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Je.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gs(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),gs(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gs(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ci.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xs(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=te.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ws,Ss=0;function As(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(i,s)}function Ms(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=As(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=As(t,"",t.mathlist.sibling(0)):"line"===e?(a=As(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?As(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vs.prototype.undo_=vs.prototype.undo,vs.prototype.redo_=vs.prototype.redo,vs.prototype.scrollIntoView_=vs.prototype.scrollIntoView,vs.prototype.scrollToStart_=vs.prototype.scrollToStart,vs.prototype.scrollToEnd_=vs.prototype.scrollToEnd,vs.prototype.insert_=vs.prototype.$insert;var Cs={isValidMathfield:ks,MathField:vs};function _s(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_s(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ds(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Fs(t,void 0,e,!0));else{const s=Ls(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Os(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function $s(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Rs(t,e){Es&&((e=e||{}).renderToMarkup=e.renderToMarkup||qs,e.renderToMathML=e.renderToMathML||Is,e.renderToSpeakableText=e.renderToSpeakableText||Ps,e.macros=e.macros||At.MACROS,Es.renderMathInElement($s(t),e))}function Ks(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const Ns={latexToMarkup:qs,latexToMathML:Is,latexToSpeakableText:Ps,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const i=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(i,e)},astToLatex:function(t,e){return ps(t,e)},makeMathField:function(t,e){if(!Cs)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Bs,e.handleReadAloud=e.handleReadAloud||Os,new Cs.MathField($s(t),e)},renderMathInDocument:function(t){Rs(document.body,t)},renderMathInElement:Rs,revertToOriginalContent:function(t,e){(t=(t=$s(t)).children[1])instanceof Cs.MathField?t.revertToOriginalContent():(Ks(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=$s(t)).children[1])instanceof Cs.MathField?t.originalContent:(Ks(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Os,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s wrapperBounds.right) { + // If outside the bounds of the rendered formula, + // set the anchor to the last element of the root + anchor = [ + { + relation: 'body', + offset: this.mathlist.root.body.length - 1, + }, + ]; + } else { + anchor = this._pathFromPoint(anchorX, anchorY, { bias: 0 }); + } if (anchor) { // Create divs to block out pointer tracking to the left and right of // the mathfield (to avoid triggering the hover of the virtual From 4d1f4b4cc914b25f8aa1589abaec1dcf54f7c50e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 15 Feb 2020 15:13:20 +0000 Subject: [PATCH 21/28] Bump rollup from 1.31.0 to 1.31.1 Bumps [rollup](https://github.com/rollup/rollup) from 1.31.0 to 1.31.1. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v1.31.0...v1.31.1) Signed-off-by: dependabot-preview[bot] --- npm-shrinkwrap.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 16677d35f..bf466bff7 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -10133,9 +10133,9 @@ } }, "rollup": { - "version": "1.31.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.31.0.tgz", - "integrity": "sha512-9C6ovSyNeEwvuRuUUmsTpJcXac1AwSL1a3x+O5lpmQKZqi5mmrjauLeqIjvREC+yNRR8fPdzByojDng+af3nVw==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.31.1.tgz", + "integrity": "sha512-2JREN1YdrS/kpPzEd33ZjtuNbOuBC3ePfuZBdKEybvqcEcszW1ckyVqzcEiEe0nE8sqHK+pbJg+PsAgRJ8+1dg==", "dev": true, "requires": { "@types/estree": "*", diff --git a/package.json b/package.json index d04529b6b..32e21ddf3 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "postcss-cli": "^7.1.0", "prettier": "^1.19.1", "rimraf": "^3.0.1", - "rollup": "^1.31.0", + "rollup": "^1.31.1", "rollup-plugin-copy": "^3.3.0", "rollup-plugin-terser": "^5.2.0", "sutro-jsdoc-theme": "^1.0", From fa73380676356a6207d71e9a644ed0825c940fca Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 15 Feb 2020 15:17:29 +0000 Subject: [PATCH 22/28] Bump rimraf from 3.0.1 to 3.0.2 Bumps [rimraf](https://github.com/isaacs/rimraf) from 3.0.1 to 3.0.2. - [Release notes](https://github.com/isaacs/rimraf/releases) - [Changelog](https://github.com/isaacs/rimraf/blob/master/CHANGELOG.md) - [Commits](https://github.com/isaacs/rimraf/compare/v3.0.1...v3.0.2) Signed-off-by: dependabot-preview[bot] --- npm-shrinkwrap.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index bf466bff7..4d7dc8bd7 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -10124,9 +10124,9 @@ "dev": true }, "rimraf": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.1.tgz", - "integrity": "sha512-IQ4ikL8SjBiEDZfk+DFVwqRK8md24RWMEJkdSlgNLkyyAImcjf8SWvU1qFMDOb4igBClbTQ/ugPqXcRwdFTxZw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" diff --git a/package.json b/package.json index 32e21ddf3..203669137 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "nyc": "^15.0.0", "postcss-cli": "^7.1.0", "prettier": "^1.19.1", - "rimraf": "^3.0.1", + "rimraf": "^3.0.2", "rollup": "^1.31.1", "rollup-plugin-copy": "^3.3.0", "rollup-plugin-terser": "^5.2.0", From f4d0351f9006ee22298a36d0953e33db326db30b Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 15 Feb 2020 15:21:27 +0000 Subject: [PATCH 23/28] Bump less from 3.10.3 to 3.11.1 Bumps [less](https://github.com/less/less.js) from 3.10.3 to 3.11.1. - [Release notes](https://github.com/less/less.js/releases) - [Changelog](https://github.com/less/less.js/blob/master/CHANGELOG.md) - [Commits](https://github.com/less/less.js/compare/v3.10.3...v3.11.1) Signed-off-by: dependabot-preview[bot] --- npm-shrinkwrap.json | 70 ++++++++++++++++++++------------------------- package.json | 2 +- 2 files changed, 32 insertions(+), 40 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4d7dc8bd7..8f1131c13 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2881,9 +2881,9 @@ "optional": true }, "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", + "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", "dev": true, "optional": true }, @@ -7337,9 +7337,9 @@ } }, "less": { - "version": "3.10.3", - "resolved": "https://registry.npmjs.org/less/-/less-3.10.3.tgz", - "integrity": "sha512-vz32vqfgmoxF1h3K4J+yKCtajH0PWmjkIFgbs5d78E/c/e+UQTnI+lWK+1eQRE95PXM2mC3rJlLSSP9VQHnaow==", + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/less/-/less-3.11.1.tgz", + "integrity": "sha512-tlWX341RECuTOvoDIvtFqXsKj072hm3+9ymRBe76/mD6O5ZZecnlAOVDlWAleF2+aohFrxNidXhv2773f6kY7g==", "dev": true, "requires": { "clone": "^2.1.2", @@ -7350,7 +7350,8 @@ "mkdirp": "^0.5.0", "promise": "^7.1.1", "request": "^2.83.0", - "source-map": "~0.6.0" + "source-map": "~0.6.0", + "tslib": "^1.10.0" }, "dependencies": { "source-map": { @@ -8110,20 +8111,20 @@ "dev": true }, "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", "dev": true, "optional": true }, "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", "dev": true, "optional": true, "requires": { - "mime-db": "1.40.0" + "mime-db": "1.43.0" } }, "mimic-fn": { @@ -9721,9 +9722,9 @@ "optional": true }, "psl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", - "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz", + "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==", "dev": true, "optional": true }, @@ -9993,9 +9994,9 @@ "dev": true }, "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "dev": true, "optional": true, "requires": { @@ -10006,7 +10007,7 @@ "extend": "~3.0.2", "forever-agent": "~0.6.1", "form-data": "~2.3.2", - "har-validator": "~5.1.0", + "har-validator": "~5.1.3", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", @@ -10016,7 +10017,7 @@ "performance-now": "^2.1.0", "qs": "~6.5.2", "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", + "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" }, @@ -11292,23 +11293,14 @@ } }, "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", "dev": true, "optional": true, "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true, - "optional": true - } + "psl": "^1.1.28", + "punycode": "^2.1.1" } }, "trim": { @@ -11562,9 +11554,9 @@ } }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true, "optional": true }, diff --git a/package.json b/package.json index 203669137..55d7be3fb 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "http-server": "^0.12.1", "husky": "^4.2.1", "jsdoc": "^3.6.3", - "less": "^3.10.3", + "less": "^3.11.1", "lint-staged": "^10.0.7", "npm-run-all": "^4.1.5", "nyc": "^15.0.0", From c1aa55f53fb02ec4f56c6181137cb28c436154d5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 15 Feb 2020 15:25:53 +0000 Subject: [PATCH 24/28] Bump husky from 4.2.1 to 4.2.3 Bumps [husky](https://github.com/typicode/husky) from 4.2.1 to 4.2.3. - [Release notes](https://github.com/typicode/husky/releases) - [Changelog](https://github.com/typicode/husky/blob/master/CHANGELOG.md) - [Commits](https://github.com/typicode/husky/compare/v4.2.1...v4.2.3) Signed-off-by: dependabot-preview[bot] --- npm-shrinkwrap.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 8f1131c13..1ec7f092b 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -3726,9 +3726,9 @@ "dev": true }, "compare-versions": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.5.1.tgz", - "integrity": "sha512-9fGPIB7C6AyM18CJJBHt5EnCZDG3oiTJYy0NjfIAGjKpzv0tkxWko7TNQHF5ymqm7IH03tqmeuBxtvD+Izh6mg==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", "dev": true }, "component-emitter": { @@ -6295,9 +6295,9 @@ "dev": true }, "husky": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.1.tgz", - "integrity": "sha512-Qa0lRreeIf4Tl92sSs42ER6qc3hzoyQPPorzOrFWfPEVbdi6LuvJEqWKPk905fOWIR76iBpp7ECZNIwk+a8xuQ==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.3.tgz", + "integrity": "sha512-VxTsSTRwYveKXN4SaH1/FefRJYCtx+wx04sSVcOpD7N2zjoHxa+cEJ07Qg5NmV3HAK+IRKOyNVpi2YBIVccIfQ==", "dev": true, "requires": { "chalk": "^3.0.0", diff --git a/package.json b/package.json index 55d7be3fb..4b092a54f 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "eslint-plugin-prettier": "^3.1.2", "eslint-watch": "^6.0.1", "http-server": "^0.12.1", - "husky": "^4.2.1", + "husky": "^4.2.3", "jsdoc": "^3.6.3", "less": "^3.11.1", "lint-staged": "^10.0.7", From bbd8981497bc12951021ac1485669daca38e579b Mon Sep 17 00:00:00 2001 From: Arnaud CETOUTE Date: Fri, 21 Feb 2020 10:13:29 +0100 Subject: [PATCH 25/28] chore(update): update from upstream --- README.md | 42 +++++++++++++++++++++++++++++++++++------ package.json | 13 ++----------- src/core/definitions.js | 18 +++++++++--------- 3 files changed, 47 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 701e766fa..6e898e204 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,33 @@ +⚠️ Fork to fix IE 11 + Edge issue ⚠️ +Based on https://github.com/arnog/mathlive/issues/195 + +Global changes : + +```diff +// src/core/definitions.js + ++// Edit : https://github.com/arnog/mathlive/issues/195#issuecomment-493741744 +-const LETTER = +- typeof navigator !== 'undefined' && /firefox|edge/i.test(navigator.userAgent) ? +- /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/ : +- new RegExp("\\p{Letter}", 'u'); + ++const LETTER = ++ // typeof navigator !== 'undefined' && /firefox/i.test(navigator.userAgent) ? ++ /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/; // : ++ // new RegExp("\\p{Letter}", 'u'); + +-const LETTER_AND_DIGITS = +- typeof navigator !== 'undefined' && /firefox|edge/i.test(navigator.userAgent) ? +- /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/ : +- new RegExp("[0-9\\p{Letter}]", 'u'); + ++const LETTER_AND_DIGITS = ++ // typeof navigator !== 'undefined' && /firefox/i.test(navigator.userAgent) ? ++ /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/; // : ++ // new RegExp("[0-9\\p{Letter}]", 'u'); +``` + math live [![Maintenance](https://img.shields.io/maintenance/yes/2020.svg)]() @@ -24,20 +54,20 @@ Try it at [mathlive.io](https://mathlive.io) diff --git a/package.json b/package.json index 4b092a54f..a0c7611e0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "mathlive", + "name": "@lls/mathlive", "version": "0.34.0", "description": "Render and edit beautifully typeset math", "license": "MIT", @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/arnog/mathlive.git" + "url": "https://github.com/lelivrescolaire/mathlive.git" }, "keywords": [ "math", @@ -93,15 +93,6 @@ "maintained node versions", "not dead" ], - "author": "Arno Gourdol ", - "contributors": [ - "Louis Larpin (lilfaf.github.io)", - "Neil Soiffer (https://github.com/NSoiffer)", - "Jason Boxman (https://github.com/jboxman)", - "Synergy Codes (https://www.synergycodes.com/)", - "Rafał Piekarski (https://github.com/rpdiss)" - ], - "bugs": "https://github.com/arnog/mathlive/issues/", "devDependencies": { "@babel/cli": "^7.8.4", "@babel/core": "^7.8.4", diff --git a/src/core/definitions.js b/src/core/definitions.js index b358ca1ad..5f0d789d7 100644 --- a/src/core/definitions.js +++ b/src/core/definitions.js @@ -934,7 +934,7 @@ category = 'Environments'; first row left aligned, last right aligned, others centered last line has an eqn. counter. multline* will omit the counter no output if inside an equation - + 'gather' at most two columns first column centered, second column right aligned @@ -3624,17 +3624,17 @@ const COMMAND_MODE_CHARACTERS = /[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ] // but Firefox doesn't support it // (https://bugzilla.mozilla.org/show_bug.cgi?id=1361876). Booo... // See also https://stackoverflow.com/questions/26133593/using-regex-to-match-international-unicode-alphanumeric-characters-in-javascript + +// Edit : https://github.com/arnog/mathlive/issues/195#issuecomment-493741744 const LETTER = - typeof navigator !== 'undefined' && - /firefox|edge/i.test(navigator.userAgent) - ? /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/ - : new RegExp('\\p{Letter}', 'u'); + // typeof navigator !== 'undefined' && /firefox/i.test(navigator.userAgent) ? + /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/; // : + // new RegExp("\\p{Letter}", 'u'); const LETTER_AND_DIGITS = - typeof navigator !== 'undefined' && - /firefox|edge/i.test(navigator.userAgent) - ? /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/ - : new RegExp('[0-9\\p{Letter}]', 'u'); + // typeof navigator !== 'undefined' && /firefox/i.test(navigator.userAgent) ? + /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/; // : + // new RegExp("[0-9\\p{Letter}]", 'u'); export default { matchCodepoint, From 4aef812be3da52f0b5da293ef1b398c3c37f9b15 Mon Sep 17 00:00:00 2001 From: Arnaud CETOUTE Date: Fri, 21 Feb 2020 10:26:32 +0100 Subject: [PATCH 26/28] fix(build): merge --- .gitignore | 1 + dist/mathlive.js | 2 +- dist/mathlive.mjs | 2 +- dist/src/core/definitions.js | 18 +++++++++--------- npm-shrinkwrap.json | 2 +- rollup.config.js | 1 + 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 301ac7bdc..9b9cfc694 100755 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ ehthumbs.db Thumbs.db #IDE files .idea +dist/ diff --git a/dist/mathlive.js b/dist/mathlive.js index 9838b12a9..aafbdbcc6 100644 --- a/dist/mathlive.js +++ b/dist/mathlive.js @@ -1 +1 @@ -var global,factory;global=this,factory=function(){function t(t,e){e=e||0;const i=t.charCodeAt(e);if(55296<=i&&i<=56319&&e=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return B(i[0],e)}return new L(t,e)}function O(t,e,i){const s=B(e,i);return s.type=t,s}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=$(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=N.makeSymbol,Ct=N.makeSpan,_t=N.makeVlist;function Tt(t,e,i,s,a,o){const n=Mt("Size"+i+"-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,Ct(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+i)}function Ft(t,e,i,s,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Bt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Ot(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return $t(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?It:Dt.includes(e)?Bt:Pt;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(At.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Tt(t,e,r.size,s,a,o):Ft(t,e,i,s,a,o)}function $t(t,e,i){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Rt={makeSizedDelim:function(t,e,i,s,a){return"."===e?$t(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,i,!1,s,a):zt.includes(e)?Ft(t,e,qt[i],!1,s,a):null)},makeCustomSizedDelim:Ot,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return $t(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Ot(t,e,h,!0,a,o)}};const Kt=N.makeSpan,Nt=N.makeOrd,Wt=N.makeInner,Ht=N.makeHlist,Vt=N.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=Nt(Qt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(i)+N.depth(i)+o&&(o=(o+l-(N.height(i)+N.depth(i)))/2),r.setTop(r.height-N.height(i)-(o+s));const c=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Vt(t,[i,o,c,s]);if(!this.index)return this.bind(t,Nt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Kt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,Nt([Kt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,Nt(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=N.skew(i));const a=Math.min(N.height(i),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Kt(Kt(o),"accent-body"+n);return r=Vt(t,[i,-a,r]),r.children[1].setLeft(2*s),Nt(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Qt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[i,3*s,a,s]);else{const e=Kt(i);o=Vt(t,[s,a,3*s,e],"top",N.height(e))}return Nt(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?Kt(Qt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?Kt(Qt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Yt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Kt(Qt(t,this.body),"inner");return Nt([e,Kt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=Nt("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=N.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=N.makeOp(Qt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=Nt(Qt(t,this.body)),i=Kt();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=Kt([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=Nt(Qt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=Kt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(Array.isArray(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Kt(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Kt(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-s.metrics.supDrop,l=N.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*i){l=4*i-(r-a.depth)+N.height(o);const t=.8*s.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,N.height(o)-.8*s.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Kt(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?Kt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Kt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=N.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Xt(t){const e=Kt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,i,s){const a=[];for(const o of e){const e=Kt(Qt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Vt(t,a,"individualShift")}function Yt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=Kt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+i;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=N.height(e)-i;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=N.depth(e)+i;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return N.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const i=new Zt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Zt("","first")),i},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},ie={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var se=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in ie)if(ie[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return se(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new re("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=At.getInfo("\\"+i.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new re(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=At.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=se(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=At.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new re(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=At.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else"#"===t.type&&("?"===t.value?e=this.placeholder():this.args&&(e=this.args[t.value]||this.placeholder()));return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[i])return ue[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=fe[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=xe(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(i.test(xe(ue[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ce(t,e){let i;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Be()),i}function _e(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Te(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new te.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function Le(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ce(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(De(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||De(t[i],e)})))return!0;if(t.array)for(let i=_e(t.array);i>=0;i--)if(De(Ce(t.array,i),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Ie(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=qe(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Ie(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Ie(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Ie(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=qe(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=Pe(i[1],e),t+=qe(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Ie(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=qe(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=Pe(i[1],e),t+=qe(i[2],e),s=!0)),!s)if(i=Ie(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Ie(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+qe(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+qe(i.rest,e):i.match+qe(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+qe(i[2],e),s=!0)),t}function Ie(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=ve.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function Pe(t,e){let i=ve.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Be(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},we.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new we;s.path=me.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},we.prototype.setRange=function(t,e,i){i=i||{};const s=me.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),s)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Be()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&At.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=_e(e.array);i>=0;i--)t(Ce(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},we.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=_e(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=Se(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},we.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},we.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},we.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=At.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new te.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Be()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Be()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Be()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Be()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Be()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Me(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=Ae(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=At.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Oe={EditableMathlist:we,parseMathString:Ee};const $e={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Re={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ke={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Ne(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=Ke[t.target.value]||t.target.value),e||($e[t.key]?(e=$e[t.key],i=!1):e=Re[t.key],e||(e=Ke[t.key.toLowerCase()])),!e&&t.code&&(e=Re[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function We(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke(Ne(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke(Ne(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:Ne,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&Ze(t,i),t.popover.classList.add("is-visible")}function Ze(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Xe(t);const s=e,a=function(t,e){const i=he.parseTokens(n(t),"math",null,e.config.macros),s=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=N.makeSpan(s,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[s]||e,t),o=je(s),r=ve.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else if("mode"===e)for(;t[s]&&t[s][e]===i;)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Ye(this,this.array[s][e],t);s1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Ye(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Ye(this,this.shift,t)}em]`),i+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Ye(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ae(this.backgroundcolor)}}`),i+=`{${Ye(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Qe.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Qe.locale.substring(0,2),a="ordinal"===i.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[s]&&(o=Qe.strings[s][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const i=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ti={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ei={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ii={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let si={};const ai={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function oi(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=he.parseTokens(n(t),"math",e,i.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ni(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ti,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function ri(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ei[n]&&(a.setAttribute("data-shifted",ei[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ei[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=si[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function li(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ci={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ii["foreground-color"]=[];for(const t of ne)ii["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ii["background-color"]=[];for(const t of oe)ii["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});si={...ii},Object.keys(si).forEach(t=>{si[t]=si[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),si[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),si[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),si[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ai,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ti,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ni(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=li(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,ri(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:ri};const hi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},di={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},pi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function mi(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ui(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,gi(t)&&(n=t.index,t.index+=1),yi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=Si(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,gi(t)){const e=Si(t.atoms[n].superscript,0,0,i).mathML,s=Si(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=Si(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function gi(t){return t.index"+t,a+=Si(o.subscript,0,0,i).mathML,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=Si(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function xi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&gi(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Si(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function vi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Ai(t.atoms[l],i),a+=Si(t.atoms,l+1,c,i).mathML,a+=Ai(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function wi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Mi(e.body)+"":Ai(e,i);a+=r,t.index+=1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function Si(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Ai(t,e){let i="";const s=Mi(t.body);return s&&(i=""+s+""),i}function Mi(t){if(!t)return"";if("string"==typeof t)return mi(t);if(!Array.isArray(t)&&"string"==typeof t.body)return mi(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return mi(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Si(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(pi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+Si(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(pi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Si(this.numer,0,0,t).mathML||" ",c+=Si(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Si(this.numer,0,0,t).mathML+"",c+=""+Si(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Si(this.body,0,0,t).mathML,c+=Si(this.index,0,0,t).mathML,c+=""):(c+="",c+=Si(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Si(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(pi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Si(this.body,0,0,t).mathML,c+=""+(pi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):r?(c+=""+Si(l,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):n&&(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+ui(this.id,t)+">"+mi(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&pi[p]?""+pi[p]+"":Ai(this,t);break;case"mpunct":c='"+(pi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Si(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Si(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Si(t,0,0,e).mathML};const Ci={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_i={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ti={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Li={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fi(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Di(t){return t&&Li[t]||-1}function zi(t){return/=|=>/.test(t)?"right":"left"}function Ei(t){if("f"===t||"g"===t)return!0;const e=Ti[t];return!!e&&!!/%[^01_^]?/.test(e)}function qi(t){t=(t||"").trim();let e=Ci[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=At.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Ii(t){if(!t)return null;const e=qi(Ki(t)),i=[Di(e),zi(e)];return i[0]<=0?null:i}function Pi(t){return null!==Ii(t)}const Bi={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Oi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},$i={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Ri={",":"list",";":"list2"};function Ki(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const i of t)e+=Ki(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=Ki(i);return e}return""}function Ni(t){return"string"==typeof t.sym?function(t){let e=Ti[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=At.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Wi(t){return parseFloat(t.num)}function Hi(t){return"object"==typeof t&&void 0!==t.num}function Vi(t){let e=0;return Hi(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hs(t.num.re):0:parseFloat(t.num)),e}function Ui(t){let e=0;return Hi(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hs(t.num.im):0),e}function ji(t){return t&&void 0!==t.sup}function Gi(t){return t&&void 0!==t.sub}function Zi(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||Ki(a)===i),s}function Xi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Ji(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Yi(t){if(Hi(t)){const e=Vi(t),i=Ui(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Xi("negate",t)}function Qi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ts(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=rs(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test(Ki(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test(Ki(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ki(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=rs(i.superscript,e)):t.ast.sup=rs(i.superscript,e))):t.index+=1,t}function es(t,e){const i=t.ast;if(ss(t,"!!"))return t.index+=1,t.ast=Xi("factorial2",i),es(t=ts(t,e),e);if(ss(t,"++"))return t.index+=1,t.ast=Xi("increment",i),es(t=ts(t,e),e);if(ss(t,"--"))return t.index+=1,t.ast=Xi("decrement",i),es(t=ts(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Oi[s.latex.trim()]&&(t.ast=Xi(Oi[s.latex.trim()],i),t=es(t=ts(t,e),e)),t}function is(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ki(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"mclose"===o.type&&Ki(o)===i&&(Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s));else if("textord"===o.type&&Ki(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"textord"===o.type&&Ki(o)===i&&(t.index+=1,t=es(t=ts(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=os(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=es(t=ts(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=es(t=ts(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=rs(o.body,s),Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=At.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=At.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=is(t,e,i))return s&&(t.index+=1),t.ast={fn:Bi[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function ss(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ki(t.atoms[t.index])+Ki(t.atoms[t.index+1])}function as(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zi(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,Zi(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zi(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function os(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qi(Ki(s));if(as(e))e.ast=Xi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Yi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Xi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ns(t)))),e=[t])}return e}function rs(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=os(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Xi("text",...i):i[0]||void 0}({atoms:ns(t)},e)}function ls(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function cs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hs(t){return parseFloat(parseFloat(t).toPrecision(15))}function ds(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=cs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=cs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=cs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=hs(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=cs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=cs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}te.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=he.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=he.parseTokens(n(s),"math",null,t.macros),o=Xi("divide",rs(i,t),rs(s,t))):o.fn="divide"):o.group=rs(this.body,t);break;case"genfrac":o=Xi("divide",rs(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Ji(1):rs(this.denom,t));break;case"surd":o=this.index?Xi("pow",rs(this.body,t),Xi("divide",Ji(1),rs(this.index,t))):Xi("sqrt",rs(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qi(Ki(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=rs(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xi("card",rs(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>rs(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(rs(e[0],t));let s=rs(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return rs(t,e)};var ps=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hi(e)){const i=Wi(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":ds(e.num,s);else{const t=Vi(e),i=Ui(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ds(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?ds(i,s):"")+"\\imaginaryI "))}ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Hi(e.group)||Ni(e.group)?0!==Ui(e.group)&&(a=ls(e.fence||"(),",a)):a=ls(e.fence||"(),",a),ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fi(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Fi(e,1));else{let i="";for(let s=1;s=2)a=t(Fi(e,0),s),Hi(Fi(e,0))||Ni(Fi(e,0))||(a=ls(e.fence||"(),",a)),a+="^{"+t(Fi(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ti[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ls(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fi(e,0),s),r=t(Fi(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ls(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ls(e.fence||"(),","");a=ji(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Gi(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ls("() ",t(a,s))):0!==Vi(o=a)&&0!==Ui(o)?i.push(ls("() ",t(a,s))):ji(e)&&0!==Ui(a)&&1!==Ui(a)?i.push(ls("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hi(e.arg[0])&&"divide"!==e.arg[0].fn||Hi(e.arg[1])&&(0!==Vi(e.arg[1])||1!==Ui(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hi(e.arg[0])&&Wi(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function us(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function fs(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function gs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function ys(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function bs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function xs(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ks(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let i=te.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else us(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ms[t.leftDelim]||t.leftDelim,s+=te.toSpeakableFragment(t.body,e),s+=ms[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ms[a]||(o?ms[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ms[t.body]||ms[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),us(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(us(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),us(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},te.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=te.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=te.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class vs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gs(this.element,"focus",this),gs(this.element,"blur",this),gs(this.textarea,"cut",this),gs(this.textarea,"copy",this),gs(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gs(this.field,"pointerdown",this):gs(this.field,"touchstart:active mousedown",this),gs(window,"resize",this);const o={...e};o.onSelectionDidChange=vs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Oe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ks(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ys(this.textarea,"cut",this),ys(this.textarea,"copy",this),ys(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xs(this.popover),xs(this.keystrokeCaption),xs(this.virtualKeyboard),xs(document.getElementById("mathlive-alternate-keys-panel")),ys(this.element,"pointerdown",this),ys(this.element,"touchstart:active mousedown",this),ys(this.element,"focus",this),ys(this.element,"blur",this),ys(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=me.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1;const r=this.field.querySelector(".ML__mathlive").getBoundingClientRect();if(i=d>r.right?[{relation:"body",offset:this.mathlist.root.body.length-1}]:this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=me.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||Ss>2?(n(t),3!==t.detail&&3!==Ss||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(gs(e.field,"pointermove",h),gs(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gs(window,"blur",n),t.touches?(gs(t.target,"touchmove",h),gs(t.target,"touchend",n)):(gs(window,"mousemove",h),gs(window,"mouseup",n))),2!==t.detail&&2!==Ss||(a=!0,this.mathlist.selectGroup_()))}}else ws=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return As(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=As(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=ve.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=At.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;iks(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),e+=1,t=this.mathlist.ancestor(e)}const i=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=N.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=hi[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&hi[a]?hi[a]:a&&di[a]?di[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=di[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=te.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const i=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=he.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Je.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gs(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),gs(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gs(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ci.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xs(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=te.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ws,Ss=0;function As(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(i,s)}function Ms(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=As(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=As(t,"",t.mathlist.sibling(0)):"line"===e?(a=As(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?As(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vs.prototype.undo_=vs.prototype.undo,vs.prototype.redo_=vs.prototype.redo,vs.prototype.scrollIntoView_=vs.prototype.scrollIntoView,vs.prototype.scrollToStart_=vs.prototype.scrollToStart,vs.prototype.scrollToEnd_=vs.prototype.scrollToEnd,vs.prototype.insert_=vs.prototype.$insert;var Cs={isValidMathfield:ks,MathField:vs};function _s(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_s(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ds(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Fs(t,void 0,e,!0));else{const s=Ls(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Os(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function $s(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Rs(t,e){Es&&((e=e||{}).renderToMarkup=e.renderToMarkup||qs,e.renderToMathML=e.renderToMathML||Is,e.renderToSpeakableText=e.renderToSpeakableText||Ps,e.macros=e.macros||At.MACROS,Es.renderMathInElement($s(t),e))}function Ks(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}return{latexToMarkup:qs,latexToMathML:Is,latexToSpeakableText:Ps,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const i=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(i,e)},astToLatex:function(t,e){return ps(t,e)},makeMathField:function(t,e){if(!Cs)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Bs,e.handleReadAloud=e.handleReadAloud||Os,new Cs.MathField($s(t),e)},renderMathInDocument:function(t){Rs(document.body,t)},renderMathInElement:Rs,revertToOriginalContent:function(t,e){(t=(t=$s(t)).children[1])instanceof Cs.MathField?t.revertToOriginalContent():(Ks(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=$s(t)).children[1])instanceof Cs.MathField?t.originalContent:(Ks(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Os,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return B(i[0],e)}return new L(t,e)}function O(t,e,i){const s=B(e,i);return s.type=t,s}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=$(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"};var wt={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/,LETTER_AND_DIGITS:/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/};const St=N.makeSymbol,At=N.makeSpan,Mt=N.makeVlist;function Ct(t,e,i,s,a,o){const n=St("Size"+i+"-Regular",wt.getValue("math",e)),r=N.makeStyleWrap(t,At(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function _t(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),At(St(e,wt.getValue("math",t)),"delimsizinginner"+i)}function Tt(t,e,i,s,a,o){let n,r,l,c;n=l=c=wt.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(wt.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(wt.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(wt.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(wt.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(_t(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],zt=[0,1.2,1.8,2.4,3],Et=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],qt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Pt(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return Bt(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Dt.includes(e)?Et:Lt.includes(e)?It:qt;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(wt.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=St("AMS-Regular",wt.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Ct(t,e,r.size,s,a,o):Tt(t,e,i,s,a,o)}function Bt(t,e,i){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Ot={makeSizedDelim:function(t,e,i,s,a){return"."===e?Bt(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Lt.includes(e)||Dt.includes(e)?Ct(t,e,i,!1,s,a):Ft.includes(e)?Tt(t,e,zt[i],!1,s,a):null)},makeCustomSizedDelim:Pt,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return Bt(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Pt(t,e,h,!0,a,o)}};const $t=N.makeSpan,Rt=N.makeOrd,Kt=N.makeInner,Nt=N.makeHlist,Wt=N.makeVlist,Ht=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,Vt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Ut={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class jt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Ut[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",Vt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ht.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=Rt(Jt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Wt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(i)+N.depth(i)+o&&(o=(o+l-(N.height(i)+N.depth(i)))/2),r.setTop(r.height-N.height(i)-(o+s));const c=$t(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Wt(t,[i,o,c,s]);if(!this.index)return this.bind(t,Rt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=$t(Jt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Wt(t,[m],"shift",-.6*(u-f));return this.bind(t,Rt([$t(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Jt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,Rt(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=N.skew(i));const a=Math.min(N.height(i),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=$t($t(o),"accent-body"+n);return r=Wt(t,[i,-a,r]),r.children[1].setLeft(2*s),Rt(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Jt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=$t(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Wt(t,[i,3*s,a,s]);else{const e=$t(i);o=Wt(t,[s,a,3*s,e],"top",N.height(e))}return Rt(o,this.position)}decomposeOverunder(t){const e=Jt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?$t(Jt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?$t(Jt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Xt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=$t(Jt(t,this.body),"inner");return Rt([e,$t(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=Rt("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=N.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=N.makeOp(Jt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=Rt(Jt(t,this.body)),i=$t();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=$t([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=Rt(Jt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=$t("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(Array.isArray(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Jt(t.sup(),this.superscript);a=$t(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Jt(t.sub(),this.subscript);o=$t(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-s.metrics.supDrop,l=N.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*i){l=4*i-(r-a.depth)+N.height(o);const t=.8*s.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Wt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,N.height(o)-.8*s.metrics.xHeight),p=Wt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Wt(t,[a],"shift",-r),p.children[0].setRight(d));const m=$t(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?$t(Jt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?$t(Jt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Xt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=N.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Gt(t){const e=$t("​","arraycolsep");return e.setWidth(t,"em"),e}function Zt(t,e,i,s){const a=[];for(const o of e){const e=$t(Jt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Wt(t,a,"individualShift")}function Xt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=$t(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+i;c=Wt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=N.height(e)-i;c=Wt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=N.depth(e)+i;c=Wt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return N.makeSpanOfType(n,c,"op-limits")}function Jt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Ut[t.size]/Ut[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var Yt={MathAtom:jt,decompose:Jt,makeRoot:function(t,e){const i=new jt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new jt("","first")),i},GREEK_REGEX:Ht};const Qt={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},te={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ee=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ie=function(t){let e=t.toUpperCase();for(const t in te)if(te[t]===e){e=t;break}for(const t in Qt)if(Qt[t]===e){e=t;break}return e},se=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ae=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const oe=Yt.MathAtom;class ne{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ee(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new oe("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new oe("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=wt.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new oe(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new oe("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=wt.getInfo("\\"+i.value,"math",this.macros);o=e?[new oe(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new oe(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new oe(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new oe(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=wt.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new oe(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new oe(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ee(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new oe("text",""," ",this.style));else if("placeholder"===t.type)e=new oe(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new oe(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new oe(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=wt.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new oe(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new oe(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new oe(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new oe(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=wt.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new oe(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=wt.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else"#"===t.type&&("?"===t.value?e=this.placeholder():this.args&&(e=this.args[t.value]||this.placeholder()));return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new oe(this.parseMode,"group",re(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var de={pathFromString:he,pathToString:ce,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return he(ce(t)).path}};const pe={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},me={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ue={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function fe(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&wt.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function ge(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function ye(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function be(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===ge("mac")||o===ge("win")||o===ge("ios")||o===ge("android")||o===ge("chromeos")||o===ge("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===ge("mac")||"ios"===ge("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var xe={KEYBOARD_SHORTCUTS:pe,INLINE_SHORTCUTS:ue,stringify:be,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ue).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=fe(t,e,ue[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=fe(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[ge("mac")+":"+t+":"+e,ge("win")+":"+t+":"+e,ge("ios")+":"+t+":"+e,ge("android")+":"+t+":"+e,ge("chromeos")+":"+t+":"+e,ge("other")+":"+t+":"+e,ge("mac")+":"+e,ge("win")+":"+e,ge("ios")+":"+e,ge("android")+":"+e,ge("chromeos")+":"+e,t+":"+e,e])if(pe[i])return pe[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=me[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=ye(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(pe).forEach(t=>{if(i.test(ye(pe[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),be(e)}};function ke(t,e){this.root=Yt.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function ve(t){const e=Object.assign(new ke(t.config,t.target),t);return e.path=de.clone(t.path),e}function we(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ae(t,e){let i;return"object"!=typeof e&&(e=Se(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Ie()),i}function Me(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Ce(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new Yt.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function _e(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ae(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Te(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function Le(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(Le(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||Le(t[i],e)})))return!0;if(t.array)for(let i=Me(t.array);i>=0;i--)if(Le(Ae(t.array,i),e))return!0}return!1}function Fe(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function De(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return ze(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function ze(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Ee(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=ze(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Ee(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=ze(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Ee(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=ze(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Ee(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=ze(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=ze(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=qe(i[1],e),t+=ze(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Ee(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=ze(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=qe(i[1],e),t+=ze(i[2],e),s=!0)),!s)if(i=Ee(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Ee(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+ze(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+ze(i.rest,e):i.match+ze(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+ze(i[2],e),s=!0)),t}function Ee(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=ze(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+ze(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=xe.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function qe(t,e){let i=xe.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Ie(){return new Yt.MathAtom("","first")}ke.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},ke.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new ke;s.path=de.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},ke.prototype.forEach=function(t){this.root.forEach(t)},ke.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},ke.prototype.setRange=function(t,e,i){i=i||{};const s=de.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(de.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(de.clone(t),s)}let a=de.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=de.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},ke.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},ke.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},ke.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},ke.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},ke.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},ke.prototype.insertFirstAtom=function(){this.siblings()},ke.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ae(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Ie()),t},ke.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},ke.prototype.isCollapsed=function(){return 0===this.extent},ke.prototype.setExtent=function(t){this.extent=t},ke.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},ke.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},ke.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&wt.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&wt.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Te(t[e]);)e-=1;for(;Te(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},ke.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},ke.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},ke.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},ke.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},ke.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=Me(e.array);i>=0;i--)t(Ae(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},ke.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},ke.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},ke.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=Me(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ae(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=Me(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},ke.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Se(this.parent().array,i);e=_e(this.parent().array,e,-1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},ke.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Se(this.parent().array,i);e=_e(this.parent().array,e,1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},ke.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=ve(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},ke.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=ve(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},ke.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},ke.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=ve(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},ke.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},ke.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},ke.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=Fe(t.numer),t.denom=Fe(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=Fe(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=Fe(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=Fe(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=Fe(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=Fe(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=Fe(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=Me(t.array);e>=0;e--)this.simplifyParen(Ae(t.array,e))})}},ke.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=De(t,{...this.config,format:"ASCIIMath"}),o=le.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)wt.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new Yt.MathAtom("command","command",e))}else""===t?o=[new Yt.MathAtom("command","command","\\")]:(t=De(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=le.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=le.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=le.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},ke.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=wt.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(wt.RIGHT_DELIM).forEach(e=>{t===wt.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},ke.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},ke.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new Yt.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},ke.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},ke.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},ke.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},ke.prototype.moveToNextPlaceholder_=function(){this.leap(1)},ke.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},ke.prototype.moveToNextChar_=function(){this.move(1)},ke.prototype.moveToPreviousChar_=function(){this.move(-1)},ke.prototype.moveUp_=function(){this.up()},ke.prototype.moveDown_=function(){this.down()},ke.prototype.moveToNextWord_=function(){this.skip(1)},ke.prototype.moveToPreviousWord_=function(){this.skip(-1)},ke.prototype.moveToGroupStart_=function(){this.setSelection(0)},ke.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},ke.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},ke.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},ke.prototype.deleteNextChar_=function(){this.delete_(1)},ke.prototype.deletePreviousChar_=function(){this.delete_(-1)},ke.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},ke.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},ke.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},ke.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},ke.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},ke.prototype.transpose_=function(){},ke.prototype.extendToNextChar_=function(){this.extend(1)},ke.prototype.extendToPreviousChar_=function(){this.extend(-1)},ke.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendUp_=function(){this.up({extend:!0})},ke.prototype.extendDown_=function(){this.down({extend:!0})},ke.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},ke.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},ke.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},ke.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},ke.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Ie()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Ie()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},ke.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Ie()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Ie()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},ke.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Ie()]),this.setSelection(0,"end",t)},ke.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},ke.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=ve(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},ke.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Se(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=we(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},ke.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=wt.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},ke.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},ke.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},ke.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},ke.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},ke.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Pe={EditableMathlist:ke,parseMathString:De};const Be={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Oe={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},$e={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Re(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=$e[t.target.value]||t.target.value),e||(Be[t.key]?(e=Be[t.key],i=!1):e=Oe[t.key],e||(e=$e[t.key.toLowerCase()])),!e&&t.code&&(e=Oe[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function Ke(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke(Re(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke(Re(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var Ne={delegateKeyboardEvents:Ke,select:Ke.select,keyboardEventToString:Re,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const We={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},He={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function Ve(t){let e=He[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ue(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&je(t,i),t.popover.classList.add("is-visible")}function je(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Ge(t){t.popover.classList.remove("is-visible")}var Ze={getNote:Ve,SAMPLES:We,NOTES:He,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Ge(t);const s=e,a=function(t,e){const i=le.parseTokens(n(t),"math",null,e.config.macros),s=Yt.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=N.makeSpan(s,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(We[s]||e,t),o=Ve(s),r=xe.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ue(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ue,hidePopover:Ge,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&je(e,t)}else Ge(e)}};function Xe(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else if("mode"===e)for(;t[s]&&t[s][e]===i;)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Xe(this,this.array[s][e],t);s1&&(i+=" "),i+=Xe(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Xe(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Xe(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Xe(this,this.shift,t)}em]`),i+=`{${Xe(this,this.width,t)}em}{${Xe(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Xe(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Xe(this,this.overscript||this.underscript,t)}}{${Xe(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Xe(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Xe(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Xe(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ie(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Xe(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Xe(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ie(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ie(this.backgroundcolor)}}`),i+=`{${Xe(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ie(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ie(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Xe(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Xe(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Xe(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Je.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Je.locale.substring(0,2),a="ordinal"===i.type?Je.ordinal:Je.cardinal;let o,n="ordinal"===i.type?Je._ordinalPluralCategories.indexOf(a.select(t)):Je._cardinalPluralCategories.indexOf(a.select(t));return Je.strings[Je.locale]&&(o=Je.strings[Je.locale][e]),!o&&Je.strings[s]&&(o=Je.strings[s][e]),o||(o=Je.strings.en[e],o||(o=e),n="ordinal"===i.type?Je._ordinalPluralCategories.indexOf(Je._ordinalEnglish.select(t)):Je._cardinalPluralCategories.indexOf(Je._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Je.merge=function(t,e){if(t&&e){const i=Je._locale;Je.locale=t,Je.strings[t]={...Je.strings[t],...e},Je.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Je.merge(t,e[t])))},Object.defineProperty(Je,"locale",{set(t){Je._locale=t,Je._ordinal=null,Je._cardinal=null},get:()=>(Je._locale||(Je._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Je._locale)}),Object.defineProperty(Je,"ordinal",{get:()=>(Je._ordinal||(Je._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Je._ordinalEnglishPluralCategories=Je._ordinalEnglish.resolvedOptions().pluralCategories,Je._ordinal=new Intl.PluralRules(Je.locale,{type:"ordinal"}),Je._ordinalPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._ordinal)}),Object.defineProperty(Je,"cardinal",{get:()=>(Je._cardinal||(Je._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Je._cardinalEnglishPluralCategories=Je._cardinalEnglish.resolvedOptions().pluralCategories,Je._cardinal=new Intl.PluralRules(Je.locale,{type:"cardinal"}),Je._cardinaPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._cardinal)}),Je.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const Ye={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},Qe={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ti={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let ei={};const ii={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function si(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=le.parseTokens(n(t),"math",e,i.config.macros),a=Yt.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ai(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},Ye,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function oi(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&Qe[n]&&(a.setAttribute("data-shifted",Qe[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",Qe[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=ei[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function ni(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ri={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ti["foreground-color"]=[];for(const t of ae)ti["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ti["background-color"]=[];for(const t of se)ti["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});ei={...ti},Object.keys(ei).forEach(t=>{ei[t]=ei[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];ei[e]||(ei[e]=[]),ei[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),ei[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),ei[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),ei[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),ei[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),ei[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),ei[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),ei[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),ei[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),ei[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),ei[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];ei[e]||(ei[e]=[]),ei[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),ei[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),ei[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),ei[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];ei[e]||(ei[e]=[]),ei[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),ei[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),ei[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),ei[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),ei[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ii,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},Ye,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ai(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=ni(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,oi(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:oi};const li={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},ci={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},hi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function di(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function pi(t,e){return t&&e.generateID?' extid="'+t+'"':""}function mi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,ui(t)&&(n=t.index,t.index+=1),fi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=vi(t.atoms[r].subscript,0,0,i).mathML,a+=vi(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,ui(t)){const e=vi(t.atoms[n].superscript,0,0,i).mathML,s=vi(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=vi(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=vi(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function ui(t){return t.index"+t,a+=vi(o.subscript,0,0,i).mathML,a+=vi(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=vi(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=vi(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function yi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function bi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&ui(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=vi(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function xi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=wi(t.atoms[l],i),a+=vi(t.atoms,l+1,c,i).mathML,a+=wi(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,gi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=vi(n.subscript,0,0,i).mathML,a+=vi(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=vi(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=vi(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Si(e.body)+"":wi(e,i);a+=r,t.index+=1,gi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function vi(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function wi(t,e){let i="";const s=Si(t.body);return s&&(i=""+s+""),i}function Si(t){if(!t)return"";if("string"==typeof t)return di(t);if(!Array.isArray(t)&&"string"==typeof t.body)return di(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return di(e)}Yt.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=vi(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(hi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+vi(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(hi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=vi(this.numer,0,0,t).mathML||" ",c+=vi(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+vi(this.numer,0,0,t).mathML+"",c+=""+vi(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=vi(this.body,0,0,t).mathML,c+=vi(this.index,0,0,t).mathML,c+=""):(c+="",c+=vi(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=vi(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(hi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=vi(this.body,0,0,t).mathML,c+=""+(hi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+vi(l,0,0,t).mathML,c+=vi(n,0,0,t).mathML,c+=vi(r,0,0,t).mathML,c+=""):r?(c+=""+vi(l,0,0,t).mathML,c+=vi(r,0,0,t).mathML,c+=""):n&&(c+=""+vi(l,0,0,t).mathML,c+=vi(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+pi(this.id,t)+">"+di(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&hi[p]?""+hi[p]+"":wi(this,t);break;case"mpunct":c='"+(hi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+vi(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+vi(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},Yt.toMathML=function(t,e){return vi(t,0,0,e).mathML};const Ai={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},Mi={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ci={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},_i={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Ti(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Li(t){return t&&_i[t]||-1}function Fi(t){return/=|=>/.test(t)?"right":"left"}function Di(t){if("f"===t||"g"===t)return!0;const e=Ci[t];return!!e&&!!/%[^01_^]?/.test(e)}function zi(t){t=(t||"").trim();let e=Ai[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=wt.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Ei(t){if(!t)return null;const e=zi($i(t)),i=[Li(e),Fi(e)];return i[0]<=0?null:i}function qi(t){return null!==Ei(t)}const Ii={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Pi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Bi={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Oi={",":"list",";":"list2"};function $i(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const i of t)e+=$i(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=$i(i);return e}return""}function Ri(t){return"string"==typeof t.sym?function(t){let e=Ci[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=wt.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=wt.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Ki(t){return parseFloat(t.num)}function Ni(t){return"object"==typeof t&&void 0!==t.num}function Wi(t){let e=0;return Ni(t)&&(e="object"==typeof t.num?void 0!==t.num.re?ls(t.num.re):0:parseFloat(t.num)),e}function Hi(t){let e=0;return Ni(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?ls(t.num.im):0),e}function Vi(t){return t&&void 0!==t.sup}function Ui(t){return t&&void 0!==t.sub}function ji(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||$i(a)===i),s}function Gi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Zi(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Xi(t){if(Ni(t)){const e=Wi(t),i=Hi(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Gi("negate",t)}function Ji(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function Yi(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=os(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test($i(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test($i(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test($i(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=os(i.superscript,e)):t.ast.sup=os(i.superscript,e))):t.index+=1,t}function Qi(t,e){const i=t.ast;if(es(t,"!!"))return t.index+=1,t.ast=Gi("factorial2",i),Qi(t=Yi(t,e),e);if(es(t,"++"))return t.index+=1,t.ast=Gi("increment",i),Qi(t=Yi(t,e),e);if(es(t,"--"))return t.index+=1,t.ast=Gi("decrement",i),Qi(t=Yi(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Pi[s.latex.trim()]&&(t.ast=Gi(Pi[s.latex.trim()],i),t=Qi(t=Yi(t,e),e)),t}function ts(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&$i(o)===e)t.index+=1,o=(t=ss(t,s)).atoms[t.index],o&&"mclose"===o.type&&$i(o)===i&&(Ji(t)&&(t.ast={group:t.ast}),t=Qi(t=Yi(t,s),s));else if("textord"===o.type&&$i(o)===e)t.index+=1,o=(t=ss(t,s)).atoms[t.index],o&&"textord"===o.type&&$i(o)===i&&(t.index+=1,t=Qi(t=Yi(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=ss(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=Qi(t=Yi(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=ss(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=Qi(t=Yi(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=os(o.body,s),Ji(t)&&(t.ast={group:t.ast}),t=Qi(t=Yi(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=wt.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=wt.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=wt.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=wt.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=ts(t,e,i))return s&&(t.index+=1),t.ast={fn:Ii[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function es(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===$i(t.atoms[t.index])+$i(t.atoms[t.index+1])}function is(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!ji(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,ji(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):ji(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function ss(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=zi($i(s));if(is(e))e.ast=Gi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Xi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Gi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>as(t)))),e=[t])}return e}function os(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=ss(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Gi("text",...i):i[0]||void 0}({atoms:as(t)},e)}function ns(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function rs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function ls(t){return parseFloat(parseFloat(t).toPrecision(15))}function cs(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=rs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=rs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=rs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=ls(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=rs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=rs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}Yt.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=le.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=le.parseTokens(n(s),"math",null,t.macros),o=Gi("divide",os(i,t),os(s,t))):o.fn="divide"):o.group=os(this.body,t);break;case"genfrac":o=Gi("divide",os(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Zi(1):os(this.denom,t));break;case"surd":o=this.index?Gi("pow",os(this.body,t),Gi("divide",Zi(1),os(this.index,t))):Gi("sqrt",os(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=zi($i(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=wt.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=os(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Gi("card",os(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>os(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(os(e[0],t));let s=os(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},Yt.toAST=function(t,e){return os(t,e)};var hs=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Ni(e)){const i=Ki(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":cs(e.num,s);else{const t=Wi(e),i=Hi(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=cs(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?cs(i,s):"")+"\\imaginaryI "))}Vi(e)&&(a+="^{"+t(e.sup,s)+"}"),Ui(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Ni(e.group)||Ri(e.group)?0!==Hi(e.group)&&(a=ns(e.fence||"(),",a)):a=ns(e.fence||"(),",a),Vi(e)&&(a+="^{"+t(e.sup,s)+"}"),Ui(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Ti(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Ti(e,1));else{let i="";for(let s=1;s=2)a=t(Ti(e,0),s),Ni(Ti(e,0))||Ri(Ti(e,0))||(a=ns(e.fence||"(),",a)),a+="^{"+t(Ti(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ci[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ns(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Ti(e,0),s),r=t(Ti(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ns(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ns(e.fence||"(),","");a=Vi(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Ui(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ns("() ",t(a,s))):0!==Wi(o=a)&&0!==Hi(o)?i.push(ns("() ",t(a,s))):Vi(e)&&0!==Hi(a)&&1!==Hi(a)?i.push(ns("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Ni(e.arg[0])&&"divide"!==e.arg[0].fn||Ni(e.arg[1])&&(0!==Wi(e.arg[1])||1!==Hi(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Ni(e.arg[0])&&Ki(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function ps(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function ms(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function us(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function fs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function gs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function ys(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function bs(t){return t.element&&t.element.mathfield===t}Yt.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=Yt.toSpeakableFragment(t.body,e),t.index){let i=Yt.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else ps(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ds[t.leftDelim]||t.leftDelim,s+=Yt.toSpeakableFragment(t.body,e),s+=ds[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=Yt.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ds[a]||(o?ds[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Ze.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=Yt.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=Yt.toSpeakableFragment(t.superscript,e);i=i.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=Yt.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=Yt.toSpeakableFragment(t.superscript,e);i=i.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=Yt.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=Yt.toSpeakableFragment(t.superscript,e);a=a.trim();let o=Yt.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ds[t.body]||ds[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=Yt.toSpeakableFragment(t.body,e),ps(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=Yt.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(ps(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=Yt.toSpeakableFragment(t.subscript,e);i=i.trim(),ps(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},Yt.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=Yt.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=Yt.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class xs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=gs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=gs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,us(this.element,"focus",this),us(this.element,"blur",this),us(this.textarea,"cut",this),us(this.textarea,"copy",this),us(this.textarea,"paste",this),Ne.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?us(this.field,"pointerdown",this):us(this.field,"touchstart:active mousedown",this),us(window,"resize",this);const o={...e};o.onSelectionDidChange=xs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=xs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Pe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>bs(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,fs(this.textarea,"cut",this),fs(this.textarea,"copy",this),fs(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,ys(this.popover),ys(this.keystrokeCaption),ys(this.virtualKeyboard),ys(document.getElementById("mathlive-alternate-keys-panel")),fs(this.element,"pointerdown",this),fs(this.element,"touchstart:active mousedown",this),fs(this.element,"focus",this),fs(this.element,"blur",this),fs(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=de.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1;const r=this.field.querySelector(".ML__mathlive").getBoundingClientRect();if(i=d>r.right?[{relation:"body",offset:this.mathlist.root.body.length-1}]:this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=de.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||vs>2?(n(t),3!==t.detail&&3!==vs||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(us(e.field,"pointermove",h),us(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(us(window,"blur",n),t.touches?(us(t.target,"touchmove",h),us(t.target,"touchend",n)):(us(window,"mousemove",h),us(window,"mouseup",n))),2!==t.detail&&2!==vs||(a=!0,this.mathlist.selectGroup_()))}}else ks=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Ze.hidePopover(this),this.mathlist.removeCommandString())}Ze.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return ws(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=ws(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Ze.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Ze.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(xe.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);0===e.length?Ze.hidePopover(this):Ze.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=Ne.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=xe.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(Ne.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=Ne.charToEvent(e);if(!this.$keystroke(Ne.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=wt.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Ze.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Ze.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;ibs(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),e+=1,t=this.mathlist.ancestor(e)}const i=Yt.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=N.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+Yt.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=Yt.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=Yt.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=li[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&li[a]?li[a]:a&&ci[a]?ci[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=ci[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=Yt.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Ze.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Ze.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(wt.commandAllowed(t,e)){const i=le.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=le.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);if(0===e.length)Ze.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Ze.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),us(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),us(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),us(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ri.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",ys(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=Yt.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ks,vs=0;function ws(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+Yt.toSpeakableText(i,s)}function Ss(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=ws(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=ws(t,"",t.mathlist.sibling(0)):"line"===e?(a=ws(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+Yt.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?ws(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}xs.prototype.undo_=xs.prototype.undo,xs.prototype.redo_=xs.prototype.redo,xs.prototype.scrollIntoView_=xs.prototype.scrollIntoView,xs.prototype.scrollToStart_=xs.prototype.scrollToStart,xs.prototype.scrollToEnd_=xs.prototype.scrollToEnd,xs.prototype.insert_=xs.prototype.$insert;var As={isValidMathfield:bs,MathField:xs};function Ms(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=Ms(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ls(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Ts(t,void 0,e,!0));else{const s=_s(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Ps(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function Bs(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Os(t,e){Ds&&((e=e||{}).renderToMarkup=e.renderToMarkup||zs,e.renderToMathML=e.renderToMathML||Es,e.renderToSpeakableText=e.renderToSpeakableText||qs,e.macros=e.macros||wt.MACROS,Ds.renderMathInElement(Bs(t),e))}function $s(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}return{latexToMarkup:zs,latexToMathML:Es,latexToSpeakableText:qs,latexToAST:function(t,e){if(!Yt.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,wt.MACROS);const i=le.parseTokens(n(t),"math",null,e.macros);return Yt.toAST(i,e)},astToLatex:function(t,e){return hs(t,e)},makeMathField:function(t,e){if(!As)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Is,e.handleReadAloud=e.handleReadAloud||Ps,new As.MathField(Bs(t),e)},renderMathInDocument:function(t){Os(document.body,t)},renderMathInElement:Os,revertToOriginalContent:function(t,e){(t=(t=Bs(t)).children[1])instanceof As.MathField?t.revertToOriginalContent():($s(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Bs(t)).children[1])instanceof As.MathField?t.originalContent:($s(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Ps,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return B(i[0],e)}return new L(t,e)}function O(t,e,i){const s=B(e,i);return s.type=t,s}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=$(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},wt="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),St="undefined"!=typeof navigator&&/firefox|edge/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");var At={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:wt,LETTER_AND_DIGITS:St};const Mt=N.makeSymbol,Ct=N.makeSpan,_t=N.makeVlist;function Tt(t,e,i,s,a,o){const n=Mt("Size"+i+"-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,Ct(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function Lt(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),Ct(Mt(e,At.getValue("math",t)),"delimsizinginner"+i)}function Ft(t,e,i,s,a,o){let n,r,l,c;n=l=c=At.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(At.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(At.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(At.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(At.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(Lt(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qt=[0,1.2,1.8,2.4,3],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Pt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],Bt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Ot(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return $t(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Et.includes(e)?It:Dt.includes(e)?Bt:Pt;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(At.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=Mt("AMS-Regular",At.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Tt(t,e,r.size,s,a,o):Ft(t,e,i,s,a,o)}function $t(t,e,i){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Rt={makeSizedDelim:function(t,e,i,s,a){return"."===e?$t(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Dt.includes(e)||Et.includes(e)?Tt(t,e,i,!1,s,a):zt.includes(e)?Ft(t,e,qt[i],!1,s,a):null)},makeCustomSizedDelim:Ot,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return $t(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Ot(t,e,h,!0,a,o)}};const Kt=N.makeSpan,Nt=N.makeOrd,Wt=N.makeInner,Ht=N.makeHlist,Vt=N.makeVlist,Ut=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,jt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Gt={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class Zt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Gt[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",jt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ut.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=Nt(Qt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Vt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(i)+N.depth(i)+o&&(o=(o+l-(N.height(i)+N.depth(i)))/2),r.setTop(r.height-N.height(i)-(o+s));const c=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Vt(t,[i,o,c,s]);if(!this.index)return this.bind(t,Nt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Kt(Qt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Vt(t,[m],"shift",-.6*(u-f));return this.bind(t,Nt([Kt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Qt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,Nt(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=N.skew(i));const a=Math.min(N.height(i),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Kt(Kt(o),"accent-body"+n);return r=Vt(t,[i,-a,r]),r.children[1].setLeft(2*s),Nt(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Qt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=Kt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Vt(t,[i,3*s,a,s]);else{const e=Kt(i);o=Vt(t,[s,a,3*s,e],"top",N.height(e))}return Nt(o,this.position)}decomposeOverunder(t){const e=Qt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?Kt(Qt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?Kt(Qt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Yt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Kt(Qt(t,this.body),"inner");return Nt([e,Kt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=Nt("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=N.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=N.makeOp(Qt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=Nt(Qt(t,this.body)),i=Kt();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=Kt([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=Nt(Qt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=Kt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(Array.isArray(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Qt(t.sup(),this.superscript);a=Kt(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Qt(t.sub(),this.subscript);o=Kt(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-s.metrics.supDrop,l=N.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*i){l=4*i-(r-a.depth)+N.height(o);const t=.8*s.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Vt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,N.height(o)-.8*s.metrics.xHeight),p=Vt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Vt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Kt(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?Kt(Qt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Kt(Qt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Yt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=N.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Xt(t){const e=Kt("​","arraycolsep");return e.setWidth(t,"em"),e}function Jt(t,e,i,s){const a=[];for(const o of e){const e=Kt(Qt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Vt(t,a,"individualShift")}function Yt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=Kt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+i;c=Vt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=N.height(e)-i;c=Vt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=N.depth(e)+i;c=Vt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return N.makeSpanOfType(n,c,"op-limits")}function Qt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Gt[t.size]/Gt[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var te={MathAtom:Zt,decompose:Qt,makeRoot:function(t,e){const i=new Zt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new Zt("","first")),i},GREEK_REGEX:Ut};const ee={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},ie={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var se=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ae=function(t){let e=t.toUpperCase();for(const t in ie)if(ie[t]===e){e=t;break}for(const t in ee)if(ee[t]===e){e=t;break}return e},oe=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ne=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const re=te.MathAtom;class le{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return se(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new re("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new re("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=At.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new re(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new re("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=At.getInfo("\\"+i.value,"math",this.macros);o=e?[new re(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new re(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new re(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new re(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=At.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new re(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new re(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=se(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new re("text",""," ",this.style));else if("placeholder"===t.type)e=new re(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new re(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new re(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new re(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=At.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new re(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new re(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new re(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=At.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new re(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new re(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=At.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else"#"===t.type&&("?"===t.value?e=this.placeholder():this.args&&(e=this.args[t.value]||this.placeholder()));return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new re(this.parseMode,"group",ce(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var me={pathFromString:pe,pathToString:de,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return pe(de(t)).path}};const ue={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},fe={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ge={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function ye(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&At.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function be(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function xe(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function ke(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===be("mac")||o===be("win")||o===be("ios")||o===be("android")||o===be("chromeos")||o===be("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===be("mac")||"ios"===be("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var ve={KEYBOARD_SHORTCUTS:ue,INLINE_SHORTCUTS:ge,stringify:ke,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ge).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=ye(t,e,ge[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=ye(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[be("mac")+":"+t+":"+e,be("win")+":"+t+":"+e,be("ios")+":"+t+":"+e,be("android")+":"+t+":"+e,be("chromeos")+":"+t+":"+e,be("other")+":"+t+":"+e,be("mac")+":"+e,be("win")+":"+e,be("ios")+":"+e,be("android")+":"+e,be("chromeos")+":"+e,t+":"+e,e])if(ue[i])return ue[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=fe[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=xe(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(ue).forEach(t=>{if(i.test(xe(ue[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),ke(e)}};function we(t,e){this.root=te.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function Se(t){const e=Object.assign(new we(t.config,t.target),t);return e.path=me.clone(t.path),e}function Ae(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ce(t,e){let i;return"object"!=typeof e&&(e=Me(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Be()),i}function _e(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Te(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new te.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function Le(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ce(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Fe(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function De(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(De(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||De(t[i],e)})))return!0;if(t.array)for(let i=_e(t.array);i>=0;i--)if(De(Ce(t.array,i),e))return!0}return!1}function ze(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function Ee(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return qe(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function qe(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Ie(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=qe(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Ie(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Ie(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Ie(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=qe(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=qe(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=Pe(i[1],e),t+=qe(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Ie(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=qe(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=Pe(i[1],e),t+=qe(i[2],e),s=!0)),!s)if(i=Ie(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Ie(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+qe(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+qe(i.rest,e):i.match+qe(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+qe(i[2],e),s=!0)),t}function Ie(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=qe(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+qe(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=ve.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function Pe(t,e){let i=ve.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Be(){return new te.MathAtom("","first")}we.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},we.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new we;s.path=me.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},we.prototype.forEach=function(t){this.root.forEach(t)},we.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},we.prototype.setRange=function(t,e,i){i=i||{};const s=me.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(me.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(me.clone(t),s)}let a=me.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=me.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},we.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},we.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},we.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},we.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},we.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},we.prototype.insertFirstAtom=function(){this.siblings()},we.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ce(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Be()),t},we.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},we.prototype.isCollapsed=function(){return 0===this.extent},we.prototype.setExtent=function(t){this.extent=t},we.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},we.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},we.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&At.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&At.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Fe(t[e]);)e-=1;for(;Fe(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},we.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},we.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},we.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},we.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},we.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=_e(e.array);i>=0;i--)t(Ce(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},we.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},we.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},we.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=_e(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ce(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=_e(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},we.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,-1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},we.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Me(this.parent().array,i);e=Le(this.parent().array,e,1),e&&Ce(e)?(this.path[this.path.length-1].relation="cell"+Ae(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},we.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=Se(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},we.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=Se(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},we.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},we.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=Se(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},we.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},we.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},we.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=ze(t.numer),t.denom=ze(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=ze(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=ze(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=ze(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=ze(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=ze(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=ze(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=_e(t.array);e>=0;e--)this.simplifyParen(Ce(t.array,e))})}},we.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=Ee(t,{...this.config,format:"ASCIIMath"}),o=he.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)At.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new te.MathAtom("command","command",e))}else""===t?o=[new te.MathAtom("command","command","\\")]:(t=Ee(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=he.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=he.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=he.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},we.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=At.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(At.RIGHT_DELIM).forEach(e=>{t===At.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},we.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},we.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new te.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},we.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},we.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},we.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},we.prototype.moveToNextPlaceholder_=function(){this.leap(1)},we.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},we.prototype.moveToNextChar_=function(){this.move(1)},we.prototype.moveToPreviousChar_=function(){this.move(-1)},we.prototype.moveUp_=function(){this.up()},we.prototype.moveDown_=function(){this.down()},we.prototype.moveToNextWord_=function(){this.skip(1)},we.prototype.moveToPreviousWord_=function(){this.skip(-1)},we.prototype.moveToGroupStart_=function(){this.setSelection(0)},we.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},we.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},we.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},we.prototype.deleteNextChar_=function(){this.delete_(1)},we.prototype.deletePreviousChar_=function(){this.delete_(-1)},we.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},we.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},we.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},we.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},we.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},we.prototype.transpose_=function(){},we.prototype.extendToNextChar_=function(){this.extend(1)},we.prototype.extendToPreviousChar_=function(){this.extend(-1)},we.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},we.prototype.extendUp_=function(){this.up({extend:!0})},we.prototype.extendDown_=function(){this.down({extend:!0})},we.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},we.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},we.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},we.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},we.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},we.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},we.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Be()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Be()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},we.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Be()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Be()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new te.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Be()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},we.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Be()]),this.setSelection(0,"end",t)},we.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},we.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=Se(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},we.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Me(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=Ae(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},we.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=At.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},we.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},we.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},we.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},we.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},we.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Oe={EditableMathlist:we,parseMathString:Ee};const $e={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Re={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Ke={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Ne(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=Ke[t.target.value]||t.target.value),e||($e[t.key]?(e=$e[t.key],i=!1):e=Re[t.key],e||(e=Ke[t.key.toLowerCase()])),!e&&t.code&&(e=Re[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function We(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke(Ne(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke(Ne(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var He={delegateKeyboardEvents:We,select:We.select,keyboardEventToString:Ne,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const Ve={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},Ue={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function je(t){let e=Ue[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ge(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&Ze(t,i),t.popover.classList.add("is-visible")}function Ze(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Xe(t){t.popover.classList.remove("is-visible")}var Je={getNote:je,SAMPLES:Ve,NOTES:Ue,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Xe(t);const s=e,a=function(t,e){const i=he.parseTokens(n(t),"math",null,e.config.macros),s=te.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=N.makeSpan(s,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(Ve[s]||e,t),o=je(s),r=ve.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ge(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ge,hidePopover:Xe,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&Ze(e,t)}else Xe(e)}};function Ye(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else if("mode"===e)for(;t[s]&&t[s][e]===i;)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Ye(this,this.array[s][e],t);s1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Ye(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Ye(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Ye(this,this.shift,t)}em]`),i+=`{${Ye(this,this.width,t)}em}{${Ye(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Ye(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Ye(this,this.overscript||this.underscript,t)}}{${Ye(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Ye(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Ye(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Ye(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ae(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Ye(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Ye(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ae(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ae(this.backgroundcolor)}}`),i+=`{${Ye(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ae(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ae(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Ye(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Ye(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Ye(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Qe.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Qe.locale.substring(0,2),a="ordinal"===i.type?Qe.ordinal:Qe.cardinal;let o,n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(a.select(t)):Qe._cardinalPluralCategories.indexOf(a.select(t));return Qe.strings[Qe.locale]&&(o=Qe.strings[Qe.locale][e]),!o&&Qe.strings[s]&&(o=Qe.strings[s][e]),o||(o=Qe.strings.en[e],o||(o=e),n="ordinal"===i.type?Qe._ordinalPluralCategories.indexOf(Qe._ordinalEnglish.select(t)):Qe._cardinalPluralCategories.indexOf(Qe._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Qe.merge=function(t,e){if(t&&e){const i=Qe._locale;Qe.locale=t,Qe.strings[t]={...Qe.strings[t],...e},Qe.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Qe.merge(t,e[t])))},Object.defineProperty(Qe,"locale",{set(t){Qe._locale=t,Qe._ordinal=null,Qe._cardinal=null},get:()=>(Qe._locale||(Qe._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Qe._locale)}),Object.defineProperty(Qe,"ordinal",{get:()=>(Qe._ordinal||(Qe._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Qe._ordinalEnglishPluralCategories=Qe._ordinalEnglish.resolvedOptions().pluralCategories,Qe._ordinal=new Intl.PluralRules(Qe.locale,{type:"ordinal"}),Qe._ordinalPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._ordinal)}),Object.defineProperty(Qe,"cardinal",{get:()=>(Qe._cardinal||(Qe._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Qe._cardinalEnglishPluralCategories=Qe._cardinalEnglish.resolvedOptions().pluralCategories,Qe._cardinal=new Intl.PluralRules(Qe.locale,{type:"cardinal"}),Qe._cardinaPluralCategories=Qe._ordinal.resolvedOptions().pluralCategories),Qe._cardinal)}),Qe.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const ti={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},ei={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ii={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let si={};const ai={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function oi(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=he.parseTokens(n(t),"math",e,i.config.macros),a=te.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ni(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},ti,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function ri(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&ei[n]&&(a.setAttribute("data-shifted",ei[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",ei[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=si[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function li(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ci={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ii["foreground-color"]=[];for(const t of ne)ii["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ii["background-color"]=[];for(const t of oe)ii["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});si={...ii},Object.keys(si).forEach(t=>{si[t]=si[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),si[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),si[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),si[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),si[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];si[e]||(si[e]=[]),si[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),si[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),si[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),si[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),si[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ai,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},ti,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ni(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=li(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,ri(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:ri};const hi={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},di={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},pi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function mi(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ui(t,e){return t&&e.generateID?' extid="'+t+'"':""}function fi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,gi(t)&&(n=t.index,t.index+=1),yi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=Si(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,gi(t)){const e=Si(t.atoms[n].superscript,0,0,i).mathML,s=Si(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=Si(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=Si(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function gi(t){return t.index"+t,a+=Si(o.subscript,0,0,i).mathML,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=Si(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=Si(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function xi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&gi(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=Si(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function vi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=Ai(t.atoms[l],i),a+=Si(t.atoms,l+1,c,i).mathML,a+=Ai(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function wi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=Si(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Mi(e.body)+"":Ai(e,i);a+=r,t.index+=1,bi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function Si(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function Ai(t,e){let i="";const s=Mi(t.body);return s&&(i=""+s+""),i}function Mi(t){if(!t)return"";if("string"==typeof t)return mi(t);if(!Array.isArray(t)&&"string"==typeof t.body)return mi(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return mi(e)}te.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=Si(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(pi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+Si(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(pi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=Si(this.numer,0,0,t).mathML||" ",c+=Si(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+Si(this.numer,0,0,t).mathML+"",c+=""+Si(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=Si(this.body,0,0,t).mathML,c+=Si(this.index,0,0,t).mathML,c+=""):(c+="",c+=Si(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(pi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=Si(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(pi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(pi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=Si(this.body,0,0,t).mathML,c+=""+(pi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):r?(c+=""+Si(l,0,0,t).mathML,c+=Si(r,0,0,t).mathML,c+=""):n&&(c+=""+Si(l,0,0,t).mathML,c+=Si(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+ui(this.id,t)+">"+mi(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&pi[p]?""+pi[p]+"":Ai(this,t);break;case"mpunct":c='"+(pi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+Si(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+Si(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},te.toMathML=function(t,e){return Si(t,0,0,e).mathML};const Ci={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},_i={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ti={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},Li={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Fi(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Di(t){return t&&Li[t]||-1}function zi(t){return/=|=>/.test(t)?"right":"left"}function Ei(t){if("f"===t||"g"===t)return!0;const e=Ti[t];return!!e&&!!/%[^01_^]?/.test(e)}function qi(t){t=(t||"").trim();let e=Ci[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=At.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Ii(t){if(!t)return null;const e=qi(Ki(t)),i=[Di(e),zi(e)];return i[0]<=0?null:i}function Pi(t){return null!==Ii(t)}const Bi={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Oi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},$i={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Ri={",":"list",";":"list2"};function Ki(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const i of t)e+=Ki(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=Ki(i);return e}return""}function Ni(t){return"string"==typeof t.sym?function(t){let e=Ti[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=At.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=At.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Wi(t){return parseFloat(t.num)}function Hi(t){return"object"==typeof t&&void 0!==t.num}function Vi(t){let e=0;return Hi(t)&&(e="object"==typeof t.num?void 0!==t.num.re?hs(t.num.re):0:parseFloat(t.num)),e}function Ui(t){let e=0;return Hi(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?hs(t.num.im):0),e}function ji(t){return t&&void 0!==t.sup}function Gi(t){return t&&void 0!==t.sub}function Zi(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||Ki(a)===i),s}function Xi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Ji(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Yi(t){if(Hi(t)){const e=Vi(t),i=Ui(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Xi("negate",t)}function Qi(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function ts(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=rs(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test(Ki(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test(Ki(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ki(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=rs(i.superscript,e)):t.ast.sup=rs(i.superscript,e))):t.index+=1,t}function es(t,e){const i=t.ast;if(ss(t,"!!"))return t.index+=1,t.ast=Xi("factorial2",i),es(t=ts(t,e),e);if(ss(t,"++"))return t.index+=1,t.ast=Xi("increment",i),es(t=ts(t,e),e);if(ss(t,"--"))return t.index+=1,t.ast=Xi("decrement",i),es(t=ts(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Oi[s.latex.trim()]&&(t.ast=Xi(Oi[s.latex.trim()],i),t=es(t=ts(t,e),e)),t}function is(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ki(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"mclose"===o.type&&Ki(o)===i&&(Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s));else if("textord"===o.type&&Ki(o)===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"textord"===o.type&&Ki(o)===i&&(t.index+=1,t=es(t=ts(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=os(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=es(t=ts(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=os(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=es(t=ts(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=rs(o.body,s),Qi(t)&&(t.ast={group:t.ast}),t=es(t=ts(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=At.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=At.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=At.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=At.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=is(t,e,i))return s&&(t.index+=1),t.ast={fn:Bi[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function ss(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ki(t.atoms[t.index])+Ki(t.atoms[t.index+1])}function as(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!Zi(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,Zi(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):Zi(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function os(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=qi(Ki(s));if(as(e))e.ast=Xi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Yi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Xi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ns(t)))),e=[t])}return e}function rs(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=os(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Xi("text",...i):i[0]||void 0}({atoms:ns(t)},e)}function ls(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function cs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function hs(t){return parseFloat(parseFloat(t).toPrecision(15))}function ds(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=cs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=cs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=cs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=hs(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=cs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=cs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}te.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=he.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=he.parseTokens(n(s),"math",null,t.macros),o=Xi("divide",rs(i,t),rs(s,t))):o.fn="divide"):o.group=rs(this.body,t);break;case"genfrac":o=Xi("divide",rs(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Ji(1):rs(this.denom,t));break;case"surd":o=this.index?Xi("pow",rs(this.body,t),Xi("divide",Ji(1),rs(this.index,t))):Xi("sqrt",rs(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=qi(Ki(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=At.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=rs(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Xi("card",rs(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>rs(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(rs(e[0],t));let s=rs(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},te.toAST=function(t,e){return rs(t,e)};var ps=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Hi(e)){const i=Wi(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":ds(e.num,s);else{const t=Vi(e),i=Ui(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ds(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?ds(i,s):"")+"\\imaginaryI "))}ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Hi(e.group)||Ni(e.group)?0!==Ui(e.group)&&(a=ls(e.fence||"(),",a)):a=ls(e.fence||"(),",a),ji(e)&&(a+="^{"+t(e.sup,s)+"}"),Gi(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Fi(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Fi(e,1));else{let i="";for(let s=1;s=2)a=t(Fi(e,0),s),Hi(Fi(e,0))||Ni(Fi(e,0))||(a=ls(e.fence||"(),",a)),a+="^{"+t(Fi(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ti[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ls(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Fi(e,0),s),r=t(Fi(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ls(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ls(e.fence||"(),","");a=ji(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Gi(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ls("() ",t(a,s))):0!==Vi(o=a)&&0!==Ui(o)?i.push(ls("() ",t(a,s))):ji(e)&&0!==Ui(a)&&1!==Ui(a)?i.push(ls("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Hi(e.arg[0])&&"divide"!==e.arg[0].fn||Hi(e.arg[1])&&(0!==Vi(e.arg[1])||1!==Ui(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Hi(e.arg[0])&&Wi(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function us(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function fs(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function gs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function ys(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function bs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function xs(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function ks(t){return t.element&&t.element.mathfield===t}te.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=te.toSpeakableFragment(t.body,e),t.index){let i=te.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else us(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ms[t.leftDelim]||t.leftDelim,s+=te.toSpeakableFragment(t.body,e),s+=ms[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=te.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ms[a]||(o?ms[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Je.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=te.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();let a=te.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=te.toSpeakableFragment(t.superscript,e);a=a.trim();let o=te.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ms[t.body]||ms[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=te.toSpeakableFragment(t.body,e),us(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=te.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(us(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=te.toSpeakableFragment(t.subscript,e);i=i.trim(),us(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},te.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=te.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=te.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class vs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=bs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=bs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,gs(this.element,"focus",this),gs(this.element,"blur",this),gs(this.textarea,"cut",this),gs(this.textarea,"copy",this),gs(this.textarea,"paste",this),He.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?gs(this.field,"pointerdown",this):gs(this.field,"touchstart:active mousedown",this),gs(window,"resize",this);const o={...e};o.onSelectionDidChange=vs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=vs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Oe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>ks(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,ys(this.textarea,"cut",this),ys(this.textarea,"copy",this),ys(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,xs(this.popover),xs(this.keystrokeCaption),xs(this.virtualKeyboard),xs(document.getElementById("mathlive-alternate-keys-panel")),ys(this.element,"pointerdown",this),ys(this.element,"touchstart:active mousedown",this),ys(this.element,"focus",this),ys(this.element,"blur",this),ys(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=me.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1;const r=this.field.querySelector(".ML__mathlive").getBoundingClientRect();if(i=d>r.right?[{relation:"body",offset:this.mathlist.root.body.length-1}]:this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=me.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||Ss>2?(n(t),3!==t.detail&&3!==Ss||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(gs(e.field,"pointermove",h),gs(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(gs(window,"blur",n),t.touches?(gs(t.target,"touchmove",h),gs(t.target,"touchend",n)):(gs(window,"mousemove",h),gs(window,"mouseup",n))),2!==t.detail&&2!==Ss||(a=!0,this.mathlist.selectGroup_()))}}else ws=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Je.hidePopover(this),this.mathlist.removeCommandString())}Je.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return As(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=As(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Je.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Je.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(ve.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);0===e.length?Je.hidePopover(this):Je.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=He.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=ve.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(He.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=He.charToEvent(e);if(!this.$keystroke(He.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=At.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Je.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Je.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;iks(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),e+=1,t=this.mathlist.ancestor(e)}const i=te.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=N.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+te.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=te.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=te.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=te.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=hi[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&hi[a]?hi[a]:a&&di[a]?di[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=di[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=te.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Je.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Je.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(At.commandAllowed(t,e)){const i=he.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=he.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);if(0===e.length)Je.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Je.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=At.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),gs(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),gs(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),gs(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ci.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",xs(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=te.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ws,Ss=0;function As(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+te.toSpeakableText(i,s)}function Ms(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=As(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=As(t,"",t.mathlist.sibling(0)):"line"===e?(a=As(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+te.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?As(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}vs.prototype.undo_=vs.prototype.undo,vs.prototype.redo_=vs.prototype.redo,vs.prototype.scrollIntoView_=vs.prototype.scrollIntoView,vs.prototype.scrollToStart_=vs.prototype.scrollToStart,vs.prototype.scrollToEnd_=vs.prototype.scrollToEnd,vs.prototype.insert_=vs.prototype.$insert;var Cs={isValidMathfield:ks,MathField:vs};function _s(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=_s(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ds(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Fs(t,void 0,e,!0));else{const s=Ls(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Os(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function $s(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Rs(t,e){Es&&((e=e||{}).renderToMarkup=e.renderToMarkup||qs,e.renderToMathML=e.renderToMathML||Is,e.renderToSpeakableText=e.renderToSpeakableText||Ps,e.macros=e.macros||At.MACROS,Es.renderMathInElement($s(t),e))}function Ks(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const Ns={latexToMarkup:qs,latexToMathML:Is,latexToSpeakableText:Ps,latexToAST:function(t,e){if(!te.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,At.MACROS);const i=he.parseTokens(n(t),"math",null,e.macros);return te.toAST(i,e)},astToLatex:function(t,e){return ps(t,e)},makeMathField:function(t,e){if(!Cs)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Bs,e.handleReadAloud=e.handleReadAloud||Os,new Cs.MathField($s(t),e)},renderMathInDocument:function(t){Rs(document.body,t)},renderMathInElement:Rs,revertToOriginalContent:function(t,e){(t=(t=$s(t)).children[1])instanceof Cs.MathField?t.revertToOriginalContent():(Ks(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=$s(t)).children[1])instanceof Cs.MathField?t.originalContent:(Ks(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Os,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s=1){const i=t.charCodeAt(e-1),a=s;return 55296<=i&&i<=56319?1024*(i-55296)+(a-56320)+65536:a}return s}function e(e,i){if((i=i||0)<0)return 0;if(i>=e.length-1)return e.length;let a=s(t(e,i));for(let r=i+1;r=this.s.length}get(){return this.pos="0"&&s<="9"?parseInt(s):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],s=t.toString().split(/\r?\n/);let i="",a="";for(const t of s){i+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(i+=e[0])}const n=new o(i);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,s){if("string"==typeof t){const s=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);s?(t=parseFloat(s[1]),e=s[2].toLowerCase()):t=parseFloat(t)}const i={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(s)){const e=Math.pow(10,s);return Math.round(t/h.ptPerEm*i*e)/e}return t/h.ptPerEm*i}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const s={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let i=t.charCodeAt(0);t[0]in d?i=d[t[0]].charCodeAt(0):l.test(t[0])&&(i=77);const a=r[s][i];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,s,i){this.id=t,this.size=e,this.cramped=i,this.sizeMultiplier=s,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const s of t)e+=T(s);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,s=1;this.children&&this.children.forEach(i=>{i.height>t&&(t=i.height),i.depth>e&&(e=i.depth),i.maxFontSize>s&&(s=i.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=s}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let s="Main-Regular";if(e&&(s=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&s){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=s)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let s="",i=this.body||"";if(this.children){let t="none";for(const s of this.children){let a=0;if(t){let i=s.type;i&&("textord"===i&&(i="mord"),"first"===i&&(i="none"),a=s.isTight?E[t+"+"+i]||0:F[t+"+"+i]||0,a=Math.floor(e*a))}i+=s.toMarkup(a,e),t=q(s)}}if("​"!==i&&i||this.classes&&"ML__selected"!==this.classes){if(s="1?e.filter((function(t,e,s){return t.length>0&&s.indexOf(t)===e})).join(" "):e[0],a.length>0&&(s+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?i=z[-t]+i:D[t]?i=D[t]+i:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const s in this.style)Object.prototype.hasOwnProperty.call(this.style,s)&&("background-color"===s&&e||(t+=s+":"+this.style[s]+";"));t.length>0&&(s+=' style="'+t+'"')}s+=">",this.svgOverlay?(s+='",s+=""):s+=i,s+=""}else s="";return this.caret&&"command"!==this.type&&("text"===this.caret?s+='':s+=''),s}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,s=t.children&&t.children.length>0;if(e||s)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==a.length)return!1;i.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const s=[];for(const e of t)e&&s.push(e);if(1===s.length)return B(s[0],e)}return new L(t,e)}function O(t,e,s){const i=B(e,s);return i.type=t,i}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const s=new L(t,e);let i=1;return i=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),s.height*=i,s.depth*=i,s}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const s=[e[0]];for(let i=1;i0?"em":""),i.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(i,"fontsize-ensurer reset-"+t.size+" size5"):0!==s?i:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,s,i,a){a=a||"";const o=$(e,(a+=" style-wrap ")+s.adjustTo(i));o.type=t;const n=i.sizeMultiplier/s.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=i.sizeMultiplier,o},makeSVG:function(t,e,s){return t.svgOverlay=e,t.svgStyle=s,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const s of t)e+=s.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const s="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=s),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=s)}function Y(t,e,s,i,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:s===rt?lt:s,baseFontFamily:e,value:i,category:W,frequency:a}}function Q(t,e){for(let s=t;s<=e;s++){const t=String.fromCodePoint(s);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const s=String.fromCodePoint(e);if("math"===t&&tt[s])return tt[s];if(e>32&&e<127)return s;let i="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===s){i=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===s){i=t;break}return i||s}const st={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},it=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in st)if(Object.prototype.hasOwnProperty.call(st,t)&&st[t]===e){e=t;break}for(let t=0;t=it[t].start&&et.body).join("")}function yt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a=ft(e),o={category:W,params:a,parser:i,mathstyle:"displaystyle",tabular:s.tabular||!0,colFormat:s.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a={category:W,baseFontFamily:s.fontFamily,params:ft(e),allowedInText:!!s.allowedInText,infix:!!s.infix,parse:i};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,s){let i=0;for(const t of s)i=Math.max(i,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let s=e[0]||[];const i={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)i.strokeWidth=m.toPx(t[1],"px"),isFinite(i.strokeWidth)||(i.strokeWidth=1),i.strokeStyle=t[2],i.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?i.backgroundcolor=t[2]:"mathcolor"===t[1]?i.strokeColor=t[2]:"padding"===t[1]?i.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(i.shadow=t[2]))}}"dashed"===i.strokeStyle?i.svgStrokeStyle="5,5":"dotted"===i.strokeStyle&&(i.svgStrokeStyle="1,5")}i.borderStyle=i.strokeWidth+"px "+i.strokeStyle+" "+i.strokeColor,s=s.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),i.notation={};for(const t of s)i.notation[t]=!0;return i.notation.updiagonalarrow&&(i.notation.updiagonalstrike=!1),i.notation.box&&(i.notation.left=!1,i.notation.right=!1,i.notation.bottom=!1,i.notation.top=!1),i})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const s={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":s.hasBarLine=!0;break;case"\\\\atopfrac":s.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s.hasBarLine=!1,s.leftDelim="(",s.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":s.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":s.mathstyle="textstyle"}return"\\cfrac"===t&&(s.continuousFraction=!0),s})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const s=e[0],i=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:s,denom:i,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let s=parseInt(e[0]);return isFinite(s)||(s=10067),{type:"mord",body:String.fromCodePoint(s)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",s=!0;for(const i of t)"string"==typeof i.body?e+=i.body:s=!1;return s?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const s={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(s.limits="nolimits",s.isFunction=!0),s})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const s={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return s.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?s.limits="nolimits":"\\operatorname*"===t&&(s.limits="limits"),s})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"};var wt={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,s){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!s)return t;const i=t.codePointAt(0);for(let t=0;t=it[t].offset&&i=1;)i.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?i=H[t]:vt[t]&&(i={value:vt[t]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const s in V)Object.prototype.hasOwnProperty.call(V,s)&&s.startsWith(t)&&!V[s].infix&&e.push({match:s,frequency:V[s].frequency});for(const s in H)Object.prototype.hasOwnProperty.call(H,s)&&s.startsWith(t)&&e.push({match:s,frequency:H[s].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/,LETTER_AND_DIGITS:/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/};const St=N.makeSymbol,At=N.makeSpan,Mt=N.makeVlist;function Ct(t,e,s,i,a,o){const n=St("Size"+s+"-Regular",wt.getValue("math",e)),r=N.makeStyleWrap(t,At(n,"delimsizing size"+s),a.mathstyle,M.TEXT,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function _t(t,e){let s="";return"Size1-Regular"===e?s=" delim-size1":"Size4-Regular"===e&&(s=" delim-size4"),At(St(e,wt.getValue("math",t)),"delimsizinginner"+s)}function Tt(t,e,s,i,a,o){let n,r,l,c;n=l=c=wt.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(wt.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(wt.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(wt.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(wt.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((s-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;i&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(_t(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],zt=[0,1.2,1.8,2.4,3],Et=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],qt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Pt(t,e,s,i,a,o){if(!e||0===e.length||"."===e)return Bt(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Dt.includes(e)?Et:Lt.includes(e)?It:qt;const r=function(t,e,s,i){for(let o=Math.min(2,3-i.mathstyle.size);oe)return s[o]}var a;return s[s.length-1]}(wt.getValue("math",e),s,n,a);return"small"===r.type?function(t,e,s,i,a,o){const n=St("AMS-Regular",wt.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,s,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier/s.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,i,a,o):"large"===r.type?Ct(t,e,r.size,i,a,o):Tt(t,e,s,i,a,o)}function Bt(t,e,s){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(s||""))}var Ot={makeSizedDelim:function(t,e,s,i,a){return"."===e?Bt(t,i,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Lt.includes(e)||Dt.includes(e)?Ct(t,e,s,!1,i,a):Ft.includes(e)?Tt(t,e,zt[s],!1,i,a):null)},makeCustomSizedDelim:Pt,makeLeftRightDelim:function(t,e,s,i,a,o){if("."===e)return Bt(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=i+n,c=s-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Pt(t,e,h,!0,a,o)}};const $t=N.makeSpan,Rt=N.makeOrd,Kt=N.makeInner,Nt=N.makeHlist,Wt=N.makeVlist,Ht=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,Vt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Ut={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class jt{constructor(t,e,s,i){this.mode=t,this.type=e,this.body=s,this.applyStyle(i)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Ut[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",Vt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ht.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const s of e)for(const e of s)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const s of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[s]))for(const i of this[s])i&&(e=e.concat(i.filter(t)));if(Array.isArray(this.array))for(const s of this.array)for(const i of s)i&&(e=e.concat(i.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),s=Rt(Jt(e,this.body));return this.cssId&&(s.cssId=this.cssId),s.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),s}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const s=[];let i=0;for(const t of e)t.align&&i++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Wt(t,s,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const s of e){if(s.align&&b>=u.length)break;if(s.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(s)+N.depth(s)+o&&(o=(o+l-(N.height(s)+N.depth(s)))/2),r.setTop(r.height-N.height(s)-(o+i));const c=$t(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=i;const d=Wt(t,[s,o,c,i]);if(!this.index)return this.bind(t,Rt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=$t(Jt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Wt(t,[m],"shift",-.6*(u-f));return this.bind(t,Rt([$t(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let s=Jt(t.cramp(),this.body);(this.superscript||this.subscript)&&(s=this.attachSupsub(t,Rt(s),"mord"));let i=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(i=N.skew(s));const a=Math.min(N.height(s),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=$t($t(o),"accent-body"+n);return r=Wt(t,[s,-a,r]),r.children[1].setLeft(2*i),Rt(r,"accent")}decomposeLine(t){const e=t.mathstyle,s=Jt(t.cramp(),this.body),i=h.defaultRuleThickness/e.sizeMultiplier,a=$t(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=i,a.maxFontSize=1,"overline"===this.position)o=Wt(t,[s,3*i,a,i]);else{const e=$t(s);o=Wt(t,[i,a,3*i,e],"top",N.height(e))}return Rt(o,this.position)}decomposeOverunder(t){const e=Jt(t,this.body),s=t.clone({mathstyle:"scriptstyle"}),i=this.overscript?$t(Jt(s,this.overscript),t.mathstyle.adjustTo(s.mathstyle)):null,a=this.underscript?$t(Jt(s,this.underscript),t.mathstyle.adjustTo(s.mathstyle)):null;return Xt(t,e,0,0,i,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=$t(Jt(t,this.body),"inner");return Rt([e,$t(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,s=Rt("","rule");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return s.setStyle("border-right-width",a,"em"),s.setStyle("border-top-width",o,"em"),s.setStyle("margin-top",-(o-i),"em"),s.setStyle("border-color",t.color),s.width=a,s.height=o+i,s.depth=-i,s}decomposeOp(t){const e=t.mathstyle;let s,i=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(i=!0);let a=0,o=0;if(this.symbol){const n=i?"Size2-Regular":"Size1-Regular";s=N.makeSymbol(n,this.body,"op-symbol "+(i?"large-op":"small-op")),s.type="mop",a=(s.height-s.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=s.italic,this.bind(t,s)}else Array.isArray(this.body)?(s=N.makeOp(Jt(t,this.body)),this.bind(t,s)):s=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const i=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===i||"auto"===i&&e.size===M.DISPLAY.size?this.attachLimits(t,s,a,o):this.attachSupsub(t,s,"mop")}return this.symbol&&s.setTop(a),s}decomposeBox(t){const e=Rt(Jt(t,this.body)),s=$t();s.setStyle("position","absolute");const i="number"==typeof this.padding?this.padding:h.fboxsep;s.setStyle("height",e.height+e.depth+2*i,"em"),0!==i?s.setStyle("width","calc(100% + "+2*i+"em)"):s.setStyle("width","100%"),s.setStyle("top",-i,"em"),s.setStyle("left",-i,"em"),s.setStyle("z-index","-1"),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.framecolor&&s.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&s.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+i,"em");const a=$t([s,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-i+e.depth,"em"),a.height=e.height+i,a.depth=e.depth+i,a.setLeft(i),a.setRight(i),a}decomposeEnclose(t){const e=Rt(Jt(t,this.body)),s="auto"===this.padding?.2:this.padding;e.setStyle("padding",s,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-s,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let i="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(i+='0?s.setWidth(this.width):s.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";s=$t("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?s=this.decomposeBox(t):"enclose"===this.type?s=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(s=this.makeSpan(t,this.body),s.classes="",this.error&&(s.classes+=" ML__error"),this.suggestion&&(s.classes+=" ML__suggestion")):"placeholder"===this.type?s=this.makeSpan(t,"⬚"):"first"===this.type&&(s=this.makeSpan(t,"​"));if(!s)return s;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(s)?s[s.length-1].caret=this.caret:s.caret=this.caret),this.containsCaret&&(Array.isArray(s)?(s[0].classes=(s[0].classes||"")+" ML__contains-caret",s[s.length-1].classes=(s[s.length-1].classes||"")+" ML__contains-caret"):s.classes=(s.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(s)){const e=s[s.length-1];s[s.length-1]=this.attachSupsub(t,e,e.type)}else s=[this.attachSupsub(t,s,s.type)];return Array.isArray(s)?s:[s]}attachSupsub(t,e,s){if(!this.superscript&&!this.subscript)return e;const i=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Jt(t.sup(),this.superscript);a=$t(e,i.adjustTo(i.sup()))}if(this.subscript){const e=Jt(t.sub(),this.subscript);o=$t(e,i.adjustTo(i.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-i.metrics.supDrop,l=N.depth(e)+i.metrics.subDrop),n=i===M.DISPLAY?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const c=M.TEXT.sizeMultiplier*i.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const s=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*s){l=4*s-(r-a.depth)+N.height(o);const t=.8*i.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Wt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,i.metrics.sub1,N.height(o)-.8*i.metrics.xHeight),p=Wt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),p=Wt(t,[a],"shift",-r),p.children[0].setRight(d));const m=$t(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(s,[e,m])}attachLimits(t,e,s,i){const a=this.superscript?$t(Jt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?$t(Jt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Xt(t,e,s,i,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const s="textord"===this.type?"mord":this.type,i=N.makeSpanOfType(s,e),a=this.getStyle();i.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+o):t.parentSize!==t.size&&(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+t.size),i.maxFontSize=Math.max(i.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(i.classes+=" ML__text"),t.mathstyle.isTight()&&(i.isTight=!0),"math"!==this.mode&&(i.italic=0),i.setRight(i.italic),"number"==typeof t.opacity&&i.setStyle("opacity",t.opacity),this.bind(t,i),this.caret&&(this.superscript||this.subscript||(i.caret=this.caret,t.mathstyle.isTight()&&(i.isTight=!0))),i}}function Gt(t){const e=$t("​","arraycolsep");return e.setWidth(t,"em"),e}function Zt(t,e,s,i){const a=[];for(const o of e){const e=$t(Jt(t,i));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-s)}return Wt(t,a,"individualShift")}function Xt(t,e,s,i,a,o,n){if(!a&&!o)return e;e=$t(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+s;c=Wt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-i),c.children[2].setLeft(i)}else if(o&&!a){const a=N.height(e)-s;c=Wt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-i)}else if(!o&&a){const o=N.depth(e)+s;c=Wt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(i)}return N.makeSpanOfType(n,c,"op-limits")}function Jt(t,e){function s(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function i(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Ut[t.size]/Ut[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var Yt={MathAtom:jt,decompose:Jt,makeRoot:function(t,e){const s=new jt(t=t||"math","root",e||[]);return 0!==s.body.length&&"first"===s.body[0].type||s.body.unshift(new jt("","first")),s},GREEK_REGEX:Ht};const Qt={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},te={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ee=function(t){const e=t.toLowerCase().split("!");let s,i,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*s,n=(1-l)*n+l*i,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*s,n=l*n+(1-l)*i,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},se=function(t){let e=t.toUpperCase();for(const t in te)if(te[t]===e){e=t;break}for(const t in Qt)if(Qt[t]===e){e=t;break}return e},ie=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ae=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const oe=Yt.MathAtom;class ne{constructor(t,e,s){this.tokens=t,this.index=0,this.args=e,this.macros=s,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===i.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ee(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let s=10,i=/[0-9]/;this.parseLiteral("'")?(s=8,i=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(s=16,i=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(i);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(i);)a+=this.get().value;const o=t?parseInt(a,s):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),s=new oe("math","group");return s.mathstyle=")"===t?"textstyle":"displaystyle",s.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),s.body&&0!==s.body.length?s:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new oe("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const s=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(s),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=wt.getEnvironmentInfo(t),s=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else s.push(this.scanArg(t.type));const i=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new oe(this.parseMode,"array",h,e.parser?e.parser(t,s,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let s=null,i=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new oe("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!s?(s=this.get(),i=this.swapMathList([])):this.parseAtom();let o;if(s){const t=this.swapMathList(a),e=wt.getInfo("\\"+s.value,"math",this.macros);o=e?[new oe(this.parseMode,e.type,e.value||s.value,e.parse?e.parse("\\"+s.value,[i,t]):null)]:[new oe(this.parseMode,"mop",s.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new oe(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new oe(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let s=1;for(;!this.end()&&0!==s;)this.hasLiteral("(")&&(s+=1),this.hasLiteral(")")&&(s-=1),0!==s&&this.parseAtom();return 0===s&&this.parseLiteral(")"),t.rightDelim=0===s?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const s=wt.getInfo(e,"math",this.macros);return s?"mopen"===s.type||"mclose"===s.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const s=this.scanDelim();if(!s)return null;const i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new oe(this.parseMode,"leftright");return o.leftDelim=s,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(i),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const s=this.scanArg();if(s){const i=this.lastMathAtom();i[e]=i[e]||[],i[e]=i[e].concat(s),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new oe(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const s=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)i=this.scanString();else if("number"===t)i=this.scanNumber();else if("dimen"===t)i=this.scanDimen();else if("skip"===t)i=this.scanSkip();else if("colspec"===t)i=this.scanColspec();else if("color"===t)i=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ee(e);if(t)i=i||{},i.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)i=i||{},i.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(i=i||{},i.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(s);return i||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const s=this.scanToken();return this.parseMode=e,Array.isArray(s)?s:s?[s]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const s=this.parseMode;this.parseMode=t;const i=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=s;const a=this.swapMathList(i);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new oe("text",""," ",this.style));else if("placeholder"===t.type)e=new oe(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new oe(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const s=this.scanSkip();isFinite(s)&&(e=new oe(this.parseMode,"spacing",null,this.style),e.width=s),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const s=wt.getInfo("\\"+t.value,this.parseMode,this.macros),i=[];let a="",o="";if(s&&s.params)for(const t of s.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)i.push(e);else if(t.placeholder){const e=new oe(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,i.push([e])}else i.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(s&&!s.infix){if(s.parse){const a=s.parse("\\"+t.value,i);if(a.type)e=new oe(this.parseMode,s.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new oe(this.parseMode,s.type||"mop",s.value||t.value,i),s.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}s||(e=new oe(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const s=wt.getInfo(t.value,this.parseMode,this.macros);if(s){const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new oe(this.parseMode,s.type,s.value||t.value,i),s.isFunction&&(e.isFunction=!0)}else e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=wt.matchCodepoint(this.parseMode,t.value.codePointAt(0)),s&&s.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else"#"===t.type&&("?"===t.value?e=this.placeholder():this.args&&(e=this.args[t.value]||this.placeholder()));return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let s,i=0;"string"==typeof this.macros[t]?(s=this.macros[t],/(^|[^\\])#1/.test(s)&&(i=1),/(^|[^\\])#2/.test(s)&&(i=2),/(^|[^\\])#3/.test(s)&&(i=3),/(^|[^\\])#4/.test(s)&&(i=4),/(^|[^\\])#5/.test(s)&&(i=5),/(^|[^\\])#6/.test(s)&&(i=6),/(^|[^\\])#7/.test(s)&&(i=7),/(^|[^\\])#8/.test(s)&&(i=8),/(^|[^\\])#9/.test(s)&&(i=9)):(s=this.macros[t].def,i=this.macros[t].args||0);for(let t=1;t<=i;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new oe(this.parseMode,"group",re(n(s),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=i;t++){if(o+="{",Array.isArray(e[t]))for(let s=0;s1&&(e.extent=parseInt(s[1]));const i=s[0].split("/");for(const t of i){const s=t.match(/([^:]*):(.*)/);s&&e.path.push({relation:s[1],offset:parseInt(s[2])})}return e}var de={pathFromString:he,pathToString:ce,pathDistance:function(t,e){let s=0,i=-1,a=!1;for(;!a;)i+=1,a=i>=t.length||i>=e.length,a=a||!(t[i].relation===e[i].relation&&t[i].offset===e[i].offset);return s=i===t.length&&i===e.length?0:i+1===t.length&&i+1===e.length&&t[i].relation===e[i].relation?1:2,s},pathCommonAncestor:function(t,e){const s=[],i=Math.min(t.length-1,e.length-1);let a=0;for(;a<=i&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)s.push(t[a]),a+=1;return s},clone:function(t){return he(ce(t)).path}};const pe={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},me={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ue={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function fe(t,e,s){if(!s)return s;if("string"==typeof s)return s;if("string"==typeof s.mode&&s.mode!==t)return null;if(!e)return s?s.value:void 0;let i=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return i=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&wt.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==s.after?/nothing/.test(s.after)&&i||/letter/.test(s.after)&&a||/digit/.test(s.after)&&o||/function/.test(s.after)&&n||/frac/.test(s.after)&&r||/surd/.test(s.after)&&l||/binop/.test(s.after)&&c||/relop/.test(s.after)&&h||/punct/.test(s.after)&&d||/array/.test(s.after)&&p||/openfence/.test(s.after)&&m||/closefence/.test(s.after)&&u||/text/.test(s.after)&&f||/space/.test(s.after)&&g?s.value:null:s.value}function ge(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function ye(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function be(t,e){let s="";Array.isArray(t)||(t=[t]);for(const i of t){let t;const a=i.match(/(^[^:]*):/),o=a?a[1]:"";if(o===ge("mac")||o===ge("win")||o===ge("ios")||o===ge("android")||o===ge("chromeos")||o===ge("other")){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}if(t){const i="mac"===ge("mac")||"ios"===ge("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!i&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:i?"⌘":"command",Shift:i?"⇧":"shift",Alt:i?"⌥":"alt",Ctrl:i?"⌃":"control","\n":i?"⏎":"return",Return:i?"⏎":"return",Enter:i?"⌤":"enter",Tab:i?"⇥":"tab",Esc:"esc",Backspace:i?"⌫":"backspace",Del:i?"⌦":"del",PageUp:i?"⇞":"page up",PageDown:i?"⇟":"page down",Home:i?"⤒":"home",End:i?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;s.length>0&&(s+=e||" or "),s+=o}}return s}var xe={KEYBOARD_SHORTCUTS:pe,INLINE_SHORTCUTS:ue,stringify:be,startsWithString:function(t,e){const s=[];for(let i=0;i<=t.length-1;i++){const a=t.substring(i);e&&e.overrideDefaultInlineShortcuts||Object.keys(ue).forEach(t=>{t.startsWith(a)&&!s.includes(t)&&s.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&s.push(t)})}return s},forString:function(t,e,s,i){let a="";i&&i.overrideDefaultInlineShortcuts||(a=fe(t,e,ue[s]));const o=i&&i.inlineShortcuts?i.inlineShortcuts:null;let n;return o&&(n=fe(t,e,o[s])),n||a},selectorForKeystroke:function(t,e){for(const s of[ge("mac")+":"+t+":"+e,ge("win")+":"+t+":"+e,ge("ios")+":"+t+":"+e,ge("android")+":"+t+":"+e,ge("chromeos")+":"+t+":"+e,ge("other")+":"+t+":"+e,ge("mac")+":"+e,ge("win")+":"+e,ge("ios")+":"+e,ge("android")+":"+e,ge("chromeos")+":"+e,t+":"+e,e])if(pe[s])return pe[s];return""},forCommand:function(t){let e=[];if("string"==typeof t){const s=me[t];Array.isArray(s)?e=s.slice():s&&e.push(s)}t=ye(t);const s=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(pe).forEach(t=>{if(s.test(ye(pe[t]))){const s=t.match(/:([^:]*)$/);s&&e.push(s[1])}}),be(e)}};function ke(t,e){this.root=Yt.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function ve(t){const e=Object.assign(new ke(t.config,t.target),t);return e.path=de.clone(t.path),e}function we(t,e){let s=0;for(let i=0;i0;)s.col+=1,(!t[s.row]||s.col>=t[s.row].length)&&(s.col=0,s.row+=1),e-=1;return s}function Ae(t,e){let s;return"object"!=typeof e&&(e=Se(t,e)),Array.isArray(t[e.row])&&(s=t[e.row][e.col]||null),!s||0!==s.length&&"first"===s[0].type||s.unshift(Ie()),s}function Me(t){let e=0,s=0,i=1;for(const e of t)s+=1,e.length>i&&(i=e.length);return e=s*i,e}function Ce(t,e,s){if(!t)return[];e||(e=",");let i,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?a.push(i):i=new Yt.MathAtom("math","mpunct",e,s),a=a.concat(o));return a}function _e(t,e,s){const i={...e};if(i.row+=s,i.row<0){if(i.col+=s,i.row=t.length-1,i.col<0)return null;for(;i.row>=0&&!Ae(t,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=t.length){for(i.col+=s,i.row=0;i.rowt.length-1)return null}return i}function Te(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function Le(t,e){if(!t)return!1;if(Array.isArray(t)){for(const s of t)if(Le(s,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(s){return s===e||Le(t[s],e)})))return!0;if(t.array)for(let s=Me(t.array);s>=0;s--)if(Le(Ae(t.array,s),e))return!0}return!1}function Fe(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function De(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return ze(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function ze(t,e){if(!t)return"";let s,i=!1;if(i||"^"!==t[0]&&"_"!==t[0]||(s=Ee(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+s.match+"}",t+=ze(s.rest,e),i=!0),i||(s=t.match(/^(sqrt|\u221a)(.*)/),s&&(s=Ee(s[2],{...e,noWrap:!0}),t="\\sqrt{"+s.match+"}",t+=ze(s.rest,e),i=!0)),i||(s=t.match(/^(\\cbrt|\u221b)(.*)/),s&&(s=Ee(s[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+s.match+"}",t+=ze(s.rest,e),i=!0)),i||(s=t.match(/^abs(.*)/),s&&(s=Ee(s[1],{...e,noWrap:!0}),t="\\left|"+s.match+"\\right|",t+=ze(s.rest,e),i=!0)),i||(s=t.match(/^["”“](.*?)["”“](.*)/),s&&(t="\\text{"+s[1]+"}",t+=ze(s[2],e),i=!0)),i||(s=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),s&&(t=qe(s[1],e),t+=ze(s[2],e),i=!0)),!i&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(s=Ee(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+s.match+"\\mright)":t[0]+s.match,t+=ze(s.rest,e),i=!0),i||(s=t.match(/^([a-zA-Z]+)(.*)/),s&&(t=qe(s[1],e),t+=ze(s[2],e),i=!0)),!i)if(s=Ee(t,{...e,noWrap:!0}),s.match&&"/"===s.rest[0]){const a=Ee(s.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+s.match+"}{"+a.match+"}"+ze(a.rest,e)),i=!0}else s.match&&(t="("===t[0]?"\\left("+s.match+"\\right)"+ze(s.rest,e):s.match+ze(s.rest,e),i=!0);return i||(s=t.match(/^(\s+)(.*)$/),s&&(t=" "+ze(s[2],e),i=!0)),t}function Ee(t,e){let s="",i=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?s=ze(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),s="\\left"+a+ze(t.substring(1,r-1),e)+"\\right"+o),i=t.substring(r)):(s=t.substring(1,r),i="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let s=xe.forString("math",null,t,e);if(s)return s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),{match:s,rest:t.substring(s.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(i=t.substring(a[1].length),s=a[1]))}return{match:s,rest:i}}function qe(t,e){let s=xe.forString("math",null,t,e);return s?(s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),s+=" "):s=t,s}function Ie(){return new Yt.MathAtom("","first")}ke.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,s)},ke.prototype.filter=function(t,e){e=e<0?-1:1;const s=[],i=new ke;i.path=de.clone(this.path),i.extent=this.extent,i.root=this.root,e>=0?i.collapseForward():(i.collapseBackward(),i.move(1));const a=i.anchor();do{t.bind(i)(i.path,i.anchor())&&s.push(i.toString()),e>=0?i.next({iterateAll:!0}):i.previous({iterateAll:!0})}while(a!==i.anchor());return s},ke.prototype.forEach=function(t){this.root.forEach(t)},ke.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const s=this.siblings(),i=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=i;e0?0:1)},ke.prototype.setRange=function(t,e,s){s=s||{};const i=de.pathDistance(t,e);if(0===i)return s.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(de.clone(t),0);if(1===i){const i=e[e.length-1].offset-t[t.length-1].offset;return s.extendToWordBoundary?(t=this.wordBoundary(t,i<0?1:-1),e=this.wordBoundary(e,i<0?-1:1),this.setRange(t,e)):this.setPath(de.clone(t),i)}let a=de.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=de.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},ke.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let s=0;s0?this.path[this.path.length-1].relation:""},ke.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},ke.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},ke.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},ke.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},ke.prototype.insertFirstAtom=function(){this.siblings()},ke.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ae(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Ie()),t},ke.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},ke.prototype.isCollapsed=function(){return 0===this.extent},ke.prototype.setExtent=function(t){this.extent=t},ke.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},ke.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},ke.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),s=this.endOffset();for(;t[e]&&"text"===t[e].mode&&wt.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[s]&&"text"===t[s].mode&&wt.LETTER_AND_DIGITS.test(t[s].body);)s+=1;if(s-=1,e>=s)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,s-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),s=this.endOffset();for(;Te(t[e]);)e-=1;for(;Te(t[s]);)s+=1;s-=1,this.setSelection(e,s-e)}else this.setSelection(0,"end")},ke.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},ke.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},ke.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),s=this.startOffset(),i=this.endOffset();for(let a=s;a0&&"command"===t[e].type;)e-=1;let s=this.startOffset()+1;for(;s<=t.length-1&&"command"===t[s].type;)s+=1;return s>e?{start:e+1,end:s}:null},ke.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const s=this.commandOffsets();if(s){const i=t?this.anchorOffset()+1:s.end,a=this.siblings();for(let t=s.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==s.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},ke.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let s=e.length-1;s>=0;s--)"command"===e[s].type?e.splice(s,1):t(e[s]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let s=Me(e.array);s>=0;s--)t(Ae(e.array,s))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},ke.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let s=this.startOffset();if("text"===t[s].mode)for(;s>=1&&"text"===t[s].mode;)e.unshift(t[s]),s--;else for(;s>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[s].type);)e.unshift(t[s]),s--;return e},ke.prototype.setSelection=function(t,e,s){t=t||0,e=e||0;const i=this.path[this.path.length-1].relation;s||(s=i);const a=this.parent();if(!a&&"body"!==s)return!1;const o=s.startsWith("cell");if(!o&&!a[s]||o&&!a.array)return!1;const n=s!==i;this.path[this.path.length-1].relation=s;const r=this.siblings().length;this.path[this.path.length-1].relation=i;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=s,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},ke.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let s=e[this.relation()];const i=this.parent();for(;s&&!i[s];)s=e[s];if(s)return void this.setSelection(0,0,s);if(this.parent().array){const t=Me(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ae(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const s=this.anchor();if(!s.captureSelection){let t;if(s.array){t="";const e=Me(s.array);let i=e-1;for(;!t&&i0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},ke.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const s=this.relation();if("denom"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Se(this.parent().array,s);e=_e(this.parent().array,e,-1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},ke.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const s=this.relation();if("numer"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Se(this.parent().array,s);e=_e(this.parent().array,e,1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},ke.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,s=0;const i=ve(this);s=this.extent+t;const a=e+s;if(a<0&&0!==s){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",i);e=this.path[this.path.length-1].offset,s=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",i);this.isCollapsed()&&(e-=1),s-=1}this.setSelection(e,s),this._announce("move",i)},ke.prototype.skip=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=ve(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(s&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!s)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let s="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(s){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",i)}},ke.prototype.jump=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,i.length-1));const o=t<0?0:i.length-1;s?this.extend(o-a):this.move(o-a)},ke.prototype.jumpToMathFieldBoundary=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const i=ve(this),a=[{relation:"body",offset:this.path[0].offset}];let o;s?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(i,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',s=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let i=s.indexOf(document.activeElement)+t;i<0&&(i=s.length-1),i>=s.length&&(i=0),s[i].focus()}return this.suppressChangeNotifications=s,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",i),this.selectionDidChange(),this.suppressChangeNotifications=s,!0},ke.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e=i.mode),s+=1,i=this.ancestor(s);return e},ke.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e={color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontShape:i.fontShape,fontSeries:i.fontSeries,fontSize:i.fontSize}),s+=1,i=this.ancestor(s);return e},ke.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let s=0,i=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(s++,i=o),"first"!==t[e].body[o].type&&a++;0===a&&1===s&&(t[e]=t[e].body[i])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=Fe(t.numer),t.denom=Fe(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=Fe(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=Fe(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=Fe(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=Fe(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=Fe(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=Fe(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=Me(t.array);e>=0;e--)this.simplifyParen(Ae(t.array,e))})}},ke.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const s=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const i=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=De(t,{...this.config,format:"ASCIIMath"}),o=le.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)wt.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new Yt.MathAtom("command","command",e))}else""===t?o=[new Yt.MathAtom("command","command","\\")]:(t=De(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=le.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=le.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=le.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,s){e&&s&&(Array.isArray(e)?e.forEach(e=>t(e,s)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(s),t(e.body,s),t(e.numer,s),t(e.denom,s),t(e.index,s),t(e.overscript,s),t(e.underscript,s),t(e.subscript,s),t(e.superscript,s))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=i,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=s},ke.prototype._insertSmartFence=function(t,e){const s=this.parent();if("leftright"===s.type&&"|"!==s.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const i=wt.RIGHT_DELIM[t];if(i&&("leftright"!==s.type||"|"!==s.leftDelim)){let s="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;s=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",s+=a?"?":i;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(s,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(wt.RIGHT_DELIM).forEach(e=>{t===wt.RIGHT_DELIM[e]&&(a=e)}),a){if(s&&"leftright"===s.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),s.rightDelim=t,this.move(1),this.contentDidChange(),!0;const i=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==i[a].type||"?"!==i[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),i[a].rightDelim=t,i[a].body=i[a].body.concat(i.slice(a+1,this.endOffset()+1)),i.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(s&&"leftright"===s.type&&"?"===s.rightDelim){this.contentWillChange(),s.rightDelim=t;const e=i.slice(this.endOffset()+1);return i.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===i.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},ke.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let s=e.start;for(;s=0;e--)t[e].suggestion&&t.splice(e,1)},ke.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const s=[],i=t.substr(e);for(const t of i){const e=new Yt.MathAtom("command","command",t);e.suggestion=!0,s.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(s))},ke.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},ke.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},ke.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(s+=1)}i.row+=1}return s}(t,e.col)){!function(t,e){let s=0;for(;s"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==s.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,s.slice(e+1,e+2)),s.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,s.slice(t,e)),s.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},ke.prototype.moveToNextPlaceholder_=function(){this.leap(1)},ke.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},ke.prototype.moveToNextChar_=function(){this.move(1)},ke.prototype.moveToPreviousChar_=function(){this.move(-1)},ke.prototype.moveUp_=function(){this.up()},ke.prototype.moveDown_=function(){this.down()},ke.prototype.moveToNextWord_=function(){this.skip(1)},ke.prototype.moveToPreviousWord_=function(){this.skip(-1)},ke.prototype.moveToGroupStart_=function(){this.setSelection(0)},ke.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},ke.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},ke.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},ke.prototype.deleteNextChar_=function(){this.delete_(1)},ke.prototype.deletePreviousChar_=function(){this.delete_(-1)},ke.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},ke.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},ke.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},ke.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},ke.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},ke.prototype.transpose_=function(){},ke.prototype.extendToNextChar_=function(){this.extend(1)},ke.prototype.extendToPreviousChar_=function(){this.extend(-1)},ke.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendUp_=function(){this.up({extend:!0})},ke.prototype.extendDown_=function(){this.down({extend:!0})},ke.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},ke.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},ke.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},ke.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},ke.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Ie()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Ie()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},ke.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Ie()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Ie()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},ke.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Ie()]),this.setSelection(0,"end",t)},ke.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},ke.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=ve(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},ke.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const s=this.relation();if(e.array){const i=Se(e.array,s);"after row"===t||"before row"===t?(i.col=0,i.row=i.row+("after row"===t?1:0),e.array.splice(i.row,0,[[]])):(i.col+="after column"===t?1:0,e.array[i.row].splice(i.col,0,[]));const a=we(e.array,i);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},ke.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",s=wt.getEnvironmentInfo(e),i=[[t.body]];s.parser&&Object.assign(t,s.parser(e,[],i)),t.tabularMode=s.tabular,t.parseMode=this.anchorMode(),t.env={...s},t.env.name=e,t.array=i,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},ke.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},ke.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},ke.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},ke.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},ke.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function s(t,s){let i=!0;return e.forEachSelected(e=>{i=i&&e[t]===s},{recursive:!0}),i}t.color&&s("color",t.color)&&(t.color="none"),t.backgroundColor&&s("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&s("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&s("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&s("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&s("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Pe={EditableMathlist:ke,parseMathString:De};const Be={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Oe={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},$e={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Re(t){let e,s=!0;"Unidentified"===t.key&&t.target&&(e=$e[t.target.value]||t.target.value),e||(Be[t.key]?(e=Be[t.key],s=!1):e=Oe[t.key],e||(e=$e[t.key.toLowerCase()])),!e&&t.code&&(e=Oe[t.code]||t.code);const i=[];return t.ctrlKey&&i.push("Ctrl"),t.metaKey&&i.push("Meta"),s&&t.altKey&&i.push("Alt"),s&&t.shiftKey&&i.push("Shift"),0===i.length?e:(i.push(e),i.join("-"))}function Ke(t,e){let s,i=null,a=null,o=!1,n=!1;function r(t){clearTimeout(s),s=setTimeout((function(){clearTimeout(s),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const s=t.value;t.value="",s.length>0&&e.typedText(s)}const c=t||e.container;c.addEventListener("keydown",(function(s){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==s.key&&"Unidentified"!==s.key&&229!==s.keyCode)n=!1;else{n=!0,o=!1;const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i}return!(!o&&"CapsLock"!==s.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(s.code))||(i=s,a=null,e.keystroke(Re(s),s))}),!0),c.addEventListener("keypress",(function(t){o||(i&&a&&e.keystroke(Re(i),i),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!i||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const s=t.value;t.value="",s.length>0&&e.paste(s)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){i=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i,n=!1,o=!1,r(l)}else o||r(l)})}var Ne={delegateKeyboardEvents:Ke,select:Ke.select,keyboardEventToString:Re,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const We={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},He={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function Ve(t){let e=He[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ue(t,e){t.popover.innerHTML=e;const s=t._getCaretPosition();s&&je(t,s),t.popover.classList.add("is-visible")}function je(t,e){const s=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>i-a?t.popover.style.left=i-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>s-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Ge(t){t.popover.classList.remove("is-visible")}var Ze={getNote:Ve,SAMPLES:We,NOTES:He,showPopoverWithLatex:function(t,e,s){if(!e||0===e.length)return void Ge(t);const i=e,a=function(t,e){const s=le.parseTokens(n(t),"math",null,e.config.macros),i=Yt.decompose({mathstyle:"displaystyle",macros:e.config.macros},s),a=N.makeSpan(i,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(We[i]||e,t),o=Ve(i),r=xe.forCommand(i);let l=s?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=s?'
    ':"",Ue(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ue,hidePopover:Ge,updatePopoverPosition:function t(e,s){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(s&&s.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&je(e,t)}else Ge(e)}};function Xe(t,e,s){let i="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";i=function t(e,s,i,a){if(0===i.length)return"";if(0===s.length)return i.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=s[0];let c=i[0][l];"fontFamily"===l&&(c=i[0].fontFamily||i[0].baseFontFamily);const h=function(t,e,s){let i=0;if("fontFamily"===e)for(;t[i]&&("mop"===t[i].type||(t[i].fontFamily||t[i].baseFontFamily)===s);)i++;else if("mode"===e)for(;t[i]&&t[i][e]===s;)i++;else for(;t[i]&&("mop"===t[i].type||t[i][e]===s);)i++;return i}(i,l,c);if("text"===i[0].mode){if("fontShape"===l&&i[0].fontShape)"it"===i[0].fontShape?(n="\\textit{",r="}"):"sl"===i[0].fontShape?(n="\\textsl{",r="}"):"sc"===i[0].fontShape?(n="\\textsc{",r="}"):"n"===i[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+i[0].fontShape+"}",r="}");else if("fontSeries"===l&&i[0].fontSeries)"b"===i[0].fontSeries?(n="\\textbf{",r="}"):"l"===i[0].fontSeries?(n="\\textlf{",r="}"):"m"===i[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+i[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(s+=" & "),s+=Xe(this,this.array[i][e],t);i1&&(s+=" "),s+=Xe(this,this.body,t),s+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?s+="("+Xe(this,this.body,t)+")":(s+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(s+=" "),s+=Xe(this,this.body,t),s+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" "));break;case"delim":case"sizeddelim":s+=n+"{"+this.delim+"}";break;case"rule":s+=n,this.shift&&(s+=`[${Xe(this,this.shift,t)}em]`),s+=`{${Xe(this,this.width,t)}em}{${Xe(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":s+=`${n}{${Xe(this,this.body,t)}}`;break;case"overunder":s+=`${n}{${Xe(this,this.overscript||this.underscript,t)}}{${Xe(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?s+=n+"{"+Xe(this,this.body,t)+"}":'\\char"'===n?s+=this.latex+" ":"\\unicode"===n?(s+='\\unicode{"',s+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),s+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?s+=n+"{"+Xe(this,this.body,t)+"}":"\\operatorname"===n?s+=n+"{"+Xe(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(s+="\\limits "),"nolimits"===this.limits&&(s+="\\nolimits "));break;case"box":if("\\bbox"===n){if(s+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(se(this.backgroundcolor)),s+=`[${t.join(",")}]`}s+=`{${Xe(this,this.body,t)}}`}else"\\boxed"===n?s+=`\\boxed{${Xe(this,this.body,t)}}`:(s+=n,this.framecolor&&(s+=`{${se(this.framecolor)}}`),this.backgroundcolor&&(s+=`{${se(this.backgroundcolor)}}`),s+=`{${Xe(this,this.body,t)}}`);break;case"spacing":s+=n,"\\hspace"===n||"\\hspace*"===n?(s+="{",this.width?s+=this.width+"em":s+="0em",s+="}"):(s+=" ",this.width&&(s+=this.width+"em "));break;case"enclose":if(s+=n,"\\enclose"===n){s+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(s+=t+e,t=" ");s+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+se(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+se(this.strokeColor)+'"',t=","),e&&(s+=`[${e}]`)}s+=`{${Xe(this,this.body,t)}}`;break;case"mathstyle":s+="\\"+this.mathstyle+" ";break;case"space":s+=this.latex;break;case"placeholder":s+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":s+=this.latex}if(this.superscript){let e=Xe(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),s+="^"+e):s+="^{"+e+"}"}if(this.subscript){const e=Xe(this,this.subscript,t);1===e.length?s+="_"+e:s+="_{"+e+"}"}return s},Je.plural=function(t,e,s){(s=s||{}).type=s.type||"cardinal";const i=Je.locale.substring(0,2),a="ordinal"===s.type?Je.ordinal:Je.cardinal;let o,n="ordinal"===s.type?Je._ordinalPluralCategories.indexOf(a.select(t)):Je._cardinalPluralCategories.indexOf(a.select(t));return Je.strings[Je.locale]&&(o=Je.strings[Je.locale][e]),!o&&Je.strings[i]&&(o=Je.strings[i][e]),o||(o=Je.strings.en[e],o||(o=e),n="ordinal"===s.type?Je._ordinalPluralCategories.indexOf(Je._ordinalEnglish.select(t)):Je._cardinalPluralCategories.indexOf(Je._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Je.merge=function(t,e){if(t&&e){const s=Je._locale;Je.locale=t,Je.strings[t]={...Je.strings[t],...e},Je.locale=s}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Je.merge(t,e[t])))},Object.defineProperty(Je,"locale",{set(t){Je._locale=t,Je._ordinal=null,Je._cardinal=null},get:()=>(Je._locale||(Je._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Je._locale)}),Object.defineProperty(Je,"ordinal",{get:()=>(Je._ordinal||(Je._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Je._ordinalEnglishPluralCategories=Je._ordinalEnglish.resolvedOptions().pluralCategories,Je._ordinal=new Intl.PluralRules(Je.locale,{type:"ordinal"}),Je._ordinalPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._ordinal)}),Object.defineProperty(Je,"cardinal",{get:()=>(Je._cardinal||(Je._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Je._cardinalEnglishPluralCategories=Je._cardinalEnglish.resolvedOptions().pluralCategories,Je._cardinal=new Intl.PluralRules(Je.locale,{type:"cardinal"}),Je._cardinaPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._cardinal)}),Je.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const Ye={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},Qe={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ts={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let es={};const ss={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function is(t,e,s){t=t.replace(/(^|[^\\])#@/g,"$1#?");const i=le.parseTokens(n(t),"math",e,s.config.macros),a=Yt.decompose({mathstyle:"displaystyle",macros:s.config.macros},i),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function as(t,e,s){let i="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},Ye,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;i+="
    "+e[t].label+"
    "}}return i+="
    ",i+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function os(t,e,s){for(let i=0;i"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&Qe[n]&&(a.setAttribute("data-shifted",Qe[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",Qe[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],s&&(o=[s,o]),a.getAttribute("data-alt-keys")){const t=es[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function ns(t,e){const s={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=s[t.config.virtualKeyboardLayout]?s[t.config.virtualKeyboardLayout]:s.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const s of t){const t=s.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=i[e.name];if(r||(r=s.qwerty[e.name]),r)for(const t of r){let s=e.class||"";s&&(s=" "+s),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(s)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var rs={make:function(t,e){let s='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ts["foreground-color"]=[];for(const t of ae)ts["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ts["background-color"]=[];for(const t of ie)ts["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});es={...ts},Object.keys(es).forEach(t=>{es[t]=es[t].slice()});const i="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];es[e]||(es[e]=[]),es[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),es[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),es[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),es[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),es[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),es[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),es[e].unshift({latex:"\\mathbb{"+i[t]+"}",aside:"blackboard",insert:"\\mathbb{"+i[t]+"}"}),es[e].unshift({latex:"\\mathbf{"+i[t]+"}",aside:"bold",insert:"\\mathbf{"+i[t]+"}"}),es[e].unshift({latex:"\\mathsf{"+i[t]+"}",aside:"sans",insert:"\\mathsf{"+i[t]+"}"}),es[e].unshift({latex:"\\mathcal{"+i[t]+"}",aside:"script",insert:"\\mathcal{"+i[t]+"}"}),es[e].unshift({latex:"\\mathfrak{"+i[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+i[t]+"}"})}for(let t=0;t<=26;t++){const e=i[t];es[e]||(es[e]=[]),es[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),es[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),es[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),es[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];es[e]||(es[e]=[]),es[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),es[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),es[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),es[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),es[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ss,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},Ye,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let i=n[e].layers||[];n[e].layer&&i.push(n[e].layer),i=Array.from(new Set(i));for(const n of i){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const s of e)t+="${s.label?s.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}s+="
    ",s+=as(t,a,e);const i="function"==typeof o[n]?o[n]():o[n];s+=ns(t,i),s+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=s,os(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:os};const ls={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},cs={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},hs={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function ds(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ps(t,e){return t&&e.generateID?' extid="'+t+'"':""}function ms(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(i=!0,us(t)&&(n=t.index,t.index+=1),fs(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=vs(t.atoms[r].subscript,0,0,s).mathML,a+=vs(t.atoms[n].superscript,0,0,s).mathML,a+="";else if(n>=0){if(a=""+o,us(t)){const e=vs(t.atoms[n].superscript,0,0,s).mathML,i=vs(t.atoms[n+1].superscript,0,0,s).mathML;a+=""!==e&&""!==e||""!==i&&""!==i?""===e||""===e?"":e:""}else a+=vs(t.atoms[n].superscript,0,0,s).mathML;a+=""}else r>=0?(a=""+o,a+=vs(t.atoms[r].subscript,0,0,s).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return i}function us(t){return t.index"+t,a+=vs(o.subscript,0,0,s).mathML,a+=vs(o.superscript,0,0,s).mathML,a+=""):o.superscript?(a=""+t,a+=vs(o.superscript,0,0,s).mathML,a+=""):o.subscript&&(a=""+t,a+=vs(o.subscript,0,0,s).mathML,a+=""),a.length>0&&(i=!0,e.mathML+=a,e.lastType=""),i))}function ys(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(i=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),i}function bs(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,s=t.index,i=!1,a=!1;for(;s=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(i=!0,o=""+o+"",n<0&&us(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=vs(t.atoms[n].superscript,0,0,s).mathML,o+=""),t.mathML+=o,t.lastType="mn"),i}function xs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=ws(t.atoms[l],s),a+=vs(t.atoms,l+1,c,s).mathML,a+=ws(t.atoms[c],s),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,gs(a,t,s)&&(i=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function ks(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=vs(n.subscript,0,0,s).mathML,a+=vs(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=vs(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=vs(n.subscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Ss(e.body)+"":ws(e,s);a+=r,t.index+=1,gs(a,t,s)&&(i=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function vs(t,e,s,i){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(s=s||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(i);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function ws(t,e){let s="";const i=Ss(t.body);return i&&(s=""+i+""),s}function Ss(t){if(!t)return"";if("string"==typeof t)return ds(t);if(!Array.isArray(t)&&"string"==typeof t.body)return ds(t.body);let e="";for(const s of t)"string"==typeof s.body&&(e+=s.body);return ds(e)}Yt.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let i,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=vs(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(hs[this.lFence]||this.lFence)+"")),c+="",i=0;i"+vs(this.array[a][i],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(hs[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hs[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=vs(this.numer,0,0,t).mathML||" ",c+=vs(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+vs(this.numer,0,0,t).mathML+"",c+=""+vs(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hs[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=vs(this.body,0,0,t).mathML,c+=vs(this.index,0,0,t).mathML,c+=""):(c+="",c+=vs(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hs[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=vs(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hs[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(hs[this.delim]||this.delim)+"";break;case"accent":c+='",c+=vs(this.body,0,0,t).mathML,c+=""+(hs[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+vs(l,0,0,t).mathML,c+=vs(n,0,0,t).mathML,c+=vs(r,0,0,t).mathML,c+=""):r?(c+=""+vs(l,0,0,t).mathML,c+=vs(r,0,0,t).mathML,c+=""):n&&(c+=""+vs(l,0,0,t).mathML,c+=vs(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const s=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;s?c="&#x"+s[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const i=/\d/.test(c)?"mn":"mi";c="<"+i+d+ps(this.id,t)+">"+ds(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&hs[p]?""+hs[p]+"":ws(this,t);break;case"mpunct":c='"+(hs[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+vs(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+vs(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},Yt.toMathML=function(t,e){return vs(t,0,0,e).mathML};const As={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},Ms={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Cs={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},_s={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Ts(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Ls(t){return t&&_s[t]||-1}function Fs(t){return/=|=>/.test(t)?"right":"left"}function Ds(t){if("f"===t||"g"===t)return!0;const e=Cs[t];return!!e&&!!/%[^01_^]?/.test(e)}function zs(t){t=(t||"").trim();let e=As[t];if(!e)if(/^\\[^{}]+$/.test(t)){const s=wt.getInfo(t,"math",{});e=s&&s.value||t.slice(1)}else e=t;return e}function Es(t){if(!t)return null;const e=zs($s(t)),s=[Ls(e),Fs(e)];return s[0]<=0?null:s}function qs(t){return null!==Es(t)}const Is={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Ps={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Bs={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Os={",":"list",";":"list2"};function $s(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const s of t)e+=$s(s);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const s of t.body)e+=$s(s);return e}return""}function Rs(t){return"string"==typeof t.sym?function(t){let e=Cs[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const s=wt.getInfo("\\"+t,"math");!s||s.fontFamily&&"cmr"!==s.fontFamily&&"ams"!==s.fontFamily||(e="\\"+t)}return e||(e=wt.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Ks(t){return parseFloat(t.num)}function Ns(t){return"object"==typeof t&&void 0!==t.num}function Ws(t){let e=0;return Ns(t)&&(e="object"==typeof t.num?void 0!==t.num.re?li(t.num.re):0:parseFloat(t.num)),e}function Hs(t){let e=0;return Ns(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?li(t.num.im):0),e}function Vs(t){return t&&void 0!==t.sup}function Us(t){return t&&void 0!==t.sub}function js(t,e,s){let i=!1;const a=t.atoms[t.index];return a&&a.type===e&&(i=void 0===s||$s(a)===s),i}function Gs(t,...e){const s={fn:t};if(e){const t=[];for(const s of e)s&&t.push(s);t.length>0&&(s.arg=t)}return s}function Zs(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Xs(t){if(Ns(t)){const e=Ws(t),s=Hs(t);return 0!==s?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-s).toString()):t.num=(-e).toString(),t}return Gs("negate",t)}function Js(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function Ys(t,e){let s=t.atoms[t.index];return!s||void 0===s.superscript&&void 0===s.subscript?s=null:t.index+=1,s||(s=t.atoms[t.index+1],s&&"msubsup"===s.type&&(s.superscript||s.subscript)?t.index+=2:s=null),s?(void 0!==s.subscript&&(t.ast.sub=oi(s.subscript,e)),void 0!==s.superscript&&("msubsup"===s.type?/['\u2032]|\\prime/.test($s(s.superscript))?(t.index+=1,s=t.atoms[t.index+1],s&&"msubsup"===s.type&&/['\u2032]|\\prime/.test($s(s.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test($s(s.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=oi(s.superscript,e)):t.ast.sup=oi(s.superscript,e))):t.index+=1,t}function Qs(t,e){const s=t.ast;if(ei(t,"!!"))return t.index+=1,t.ast=Gs("factorial2",s),Qs(t=Ys(t,e),e);if(ei(t,"++"))return t.index+=1,t.ast=Gs("increment",s),Qs(t=Ys(t,e),e);if(ei(t,"--"))return t.index+=1,t.ast=Gs("decrement",s),Qs(t=Ys(t,e),e);const i=t.atoms[t.index];return i&&i.latex&&Ps[i.latex.trim()]&&(t.ast=Gs(Ps[i.latex.trim()],s),t=Qs(t=Ys(t,e),e)),t}function ti(t,e,s,i){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&$s(o)===e)t.index+=1,o=(t=ii(t,i)).atoms[t.index],o&&"mclose"===o.type&&$s(o)===s&&(Js(t)&&(t.ast={group:t.ast}),t=Qs(t=Ys(t,i),i));else if("textord"===o.type&&$s(o)===e)t.index+=1,o=(t=ii(t,i)).atoms[t.index],o&&"textord"===o.type&&$s(o)===s&&(t.index+=1,t=Qs(t=Ys(t,i),i));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=ii(t,i)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=Qs(t=Ys(t,i),i))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=ii(t,i)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===s&&(t.index+=1,t=Qs(t=Ys(t,i),i));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==s)return;t.ast=oi(o.body,i),Js(t)&&(t.ast={group:t.ast}),t=Qs(t=Ys(t,i),i)}return t.minPrec=a,t}{let i=!0;if("mopen"===o.type?(e=o.latex.trim(),s=wt.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,s=wt.RIGHT_DELIM[e]):"leftright"===o.type?(i=!1,e=o.leftDelim,"?"===(s=o.rightDelim)&&(s=wt.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),s=wt.RIGHT_DELIM[e]),e&&s){if("|"===e&&"|"===s){const i=t.atoms[t.index+1];i&&"textord"===i.type&&"|"===i.latex&&(e="\\lVert",s="\\rVert")}if(t=ti(t,e,s))return i&&(t.index+=1),t.ast={fn:Is[e+s]||e+s,arg:[t.ast]},t.minPrec=a,t}}}function ei(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===$s(t.atoms[t.index])+$s(t.atoms[t.index+1])}function si(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!js(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,s=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return s&&(t.index+=1),s}return t.index+=1,js(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):js(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function ii(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let s=function t(e,s){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let i=e.atoms[e.index];if("text"===i.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=zs($s(i));if(si(e))e.ast=Gs(e.ast,t(e,s).ast);else{if("root"===i.type)return e.index=0,e.atoms=i.body,t(e,s);if("mbin"===i.type&&"-"===a)e.index+=1,(e=t(e,s)).ast=Xs(e.ast);else if("mbin"===i.type&&"+"===a)e.index+=1,(e=t(e,s)).ast=Gs("add",e.ast);else if("mord"===i.type&&/^[0-9.]$/.test(i.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ai(t)))),e=[t])}return e}function oi(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const s=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;s.push(e)}else{const i=ii(t,e).ast;if(!i)return;s.push(i)}return s.length>1?Gs("text",...s):s[0]||void 0}({atoms:ai(t)},e)}function ni(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let s="";if(e.length>0){"."!==t[0]&&(s+=t[0]);let i="";for(const a of e)s+=i+a,i=t[2];"."!==t[1]&&(s+=t[1])}return s}function ri(t,e){const s=t.length;t=t.substr(0,e.precision-2);for(let s=0;s1&&(i+o.repeat(n+1)).startsWith(t))return"0"===o?i.replace(/(\d{3})/g,"$1"+e.groupSeparator):i.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return s!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function li(t){return parseFloat(parseFloat(t).toPrecision(15))}function ci(t,e){let s="";if("number"==typeof e.precision){if("number"!=typeof t){let s="",i="";if("-"===t[0]?(s="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(i=a[4]||"","0"===o){let i=0;for(;"0"===n[i]&&i=e.precision)a="0",s="";else{a=t[i];const s=ri(t.substr(i+1),e);s&&(a+=e.decimalMarker+s)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),i>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-i).toString():a+="10^{"+(1-i).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const s=ri(n,e);s&&(t+=e.decimalMarker+s)}}else if(t.length>e.precision){const s=t.length;let i=t[0];const a=ri(t.substr(2),e);a&&(i+=e.decimalMarker+a,"}"!==i[i.length-1]&&(i+="\\ldots")),"1"!==i?i+=e.exponentProduct:i="",e.exponentMarker?i+=e.exponentMarker+(s-2).toString():i+="10^{"+(s-2).toString()+"}",t=i}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return i&&(i=e.exponentMarker?e.exponentMarker+i:e.exponentProduct+" 10^{"+i+"}"),s+t+i}t=li(t)}if("engineering"===e.scientificNotation)if(0===t)s="0";else{const i=Math.abs(t);let a=Math.round(Math.log10(i));a-=a%3,i<1e3&&(a=0);let o=i/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=ri(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",s=(t<0?"-":"")+o+a}else{const i="string"==typeof t?t:t.toString();let a,o,n,r=i.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=i,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=ri(n,e)),n&&(n=e.decimalMarker+n),s=a+n+(o||"")}return s}Yt.MathAtom.prototype.toAST=function(t){let e,s,i,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(s=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),s=le.parseTokens(n(s),"math",null,t.macros),i=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),i=le.parseTokens(n(i),"math",null,t.macros),o=Gs("divide",oi(s,t),oi(i,t))):o.fn="divide"):o.group=oi(this.body,t);break;case"genfrac":o=Gs("divide",oi(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Zs(1):oi(this.denom,t));break;case"surd":o=this.index?Gs("pow",oi(this.body,t),Gs("divide",Zs(1),oi(this.index,t))):Gs("sqrt",oi(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=zs($s(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=wt.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=oi(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Gs("card",oi(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>oi(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const s=[];s.push(oi(e[0],t));let i=oi(e[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(t=>"string"!=typeof t)),s.push(i||{}),o.args.push(s)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},Yt.toAST=function(t,e){return oi(t,e)};var hi=function t(e,s){const i=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},s);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Ns(e)){const s=Ks(e);if(s===-1/0)a="-\\infty ";else if(s===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(s)?"\\text{NaN}":ci(e.num,i);else{const t=Ws(e),s=Hs(e);isNaN(t)||isNaN(s)?a="\\text{NaN}":Math.abs(s)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ci(t,i)),Math.abs(s)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=s>0?"+":""),a+=(1!==Math.abs(s)?ci(s,i):"")+"\\imaginaryI "))}Vs(e)&&(a+="^{"+t(e.sup,i)+"}"),Us(e)&&(a+="_{"+t(e.sub,i)+"}")}else if(e.group)a=t(e.group,i),Ns(e.group)||Rs(e.group)?0!==Hs(e.group)&&(a=ni(e.fence||"(),",a)):a=ni(e.fence||"(),",a),Vs(e)&&(a+="^{"+t(e.sup,i)+"}"),Us(e)&&(a+="_{"+t(e.sub,i)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Ts(e,0),i)+"|_{",e.arg&&2===e.arg.length)a+=t(Ts(e,1));else{let s="";for(let i=1;i=2)a=t(Ts(e,0),i),Ns(Ts(e,0))||Rs(Ts(e,0))||(a=ni(e.fence||"(),",a)),a+="^{"+t(Ts(e,1),i)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,i)).join(" = ");else{const s=function(t){let e=Cs[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=s;let o="";if(/%(?![01_^])/.test(s)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ni(e.fence||"(),",...e.arg.map(e=>t(e,i)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Ts(e,0),i),r=t(Ts(e,1),i),l=[...e.arg];/%0/.test(s)&&(a=a.replace("%0",n),l.shift()),/%1/.test(s)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ni(e.fence||"(),",...l.map(e=>t(e,i))))}else o=ni(e.fence||"(),","");a=Vs(e)?a.replace("%^","^{"+t(e.sup,i)+"}"):a.replace("%^",""),a=Us(e)?a.replace("%_","_{"+t(e.sub,i)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const s=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?s.push(ni("() ",t(a,i))):0!==Ws(o=a)&&0!==Hs(o)?s.push(ni("() ",t(a,i))):Vs(e)&&0!==Hs(a)&&1!==Hs(a)?s.push(ni("() ",t(a,i))):s.push(t(a,i));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Ns(e.arg[0])&&"divide"!==e.arg[0].fn||Ns(e.arg[1])&&(0!==Ws(e.arg[1])||1!==Hs(e.arg[1]))?s.join(" \\times "):s[0]+s[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Ns(e.arg[0])&&Ks(e.arg[0])<0?s[0]:"+"+s[0];else{a=s[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function pi(t){let e=0;if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&(e+=1);return 1===e}function mi(t){let e="";if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&"string"==typeof s.body&&(e+=s.body);return e}function ui(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],s,a)}else t.addEventListener(a,s,i)}}function fi(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],s,a)}else t.removeEventListener(a,s,i)}}function gi(t,e){let s=document.getElementById(t);return s?s.setAttribute("data-refcount",parseInt(s.getAttribute("data-refcount"))+1):(s=document.createElement("div"),s.setAttribute("aria-hidden","true"),s.setAttribute("data-refcount","1"),s.className=e,s.id=t,document.body.appendChild(s)),s}function yi(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function bi(t){return t.element&&t.element.mathfield===t}Yt.toSpeakableFragment=function(t,e){function s(t){return""+t+""}if(!t)return"";let i="";if(t.id&&"math"===e.speechMode&&(i+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=Yt.toSpeakableFragment(t.body,e),t.index){let s=Yt.toSpeakableFragment(t.index,e);s=s.trim();const a=s.replace(//g,"");i+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+s+', of '+n+'. End root'}else pi(t.body)?i+=" the square root of "+n+" , ":i+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":i+=di[t.leftDelim]||t.leftDelim,i+=Yt.toSpeakableFragment(t.body,e),i+=di[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":i+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=t.latex?t.latex.trim():"";if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){i=Yt.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)i+=a;else{if("mbin"===t.type&&(i+=''),a){const t=di[a]||(o?di[o.trim()]:"");if(t)i+=" "+t;else{const t=o?function(t){let e=Ze.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";i+=t||function(t){let s="";return e.textToSpeechMarkup?/[a-z]/.test(t)?s+=' '+t+"":/[A-Z]/.test(t)?s+="capital "+t.toLowerCase():s+=t:/[a-z]/.test(t)?s+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?s+=" 'capital "+t.toUpperCase()+"'":s+=t,s}(a)}}else i+=Yt.toSpeakableFragment(t.body,e);"mbin"===t.type&&(i+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let s=Yt.toSpeakableFragment(t.superscript,e);s=s.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the summation from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=Yt.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the summation from '+s+' of ',r=!0}else i+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let s=Yt.toSpeakableFragment(t.superscript,e);s=s.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the product from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=Yt.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the product from '+s+' of ',r=!0}else i+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=Yt.toSpeakableFragment(t.superscript,e);a=a.trim();let o=Yt.toSpeakableFragment(t.subscript,e);o=o.trim(),i+=' the integral from '+s(o)+' to '+s(a)+' of ',r=!0}else i+=' the integral of ';else if("string"==typeof t.body){i+=di[t.body]||di[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?i+=" "+t.latex.substr(1):i+=" "+t.latex)}break;case"enclose":n=Yt.toSpeakableFragment(t.body,e),pi(t.body)?i+=" crossed out "+n+" , ":i+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let s=Yt.toSpeakableFragment(t.superscript,e);s=s.trim();const a=s.replace(/<[^>]*>/g,"");if(pi(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(i+='')}"′"===a?i+=" prime ":"2"===a?i+=" squared ":"3"===a?i+=" cubed ":isNaN(parseInt(a))?i+=" to the "+s+"; ":i+=' to the '+a+" power; "}else isNaN(parseInt(a))?i+=" raised to the "+s+"; ":i+=' raised to the '+a+" power; "}if(!r&&t.subscript){let s=Yt.toSpeakableFragment(t.subscript,e);s=s.trim(),pi(t.subscript)?i+=" sub "+s:i+=" subscript "+s+". End subscript. "}}return i},Yt.toSpeakableText=function(t,e){const s=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(s.speechMode="math",window.sre&&"sre"===s.textToSpeechRules){s.generateID=!0;const e=Yt.toMathML(t,s);return e?(s.textToSpeechMarkup&&(s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup=s.textToSpeechMarkup,"ssml"===s.textToSpeechRulesOptions.markup&&(s.textToSpeechRulesOptions.markup="ssml_step"),s.textToSpeechRulesOptions.rate=s.speechEngineRate),s.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(s.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let i=Yt.toSpeakableFragment(t,s);if("ssml"===s.textToSpeechMarkup){let t="";s.speechEngineRate&&(t=''),i=''+t+"

    "+i+"

    "+(t?"
    ":"")+""}else i="mac"===s.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?i.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):i.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return i};class xi{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let s=this.element.textContent;s&&(s=s.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?i+="\n \n \n ":i+='',i+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(i+=`"):i+="",i+="",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=i;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=gi("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=gi("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,ui(this.element,"focus",this),ui(this.element,"blur",this),ui(this.textarea,"cut",this),ui(this.textarea,"copy",this),ui(this.textarea,"paste",this),Ne.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?ui(this.field,"pointerdown",this):ui(this.field,"touchstart:active mousedown",this),ui(window,"resize",this);const o={...e};o.onSelectionDidChange=xi.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=xi.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Pe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const s=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=s}}(this.mathlist),s.length>0&&this.$latex(s),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>bi(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,fi(this.textarea,"cut",this),fi(this.textarea,"copy",this),fi(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,yi(this.popover),yi(this.keystrokeCaption),yi(this.virtualKeyboard),yi(document.getElementById("mathlive-alternate-keys-panel")),fi(this.element,"pointerdown",this),fi(this.element,"touchstart:active mousedown",this),fi(this.element,"focus",this),fi(this.element,"blur",this),fi(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let s;return Array.from(e.children).forEach((function(e){s=s||t(e)})),s}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const s=t.getBoundingClientRect();s.lefte.right&&(e.right=s.right),s.bottom>e.bottom&&(e.bottom=s.bottom),s.top=t.left&&s<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,s,i);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(i=de.pathFromString(e[0]).path,0===s.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const i=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=i=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1;const r=this.field.querySelector(".ML__mathlive").getBoundingClientRect();if(s=d>r.right?[{relation:"body",offset:this.mathlist.root.body.length-1}]:this._pathFromPoint(d,p,{bias:0}),s){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,s),s=de.clone(this.mathlist.path),s[s.length-1].offset-=1):this.mathlist.setPath(s,0),o=!0,this.style={},3===t.detail||vi>2?(n(t),3!==t.detail&&3!==vi||this.mathlist.selectAll_()):i||(i=!0,window.PointerEvent?(ui(e.field,"pointermove",h),ui(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(ui(window,"blur",n),t.touches?(ui(t.target,"touchmove",h),ui(t.target,"touchend",n)):(ui(window,"mousemove",h),ui(window,"mouseup",n))),2!==t.detail&&2!==vi||(a=!0,this.mathlist.selectGroup_()))}}else ki=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Ze.hidePopover(this),this.mathlist.removeCommandString())}Ze.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const s=t?t.path:[],i=this.mathlist.path,a=i[i.length-1];let o="";for(;s.length>i.length;)o+="out of "+e(t.parent(),s[s.length-1])+"; ",s.pop();if(!this.mathlist.isCollapsed())return wi(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=wi(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,s)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Ze.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Ze.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const s=this.element.getBoundingClientRect();e.style.left=s.left+"px",e.style.top=s.top-64+"px",e.innerHTML=""+(xe.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,s=!1,i=[],a=!1;if(Array.isArray(t)?(e=t[0],i=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...i),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);0===e.length?Ze.hidePopover(this):Ze.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,s=!0}else"function"==typeof this[e]&&(a=this[e](...i),s=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),s}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let s=0,i=!1;for(this.mathlist.contentWillChange();!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),i||(a.applyStyle({mode:"text"}),a.latex=a.body),s-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let s=0,i=!1;for(;!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),i||a.applyStyle({mode:"math",type:"mord"}),s-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,s=!1;for(;!s;){const i=this.mathlist.sibling(e);s=!(i&&("text"===i.mode&&!i.type||"math"===i.mode&&/mord|textord|mpunct/.test(i.type))),s||(t=i.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(s));const i=this.getTextBeforeAnchor_()+s;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(s))return!0;if(/[\^_]/.test(s))return/(^|\s)[a-zA-Z][^_]$/.test(i)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[s];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(i))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(s))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(i))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(i)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(i))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(s))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(i)&&!/(dxd|abc|xyz|uvw)$/.test(i))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(i))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(i)&&!/(αβγ)$/.test(i))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(s))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let s,i,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=Ne.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!s&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const i=this.mode;s?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==i&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(s||a||(a=xe.selectorForKeystroke(this.mode,t)),!s&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!s){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||s)&&s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(Ne.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const s=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[i],{...this.config,suppressChangeNotifications:!0}),this.mode=s}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(s,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),s.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),s=Ne.charToEvent(e);if(!this.$keystroke(Ne.keyboardEventToString(s),s))return}let s="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=i(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),i=wt.suggest(e+t);a=i.length>1,0===i.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Ze.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),i[0].match!==e+t&&this.mathlist.insertSuggestion(i[0].match,-i[0].match.length+e.length+1),s=i[0].match)}else if("math"===this.mode){const s={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(s){if("moveToSuperscript"===s){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===s&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(s)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Ze.showPopoverWithLatex(this,s,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let s=0;sbi(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,s=!1;for(;t&&!s;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,s=!0),e+=1,t=this.mathlist.ancestor(e)}const s=Yt.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),i=N.makeSpan(s,"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",i.height,"em");const o=[a];if(0!==i.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",i.height+i.depth,"em"),t.setStyle("vertical-align",-i.depth,"em"),o.push(t)}o.push(i);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+Yt.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let s="";if("latex"===(e=e||"latex")||"latex-expanded"===e)s=t.toLatex("latex-expanded"===e);else if("mathML"===e)s=t.toMathML(this.config);else if("spoken"===e)s=Yt.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",s=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const i=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),s=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=i,this.config.generateID=a}else if("json"===e){const e=Yt.toAST(t,this.config);s=JSON.stringify(e)}else"ASCIIMath"===e&&(s=function t(e,s){if(!e)return"";if(Array.isArray(e)){let s="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let i=0;for(s='"';e[i]&&"text"===e[i].mode;)s+=e[i].body,i++;s+='"'+t(e.slice(i))}else{let i=0;for(;e[i]&&"math"===e[i].mode;)s+=t(e[i]),i++;s+=t(e.slice(i))}return s.trim()}if("text"===e.mode)return'"'+e.body+'"';let i="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":i=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(i+="(",i+=t(e.numer),i+=")/(",i+=t(e.denom),i+=")"):(i+="("+t(e.numer)+"),",i+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?i+="root("+t(e.index)+")("+t(e.body)+")":i+="sqrt("+t(e.body)+")";break;case"leftright":i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",i+=t(e.body),i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":i=ls[a]||a||("string"==typeof e.body?e.body:""),"\\"===i[0]&&(i+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?i=String.fromCharCode(parseInt("0x"+o[1])):i.length>0&&"\\"===i.charAt(0)&&(i="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":i=a&&ls[a]?ls[a]:a&&cs[a]?cs[a]:e.body;break;case"mopen":case"mclose":i+=e.body;break;case"mpunct":i=cs[a]||a;break;case"mop":"​"!==e.body&&(i="",i+="\\operatorname"===a?t(e.body):e.body||a,i+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":i=" "}if(e.subscript){i+="_";const s=t(e.subscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}if(e.superscript){i+="^";const s=t(e.superscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}return i}(t,this.config));return s}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const s=Yt.makeRoot("math",e);return this.formatMathlist(s,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!0:s.subscript&&(i=!1),e+=1,s=this.mathlist.ancestor(e);return i?t:0}_subscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!1:s.subscript&&(i=!0),e+=1,s=this.mathlist.ancestor(e);return i?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const s=this._getSelectionBounds();s&&(t={x:s.right+e.left-this.field.scrollLeft,y:s.top+e.top-this.field.scrollTop})}if(t){const s=t.x-window.scrollX;se.right&&this.field.scroll({top:0,left:s-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const s=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=s)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,s){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Ze.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,s&&this.$insert(s,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Ze.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(wt.commandAllowed(t,e)){const s=le.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(s)}else{const s=le.parseTokens(n(e),t,null,this.config.macros);s?this.mathlist.spliceCommandStringAroundInsertionPoint(s):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);if(0===e.length)Ze.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const s=this.suggestionIndex%e.length,i=t.length-e[s].match.length;0!==i&&this.mathlist.insertSuggestion(e[s].match,i),Ze.showPopoverWithLatex(this,e[s].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const s=this;let i,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),ui(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),i=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+s.config.namespace+"command-pressed");n&&s.$perform(JSON.parse(n));const l=t.getAttribute("data-"+s.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&s.$perform(JSON.parse(l))}),300))}})),ui(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),ui(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?s.style.width="286px":4===e.length||2===e.length?s.style.width="146px":1===e.length?s.style.width="86px":s.style.width="146px",s.style.height="auto";let i="";for(const t of e)i+="";i="
      "+i+"
    ",s.innerHTML=i,rs.makeKeycap(this,s.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-s.clientHeight<0&&(s.style.width="auto",e.length<=6?s.style.height="56px":e.length<=12?s.style.height="108px":s.style.height="205px");const t=(a.top-s.clientHeight+5).toString()+"px",i=Math.max(0,Math.min(window.innerWidth-s.offsetWidth,(a.left+a.right-s.offsetWidth)/2))+"px";s.style.transform="translate("+i+","+t+")",s.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",yi(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let s=!1;for(let i=0;i=1){s=[];for(let t=1;t<=i;t++)s.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),i=t.mathlist.endOffset()+1;if(i<=e.length-1){s=[];for(let t=i;t<=e.length-1;t++)s.push(e[t])}break}case"start":case"end":break;case"group":s=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(s=t.mathlist.parent());break}}return s}(this,t);if(null===s)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const i={...this.config};(e.withHighlighting||"amazon"===i.speechEngine)&&(i.textToSpeechMarkup=window.sre&&"sre"===i.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(i.generateID=!0));const a=Yt.toSpeakableText(s,i);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,i),!1}}let ki,vi=0;function wi(t,e,s){const i=Object.assign({},t.config);return i.textToSpeechMarkup="",i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup="none",e+Yt.toSpeakableText(s,i)}function Si(t,e,s,i){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=wi(t,"deleted: ",i):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(s):"replacement"===e?a=wi(t,"",t.mathlist.sibling(0)):"line"===e?(a=wi(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+Yt.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=i?wi(t,e+" ",i):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}xi.prototype.undo_=xi.prototype.undo,xi.prototype.redo_=xi.prototype.redo,xi.prototype.scrollIntoView_=xi.prototype.scrollIntoView,xi.prototype.scrollToStart_=xi.prototype.scrollToStart,xi.prototype.scrollToEnd_=xi.prototype.scrollToEnd,xi.prototype.insert_=xi.prototype.$insert;var Ai={isValidMathfield:bi,MathField:xi};function Mi(t,e,s){let i=s,a=0;const o=t.length;for(;i0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=Mi(s,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+s.length),mathstyle:i}),c=r+s.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){s.textContent=t}return s.className="sr-only",s}(t,s)),/\bspeakable-text\b/i.test(s.renderAccessibleContent)&&s.renderToSpeakableText){const i=document.createElement("span");i.innerHTML=s.renderToSpeakableText(t,s),i.className="sr-only",e.appendChild(i)}return e.appendChild(a),e}return a}function Li(t,e){let s=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))s=document.createDocumentFragment(),s.appendChild(Ti(t,void 0,e,!0));else{const i=_i(t,e.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;s=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Pi(t,e,s){if(!window)return;if(!s&&window.mathlive&&(s=window.mathlive.config),"amazon"!==(s=s||{}).speechEngine)return void(s.handleSpeak&&s.handleSpeak(e));if(!window.AWS)return;const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:s.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=s.onReadAloudStatus||window.mathlive.onReadAloudStatus;i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),s=new Blob([t.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(s);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const s of window.mathlive.readAloudMarks)s.time0&&Array.from(e.children).forEach(e=>{t(e,s)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=i,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function Bi(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Oi(t,e){Di&&((e=e||{}).renderToMarkup=e.renderToMarkup||zi,e.renderToMathML=e.renderToMathML||Ei,e.renderToSpeakableText=e.renderToSpeakableText||qi,e.macros=e.macros||wt.MACROS,Di.renderMathInElement(Bi(t),e))}function $i(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const Ri={latexToMarkup:zi,latexToMathML:Ei,latexToSpeakableText:qi,latexToAST:function(t,e){if(!Yt.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,wt.MACROS);const s=le.parseTokens(n(t),"math",null,e.macros);return Yt.toAST(s,e)},astToLatex:function(t,e){return hi(t,e)},makeMathField:function(t,e){if(!Ai)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Ii,e.handleReadAloud=e.handleReadAloud||Pi,new Ai.MathField(Bi(t),e)},renderMathInDocument:function(t){Oi(document.body,t)},renderMathInElement:Oi,revertToOriginalContent:function(t,e){(t=(t=Bi(t)).children[1])instanceof Ai.MathField?t.revertToOriginalContent():($i(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Bi(t)).children[1])instanceof Ai.MathField?t.originalContent:($i(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Pi,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let s=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(s=e.time/1e3);let i=window.mathlive.readAloudTokens.indexOf(t);i>=0&&(i+=e,i`|'$%#&^_" ] // but Firefox doesn't support it // (https://bugzilla.mozilla.org/show_bug.cgi?id=1361876). Booo... // See also https://stackoverflow.com/questions/26133593/using-regex-to-match-international-unicode-alphanumeric-characters-in-javascript + +// Edit : https://github.com/arnog/mathlive/issues/195#issuecomment-493741744 const LETTER = - typeof navigator !== 'undefined' && - /firefox|edge/i.test(navigator.userAgent) - ? /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/ - : new RegExp('\\p{Letter}', 'u'); + // typeof navigator !== 'undefined' && /firefox/i.test(navigator.userAgent) ? + /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/; // : + // new RegExp("\\p{Letter}", 'u'); const LETTER_AND_DIGITS = - typeof navigator !== 'undefined' && - /firefox|edge/i.test(navigator.userAgent) - ? /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/ - : new RegExp('[0-9\\p{Letter}]', 'u'); + // typeof navigator !== 'undefined' && /firefox/i.test(navigator.userAgent) ? + /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/; // : + // new RegExp("[0-9\\p{Letter}]", 'u'); export default { matchCodepoint, diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 1ec7f092b..33cee2f52 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,5 +1,5 @@ { - "name": "mathlive", + "name": "@lls/mathlive", "version": "0.34.0", "lockfileVersion": 1, "requires": true, diff --git a/rollup.config.js b/rollup.config.js index 793e215ca..0a7a1dc7d 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -15,6 +15,7 @@ export default [ warnings: true, passes: 2, }, + safari10: true }), copy({ targets: [ From fc950b2859d301f8a5fe572275aa305a4c227420 Mon Sep 17 00:00:00 2001 From: Arnaud CETOUTE Date: Fri, 21 Feb 2020 10:32:29 +0100 Subject: [PATCH 27/28] fix(build): remove dist --- dist/mathlive.core.css | 1 - dist/mathlive.js | 1 - dist/mathlive.mjs | 1 - dist/src/core/definitions.js | 3701 ---------------------------------- 4 files changed, 3704 deletions(-) delete mode 100644 dist/mathlive.core.css delete mode 100644 dist/mathlive.js delete mode 100644 dist/mathlive.mjs delete mode 100644 dist/src/core/definitions.js diff --git a/dist/mathlive.core.css b/dist/mathlive.core.css deleted file mode 100644 index 0f3f2a4ec..000000000 --- a/dist/mathlive.core.css +++ /dev/null @@ -1 +0,0 @@ -.ML__mathlive{line-height:0;direction:ltr;text-align:left;text-indent:0;text-rendering:auto;font-style:normal;font-size-adjust:none;letter-spacing:normal;word-wrap:normal;word-spacing:normal;white-space:nowrap;display:inline-block;text-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:-webkit-min-content;width:-moz-min-content;width:min-content;transform:translateZ(0)}.ML__base{display:inline-block;position:relative;cursor:text}.ML__strut,.ML__strut--bottom{display:inline-block;min-height:1em}.ML__caret:after{content:"";border:none;border-radius:2px;border-right:2px solid var(--caret);margin-right:-2px;position:relative;left:-1px;-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__text-caret:after{content:"";border:none;border-radius:1px;border-right:1px solid var(--caret);margin-right:-1px;position:relative;left:0;-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__command-caret:after{content:"_";border:none;margin-right:-1ex;position:relative;color:var(--caret);-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__text{line-height:1;white-space:pre}.ML__focused .ML__text{background:hsla(var(--hue),40%,50%,.1)}@-webkit-keyframes ML__caret-blink{0%,to{opacity:1}50%{opacity:0}}@keyframes ML__caret-blink{0%,to{opacity:1}50%{opacity:0}}.ML__textarea__textarea{transform:scale(0);resize:none;position:absolute;clip:rect(0 0 0 0);width:1px;height:1px;font-size:16px}.ML__fieldcontainer{display:flex;flex-flow:row;justify-content:space-between;align-items:flex-end;min-height:39px;touch-action:none;width:100%;--hue:212;--highlight:hsl(var(--hue),97%,85%);--caret:hsl(var(--hue),40%,49%);--highlight-inactive:#ccc;--primary:hsl(var(--hue),40%,50%);--secondary:hsl(var(--hue),19%,26%);--on-secondary:hsl(var(--hue),19%,26%)}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__fieldcontainer{--highlight:hsl(var(--hue),40%,49%);--highlight-inactive:hsl(var(--hue),10%,35%);--caret:hsl(var(--hue),97%,85%);--secondary:hsl(var(--hue),25%,35%);--on-secondary:#fafafa}}body[theme=dark] .ML__fieldcontainer{--highlight:hsl(var(--hue),40%,49%);--highlight-inactive:hsl(var(--hue),10%,35%);--caret:hsl(var(--hue),97%,85%);--secondary:hsl(var(--hue),25%,35%);--on-secondary:#fafafa}.ML__fieldcontainer:focus{outline:2px solid var(--primary);outline-offset:3px}.ML__fieldcontainer__field{align-self:center;position:relative;overflow:hidden;line-height:0;padding:2px;width:100%}.ML__virtual-keyboard-toggle{display:flex;align-self:center;align-items:center;flex-shrink:0;flex-direction:column;justify-content:center;width:34px;height:34px;padding:0;margin-right:4px;cursor:pointer;box-sizing:border-box;border-radius:50%;border:1px solid transparent;transition:background .2s cubic-bezier(.64,.09,.08,1);color:var(--primary);fill:currentColor;background:transparent}.ML__virtual-keyboard-toggle:hover{background:hsl(var(--hue),25%,35%);color:#fafafa;fill:currentColor;border-radius:50%;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.ML__popover{visibility:hidden;min-width:160px;background-color:rgba(97,97,97,.95);color:#fff;text-align:center;border-radius:6px;position:fixed;z-index:1;display:flex;flex-direction:column;justify-content:center;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);transition:all .2s cubic-bezier(.64,.09,.08,1)}.ML__popover:after{content:"";position:absolute;top:-5px;left:calc(50% - 3px);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;font-size:1rem;border-bottom:5px solid rgba(97,97,97,.9)}.reverse-direction:after{top:auto;bottom:-5px;border-top:5px solid rgba(97,97,97,.9);border-bottom:0} \ No newline at end of file diff --git a/dist/mathlive.js b/dist/mathlive.js deleted file mode 100644 index aafbdbcc6..000000000 --- a/dist/mathlive.js +++ /dev/null @@ -1 +0,0 @@ -var global,factory;global=this,factory=function(){function t(t,e){e=e||0;const i=t.charCodeAt(e);if(55296<=i&&i<=56319&&e=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return B(i[0],e)}return new L(t,e)}function O(t,e,i){const s=B(e,i);return s.type=t,s}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=$(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"};var wt={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/,LETTER_AND_DIGITS:/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/};const St=N.makeSymbol,At=N.makeSpan,Mt=N.makeVlist;function Ct(t,e,i,s,a,o){const n=St("Size"+i+"-Regular",wt.getValue("math",e)),r=N.makeStyleWrap(t,At(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function _t(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),At(St(e,wt.getValue("math",t)),"delimsizinginner"+i)}function Tt(t,e,i,s,a,o){let n,r,l,c;n=l=c=wt.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(wt.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(wt.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(wt.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(wt.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(_t(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],zt=[0,1.2,1.8,2.4,3],Et=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],qt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Pt(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return Bt(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Dt.includes(e)?Et:Lt.includes(e)?It:qt;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(wt.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=St("AMS-Regular",wt.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Ct(t,e,r.size,s,a,o):Tt(t,e,i,s,a,o)}function Bt(t,e,i){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Ot={makeSizedDelim:function(t,e,i,s,a){return"."===e?Bt(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Lt.includes(e)||Dt.includes(e)?Ct(t,e,i,!1,s,a):Ft.includes(e)?Tt(t,e,zt[i],!1,s,a):null)},makeCustomSizedDelim:Pt,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return Bt(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Pt(t,e,h,!0,a,o)}};const $t=N.makeSpan,Rt=N.makeOrd,Kt=N.makeInner,Nt=N.makeHlist,Wt=N.makeVlist,Ht=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,Vt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Ut={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class jt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Ut[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",Vt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ht.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=Rt(Jt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Wt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(i)+N.depth(i)+o&&(o=(o+l-(N.height(i)+N.depth(i)))/2),r.setTop(r.height-N.height(i)-(o+s));const c=$t(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Wt(t,[i,o,c,s]);if(!this.index)return this.bind(t,Rt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=$t(Jt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Wt(t,[m],"shift",-.6*(u-f));return this.bind(t,Rt([$t(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Jt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,Rt(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=N.skew(i));const a=Math.min(N.height(i),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=$t($t(o),"accent-body"+n);return r=Wt(t,[i,-a,r]),r.children[1].setLeft(2*s),Rt(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Jt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=$t(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Wt(t,[i,3*s,a,s]);else{const e=$t(i);o=Wt(t,[s,a,3*s,e],"top",N.height(e))}return Rt(o,this.position)}decomposeOverunder(t){const e=Jt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?$t(Jt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?$t(Jt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Xt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=$t(Jt(t,this.body),"inner");return Rt([e,$t(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=Rt("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=N.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=N.makeOp(Jt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=Rt(Jt(t,this.body)),i=$t();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=$t([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=Rt(Jt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=$t("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(Array.isArray(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Jt(t.sup(),this.superscript);a=$t(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Jt(t.sub(),this.subscript);o=$t(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-s.metrics.supDrop,l=N.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*i){l=4*i-(r-a.depth)+N.height(o);const t=.8*s.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Wt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,N.height(o)-.8*s.metrics.xHeight),p=Wt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Wt(t,[a],"shift",-r),p.children[0].setRight(d));const m=$t(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?$t(Jt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?$t(Jt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Xt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=N.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Gt(t){const e=$t("​","arraycolsep");return e.setWidth(t,"em"),e}function Zt(t,e,i,s){const a=[];for(const o of e){const e=$t(Jt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Wt(t,a,"individualShift")}function Xt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=$t(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+i;c=Wt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=N.height(e)-i;c=Wt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=N.depth(e)+i;c=Wt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return N.makeSpanOfType(n,c,"op-limits")}function Jt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Ut[t.size]/Ut[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var Yt={MathAtom:jt,decompose:Jt,makeRoot:function(t,e){const i=new jt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new jt("","first")),i},GREEK_REGEX:Ht};const Qt={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},te={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ee=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ie=function(t){let e=t.toUpperCase();for(const t in te)if(te[t]===e){e=t;break}for(const t in Qt)if(Qt[t]===e){e=t;break}return e},se=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ae=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const oe=Yt.MathAtom;class ne{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ee(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new oe("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new oe("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=wt.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new oe(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new oe("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=wt.getInfo("\\"+i.value,"math",this.macros);o=e?[new oe(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new oe(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new oe(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new oe(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=wt.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new oe(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new oe(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ee(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new oe("text",""," ",this.style));else if("placeholder"===t.type)e=new oe(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new oe(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new oe(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=wt.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new oe(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new oe(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new oe(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new oe(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=wt.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new oe(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=wt.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else"#"===t.type&&("?"===t.value?e=this.placeholder():this.args&&(e=this.args[t.value]||this.placeholder()));return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new oe(this.parseMode,"group",re(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var de={pathFromString:he,pathToString:ce,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return he(ce(t)).path}};const pe={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},me={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ue={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function fe(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&wt.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function ge(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function ye(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function be(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===ge("mac")||o===ge("win")||o===ge("ios")||o===ge("android")||o===ge("chromeos")||o===ge("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===ge("mac")||"ios"===ge("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var xe={KEYBOARD_SHORTCUTS:pe,INLINE_SHORTCUTS:ue,stringify:be,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ue).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=fe(t,e,ue[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=fe(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[ge("mac")+":"+t+":"+e,ge("win")+":"+t+":"+e,ge("ios")+":"+t+":"+e,ge("android")+":"+t+":"+e,ge("chromeos")+":"+t+":"+e,ge("other")+":"+t+":"+e,ge("mac")+":"+e,ge("win")+":"+e,ge("ios")+":"+e,ge("android")+":"+e,ge("chromeos")+":"+e,t+":"+e,e])if(pe[i])return pe[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=me[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=ye(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(pe).forEach(t=>{if(i.test(ye(pe[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),be(e)}};function ke(t,e){this.root=Yt.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function ve(t){const e=Object.assign(new ke(t.config,t.target),t);return e.path=de.clone(t.path),e}function we(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ae(t,e){let i;return"object"!=typeof e&&(e=Se(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Ie()),i}function Me(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Ce(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new Yt.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function _e(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ae(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Te(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function Le(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(Le(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||Le(t[i],e)})))return!0;if(t.array)for(let i=Me(t.array);i>=0;i--)if(Le(Ae(t.array,i),e))return!0}return!1}function Fe(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function De(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return ze(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function ze(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Ee(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=ze(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Ee(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=ze(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Ee(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=ze(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Ee(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=ze(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=ze(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=qe(i[1],e),t+=ze(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Ee(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=ze(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=qe(i[1],e),t+=ze(i[2],e),s=!0)),!s)if(i=Ee(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Ee(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+ze(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+ze(i.rest,e):i.match+ze(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+ze(i[2],e),s=!0)),t}function Ee(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=ze(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+ze(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=xe.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function qe(t,e){let i=xe.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Ie(){return new Yt.MathAtom("","first")}ke.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},ke.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new ke;s.path=de.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},ke.prototype.forEach=function(t){this.root.forEach(t)},ke.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},ke.prototype.setRange=function(t,e,i){i=i||{};const s=de.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(de.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(de.clone(t),s)}let a=de.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=de.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},ke.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},ke.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},ke.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},ke.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},ke.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},ke.prototype.insertFirstAtom=function(){this.siblings()},ke.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ae(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Ie()),t},ke.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},ke.prototype.isCollapsed=function(){return 0===this.extent},ke.prototype.setExtent=function(t){this.extent=t},ke.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},ke.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},ke.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&wt.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&wt.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Te(t[e]);)e-=1;for(;Te(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},ke.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},ke.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},ke.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},ke.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},ke.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=Me(e.array);i>=0;i--)t(Ae(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},ke.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},ke.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},ke.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=Me(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ae(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=Me(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},ke.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Se(this.parent().array,i);e=_e(this.parent().array,e,-1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},ke.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Se(this.parent().array,i);e=_e(this.parent().array,e,1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},ke.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=ve(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},ke.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=ve(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},ke.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},ke.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=ve(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},ke.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},ke.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},ke.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=Fe(t.numer),t.denom=Fe(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=Fe(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=Fe(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=Fe(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=Fe(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=Fe(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=Fe(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=Me(t.array);e>=0;e--)this.simplifyParen(Ae(t.array,e))})}},ke.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=De(t,{...this.config,format:"ASCIIMath"}),o=le.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)wt.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new Yt.MathAtom("command","command",e))}else""===t?o=[new Yt.MathAtom("command","command","\\")]:(t=De(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=le.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=le.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=le.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},ke.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=wt.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(wt.RIGHT_DELIM).forEach(e=>{t===wt.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},ke.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},ke.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new Yt.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},ke.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},ke.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},ke.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},ke.prototype.moveToNextPlaceholder_=function(){this.leap(1)},ke.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},ke.prototype.moveToNextChar_=function(){this.move(1)},ke.prototype.moveToPreviousChar_=function(){this.move(-1)},ke.prototype.moveUp_=function(){this.up()},ke.prototype.moveDown_=function(){this.down()},ke.prototype.moveToNextWord_=function(){this.skip(1)},ke.prototype.moveToPreviousWord_=function(){this.skip(-1)},ke.prototype.moveToGroupStart_=function(){this.setSelection(0)},ke.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},ke.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},ke.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},ke.prototype.deleteNextChar_=function(){this.delete_(1)},ke.prototype.deletePreviousChar_=function(){this.delete_(-1)},ke.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},ke.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},ke.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},ke.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},ke.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},ke.prototype.transpose_=function(){},ke.prototype.extendToNextChar_=function(){this.extend(1)},ke.prototype.extendToPreviousChar_=function(){this.extend(-1)},ke.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendUp_=function(){this.up({extend:!0})},ke.prototype.extendDown_=function(){this.down({extend:!0})},ke.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},ke.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},ke.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},ke.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},ke.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Ie()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Ie()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},ke.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Ie()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Ie()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},ke.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Ie()]),this.setSelection(0,"end",t)},ke.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},ke.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=ve(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},ke.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Se(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=we(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},ke.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=wt.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},ke.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},ke.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},ke.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},ke.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},ke.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Pe={EditableMathlist:ke,parseMathString:De};const Be={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Oe={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},$e={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Re(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=$e[t.target.value]||t.target.value),e||(Be[t.key]?(e=Be[t.key],i=!1):e=Oe[t.key],e||(e=$e[t.key.toLowerCase()])),!e&&t.code&&(e=Oe[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function Ke(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke(Re(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke(Re(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var Ne={delegateKeyboardEvents:Ke,select:Ke.select,keyboardEventToString:Re,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const We={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},He={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function Ve(t){let e=He[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ue(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&je(t,i),t.popover.classList.add("is-visible")}function je(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Ge(t){t.popover.classList.remove("is-visible")}var Ze={getNote:Ve,SAMPLES:We,NOTES:He,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Ge(t);const s=e,a=function(t,e){const i=le.parseTokens(n(t),"math",null,e.config.macros),s=Yt.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=N.makeSpan(s,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(We[s]||e,t),o=Ve(s),r=xe.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ue(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ue,hidePopover:Ge,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&je(e,t)}else Ge(e)}};function Xe(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else if("mode"===e)for(;t[s]&&t[s][e]===i;)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Xe(this,this.array[s][e],t);s1&&(i+=" "),i+=Xe(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Xe(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Xe(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Xe(this,this.shift,t)}em]`),i+=`{${Xe(this,this.width,t)}em}{${Xe(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Xe(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Xe(this,this.overscript||this.underscript,t)}}{${Xe(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Xe(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Xe(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Xe(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ie(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Xe(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Xe(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ie(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ie(this.backgroundcolor)}}`),i+=`{${Xe(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ie(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ie(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Xe(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Xe(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Xe(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Je.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Je.locale.substring(0,2),a="ordinal"===i.type?Je.ordinal:Je.cardinal;let o,n="ordinal"===i.type?Je._ordinalPluralCategories.indexOf(a.select(t)):Je._cardinalPluralCategories.indexOf(a.select(t));return Je.strings[Je.locale]&&(o=Je.strings[Je.locale][e]),!o&&Je.strings[s]&&(o=Je.strings[s][e]),o||(o=Je.strings.en[e],o||(o=e),n="ordinal"===i.type?Je._ordinalPluralCategories.indexOf(Je._ordinalEnglish.select(t)):Je._cardinalPluralCategories.indexOf(Je._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Je.merge=function(t,e){if(t&&e){const i=Je._locale;Je.locale=t,Je.strings[t]={...Je.strings[t],...e},Je.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Je.merge(t,e[t])))},Object.defineProperty(Je,"locale",{set(t){Je._locale=t,Je._ordinal=null,Je._cardinal=null},get:()=>(Je._locale||(Je._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Je._locale)}),Object.defineProperty(Je,"ordinal",{get:()=>(Je._ordinal||(Je._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Je._ordinalEnglishPluralCategories=Je._ordinalEnglish.resolvedOptions().pluralCategories,Je._ordinal=new Intl.PluralRules(Je.locale,{type:"ordinal"}),Je._ordinalPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._ordinal)}),Object.defineProperty(Je,"cardinal",{get:()=>(Je._cardinal||(Je._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Je._cardinalEnglishPluralCategories=Je._cardinalEnglish.resolvedOptions().pluralCategories,Je._cardinal=new Intl.PluralRules(Je.locale,{type:"cardinal"}),Je._cardinaPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._cardinal)}),Je.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const Ye={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},Qe={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ti={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let ei={};const ii={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function si(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=le.parseTokens(n(t),"math",e,i.config.macros),a=Yt.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ai(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},Ye,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function oi(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&Qe[n]&&(a.setAttribute("data-shifted",Qe[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",Qe[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=ei[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function ni(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ri={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ti["foreground-color"]=[];for(const t of ae)ti["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ti["background-color"]=[];for(const t of se)ti["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});ei={...ti},Object.keys(ei).forEach(t=>{ei[t]=ei[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];ei[e]||(ei[e]=[]),ei[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),ei[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),ei[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),ei[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),ei[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),ei[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),ei[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),ei[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),ei[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),ei[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),ei[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];ei[e]||(ei[e]=[]),ei[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),ei[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),ei[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),ei[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];ei[e]||(ei[e]=[]),ei[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),ei[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),ei[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),ei[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),ei[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ii,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},Ye,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ai(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=ni(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,oi(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:oi};const li={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},ci={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},hi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function di(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function pi(t,e){return t&&e.generateID?' extid="'+t+'"':""}function mi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,ui(t)&&(n=t.index,t.index+=1),fi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=vi(t.atoms[r].subscript,0,0,i).mathML,a+=vi(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,ui(t)){const e=vi(t.atoms[n].superscript,0,0,i).mathML,s=vi(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=vi(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=vi(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function ui(t){return t.index"+t,a+=vi(o.subscript,0,0,i).mathML,a+=vi(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=vi(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=vi(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function yi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function bi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&ui(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=vi(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function xi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=wi(t.atoms[l],i),a+=vi(t.atoms,l+1,c,i).mathML,a+=wi(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,gi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=vi(n.subscript,0,0,i).mathML,a+=vi(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=vi(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=vi(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Si(e.body)+"":wi(e,i);a+=r,t.index+=1,gi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function vi(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function wi(t,e){let i="";const s=Si(t.body);return s&&(i=""+s+""),i}function Si(t){if(!t)return"";if("string"==typeof t)return di(t);if(!Array.isArray(t)&&"string"==typeof t.body)return di(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return di(e)}Yt.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=vi(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(hi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+vi(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(hi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=vi(this.numer,0,0,t).mathML||" ",c+=vi(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+vi(this.numer,0,0,t).mathML+"",c+=""+vi(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=vi(this.body,0,0,t).mathML,c+=vi(this.index,0,0,t).mathML,c+=""):(c+="",c+=vi(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=vi(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(hi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=vi(this.body,0,0,t).mathML,c+=""+(hi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+vi(l,0,0,t).mathML,c+=vi(n,0,0,t).mathML,c+=vi(r,0,0,t).mathML,c+=""):r?(c+=""+vi(l,0,0,t).mathML,c+=vi(r,0,0,t).mathML,c+=""):n&&(c+=""+vi(l,0,0,t).mathML,c+=vi(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+pi(this.id,t)+">"+di(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&hi[p]?""+hi[p]+"":wi(this,t);break;case"mpunct":c='"+(hi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+vi(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+vi(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},Yt.toMathML=function(t,e){return vi(t,0,0,e).mathML};const Ai={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},Mi={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ci={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},_i={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Ti(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Li(t){return t&&_i[t]||-1}function Fi(t){return/=|=>/.test(t)?"right":"left"}function Di(t){if("f"===t||"g"===t)return!0;const e=Ci[t];return!!e&&!!/%[^01_^]?/.test(e)}function zi(t){t=(t||"").trim();let e=Ai[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=wt.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Ei(t){if(!t)return null;const e=zi($i(t)),i=[Li(e),Fi(e)];return i[0]<=0?null:i}function qi(t){return null!==Ei(t)}const Ii={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Pi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Bi={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Oi={",":"list",";":"list2"};function $i(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const i of t)e+=$i(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=$i(i);return e}return""}function Ri(t){return"string"==typeof t.sym?function(t){let e=Ci[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=wt.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=wt.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Ki(t){return parseFloat(t.num)}function Ni(t){return"object"==typeof t&&void 0!==t.num}function Wi(t){let e=0;return Ni(t)&&(e="object"==typeof t.num?void 0!==t.num.re?ls(t.num.re):0:parseFloat(t.num)),e}function Hi(t){let e=0;return Ni(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?ls(t.num.im):0),e}function Vi(t){return t&&void 0!==t.sup}function Ui(t){return t&&void 0!==t.sub}function ji(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||$i(a)===i),s}function Gi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Zi(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Xi(t){if(Ni(t)){const e=Wi(t),i=Hi(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Gi("negate",t)}function Ji(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function Yi(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=os(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test($i(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test($i(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test($i(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=os(i.superscript,e)):t.ast.sup=os(i.superscript,e))):t.index+=1,t}function Qi(t,e){const i=t.ast;if(es(t,"!!"))return t.index+=1,t.ast=Gi("factorial2",i),Qi(t=Yi(t,e),e);if(es(t,"++"))return t.index+=1,t.ast=Gi("increment",i),Qi(t=Yi(t,e),e);if(es(t,"--"))return t.index+=1,t.ast=Gi("decrement",i),Qi(t=Yi(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Pi[s.latex.trim()]&&(t.ast=Gi(Pi[s.latex.trim()],i),t=Qi(t=Yi(t,e),e)),t}function ts(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&$i(o)===e)t.index+=1,o=(t=ss(t,s)).atoms[t.index],o&&"mclose"===o.type&&$i(o)===i&&(Ji(t)&&(t.ast={group:t.ast}),t=Qi(t=Yi(t,s),s));else if("textord"===o.type&&$i(o)===e)t.index+=1,o=(t=ss(t,s)).atoms[t.index],o&&"textord"===o.type&&$i(o)===i&&(t.index+=1,t=Qi(t=Yi(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=ss(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=Qi(t=Yi(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=ss(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=Qi(t=Yi(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=os(o.body,s),Ji(t)&&(t.ast={group:t.ast}),t=Qi(t=Yi(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=wt.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=wt.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=wt.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=wt.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=ts(t,e,i))return s&&(t.index+=1),t.ast={fn:Ii[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function es(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===$i(t.atoms[t.index])+$i(t.atoms[t.index+1])}function is(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!ji(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,ji(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):ji(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function ss(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=zi($i(s));if(is(e))e.ast=Gi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Xi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Gi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>as(t)))),e=[t])}return e}function os(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=ss(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Gi("text",...i):i[0]||void 0}({atoms:as(t)},e)}function ns(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function rs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function ls(t){return parseFloat(parseFloat(t).toPrecision(15))}function cs(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=rs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=rs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=rs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=ls(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=rs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=rs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}Yt.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=le.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=le.parseTokens(n(s),"math",null,t.macros),o=Gi("divide",os(i,t),os(s,t))):o.fn="divide"):o.group=os(this.body,t);break;case"genfrac":o=Gi("divide",os(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Zi(1):os(this.denom,t));break;case"surd":o=this.index?Gi("pow",os(this.body,t),Gi("divide",Zi(1),os(this.index,t))):Gi("sqrt",os(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=zi($i(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=wt.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=os(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Gi("card",os(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>os(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(os(e[0],t));let s=os(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},Yt.toAST=function(t,e){return os(t,e)};var hs=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Ni(e)){const i=Ki(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":cs(e.num,s);else{const t=Wi(e),i=Hi(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=cs(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?cs(i,s):"")+"\\imaginaryI "))}Vi(e)&&(a+="^{"+t(e.sup,s)+"}"),Ui(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Ni(e.group)||Ri(e.group)?0!==Hi(e.group)&&(a=ns(e.fence||"(),",a)):a=ns(e.fence||"(),",a),Vi(e)&&(a+="^{"+t(e.sup,s)+"}"),Ui(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Ti(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Ti(e,1));else{let i="";for(let s=1;s=2)a=t(Ti(e,0),s),Ni(Ti(e,0))||Ri(Ti(e,0))||(a=ns(e.fence||"(),",a)),a+="^{"+t(Ti(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ci[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ns(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Ti(e,0),s),r=t(Ti(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ns(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ns(e.fence||"(),","");a=Vi(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Ui(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ns("() ",t(a,s))):0!==Wi(o=a)&&0!==Hi(o)?i.push(ns("() ",t(a,s))):Vi(e)&&0!==Hi(a)&&1!==Hi(a)?i.push(ns("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Ni(e.arg[0])&&"divide"!==e.arg[0].fn||Ni(e.arg[1])&&(0!==Wi(e.arg[1])||1!==Hi(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Ni(e.arg[0])&&Ki(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function ps(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function ms(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function us(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function fs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function gs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function ys(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function bs(t){return t.element&&t.element.mathfield===t}Yt.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=Yt.toSpeakableFragment(t.body,e),t.index){let i=Yt.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else ps(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ds[t.leftDelim]||t.leftDelim,s+=Yt.toSpeakableFragment(t.body,e),s+=ds[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=Yt.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ds[a]||(o?ds[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Ze.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=Yt.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=Yt.toSpeakableFragment(t.superscript,e);i=i.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=Yt.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=Yt.toSpeakableFragment(t.superscript,e);i=i.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=Yt.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=Yt.toSpeakableFragment(t.superscript,e);a=a.trim();let o=Yt.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ds[t.body]||ds[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=Yt.toSpeakableFragment(t.body,e),ps(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=Yt.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(ps(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=Yt.toSpeakableFragment(t.subscript,e);i=i.trim(),ps(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},Yt.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=Yt.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=Yt.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class xs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=gs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=gs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,us(this.element,"focus",this),us(this.element,"blur",this),us(this.textarea,"cut",this),us(this.textarea,"copy",this),us(this.textarea,"paste",this),Ne.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?us(this.field,"pointerdown",this):us(this.field,"touchstart:active mousedown",this),us(window,"resize",this);const o={...e};o.onSelectionDidChange=xs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=xs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Pe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>bs(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,fs(this.textarea,"cut",this),fs(this.textarea,"copy",this),fs(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,ys(this.popover),ys(this.keystrokeCaption),ys(this.virtualKeyboard),ys(document.getElementById("mathlive-alternate-keys-panel")),fs(this.element,"pointerdown",this),fs(this.element,"touchstart:active mousedown",this),fs(this.element,"focus",this),fs(this.element,"blur",this),fs(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=de.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1;const r=this.field.querySelector(".ML__mathlive").getBoundingClientRect();if(i=d>r.right?[{relation:"body",offset:this.mathlist.root.body.length-1}]:this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=de.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||vs>2?(n(t),3!==t.detail&&3!==vs||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(us(e.field,"pointermove",h),us(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(us(window,"blur",n),t.touches?(us(t.target,"touchmove",h),us(t.target,"touchend",n)):(us(window,"mousemove",h),us(window,"mouseup",n))),2!==t.detail&&2!==vs||(a=!0,this.mathlist.selectGroup_()))}}else ks=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Ze.hidePopover(this),this.mathlist.removeCommandString())}Ze.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return ws(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=ws(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Ze.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Ze.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(xe.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);0===e.length?Ze.hidePopover(this):Ze.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=Ne.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=xe.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(Ne.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=Ne.charToEvent(e);if(!this.$keystroke(Ne.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=wt.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Ze.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Ze.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;ibs(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),e+=1,t=this.mathlist.ancestor(e)}const i=Yt.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=N.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+Yt.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=Yt.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=Yt.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=li[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&li[a]?li[a]:a&&ci[a]?ci[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=ci[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=Yt.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Ze.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Ze.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(wt.commandAllowed(t,e)){const i=le.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=le.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);if(0===e.length)Ze.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Ze.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),us(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),us(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),us(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ri.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",ys(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=Yt.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ks,vs=0;function ws(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+Yt.toSpeakableText(i,s)}function Ss(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=ws(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=ws(t,"",t.mathlist.sibling(0)):"line"===e?(a=ws(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+Yt.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?ws(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}xs.prototype.undo_=xs.prototype.undo,xs.prototype.redo_=xs.prototype.redo,xs.prototype.scrollIntoView_=xs.prototype.scrollIntoView,xs.prototype.scrollToStart_=xs.prototype.scrollToStart,xs.prototype.scrollToEnd_=xs.prototype.scrollToEnd,xs.prototype.insert_=xs.prototype.$insert;var As={isValidMathfield:bs,MathField:xs};function Ms(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=Ms(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ls(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Ts(t,void 0,e,!0));else{const s=_s(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Ps(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function Bs(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Os(t,e){Ds&&((e=e||{}).renderToMarkup=e.renderToMarkup||zs,e.renderToMathML=e.renderToMathML||Es,e.renderToSpeakableText=e.renderToSpeakableText||qs,e.macros=e.macros||wt.MACROS,Ds.renderMathInElement(Bs(t),e))}function $s(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}return{latexToMarkup:zs,latexToMathML:Es,latexToSpeakableText:qs,latexToAST:function(t,e){if(!Yt.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,wt.MACROS);const i=le.parseTokens(n(t),"math",null,e.macros);return Yt.toAST(i,e)},astToLatex:function(t,e){return hs(t,e)},makeMathField:function(t,e){if(!As)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Is,e.handleReadAloud=e.handleReadAloud||Ps,new As.MathField(Bs(t),e)},renderMathInDocument:function(t){Os(document.body,t)},renderMathInElement:Os,revertToOriginalContent:function(t,e){(t=(t=Bs(t)).children[1])instanceof As.MathField?t.revertToOriginalContent():($s(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Bs(t)).children[1])instanceof As.MathField?t.originalContent:($s(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Ps,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s=1){const i=t.charCodeAt(e-1),a=s;return 55296<=i&&i<=56319?1024*(i-55296)+(a-56320)+65536:a}return s}function e(e,i){if((i=i||0)<0)return 0;if(i>=e.length-1)return e.length;let a=s(t(e,i));for(let r=i+1;r=this.s.length}get(){return this.pos="0"&&s<="9"?parseInt(s):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],s=t.toString().split(/\r?\n/);let i="",a="";for(const t of s){i+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(i+=e[0])}const n=new o(i);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,s){if("string"==typeof t){const s=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);s?(t=parseFloat(s[1]),e=s[2].toLowerCase()):t=parseFloat(t)}const i={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(s)){const e=Math.pow(10,s);return Math.round(t/h.ptPerEm*i*e)/e}return t/h.ptPerEm*i}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const s={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let i=t.charCodeAt(0);t[0]in d?i=d[t[0]].charCodeAt(0):l.test(t[0])&&(i=77);const a=r[s][i];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,s,i){this.id=t,this.size=e,this.cramped=i,this.sizeMultiplier=s,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const s of t)e+=T(s);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,s=1;this.children&&this.children.forEach(i=>{i.height>t&&(t=i.height),i.depth>e&&(e=i.depth),i.maxFontSize>s&&(s=i.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=s}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let s="Main-Regular";if(e&&(s=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&s){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=s)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let s="",i=this.body||"";if(this.children){let t="none";for(const s of this.children){let a=0;if(t){let i=s.type;i&&("textord"===i&&(i="mord"),"first"===i&&(i="none"),a=s.isTight?E[t+"+"+i]||0:F[t+"+"+i]||0,a=Math.floor(e*a))}i+=s.toMarkup(a,e),t=q(s)}}if("​"!==i&&i||this.classes&&"ML__selected"!==this.classes){if(s="1?e.filter((function(t,e,s){return t.length>0&&s.indexOf(t)===e})).join(" "):e[0],a.length>0&&(s+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?i=z[-t]+i:D[t]?i=D[t]+i:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const s in this.style)Object.prototype.hasOwnProperty.call(this.style,s)&&("background-color"===s&&e||(t+=s+":"+this.style[s]+";"));t.length>0&&(s+=' style="'+t+'"')}s+=">",this.svgOverlay?(s+='",s+=""):s+=i,s+=""}else s="";return this.caret&&"command"!==this.type&&("text"===this.caret?s+='':s+=''),s}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,s=t.children&&t.children.length>0;if(e||s)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==a.length)return!1;i.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const s=[];for(const e of t)e&&s.push(e);if(1===s.length)return B(s[0],e)}return new L(t,e)}function O(t,e,s){const i=B(e,s);return i.type=t,i}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const s=new L(t,e);let i=1;return i=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),s.height*=i,s.depth*=i,s}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const s=[e[0]];for(let i=1;i0?"em":""),i.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(i,"fontsize-ensurer reset-"+t.size+" size5"):0!==s?i:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,s,i,a){a=a||"";const o=$(e,(a+=" style-wrap ")+s.adjustTo(i));o.type=t;const n=i.sizeMultiplier/s.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=i.sizeMultiplier,o},makeSVG:function(t,e,s){return t.svgOverlay=e,t.svgStyle=s,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const s of t)e+=s.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const s="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=s),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=s)}function Y(t,e,s,i,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:s===rt?lt:s,baseFontFamily:e,value:i,category:W,frequency:a}}function Q(t,e){for(let s=t;s<=e;s++){const t=String.fromCodePoint(s);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const s=String.fromCodePoint(e);if("math"===t&&tt[s])return tt[s];if(e>32&&e<127)return s;let i="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===s){i=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===s){i=t;break}return i||s}const st={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},it=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in st)if(Object.prototype.hasOwnProperty.call(st,t)&&st[t]===e){e=t;break}for(let t=0;t=it[t].start&&et.body).join("")}function yt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a=ft(e),o={category:W,params:a,parser:i,mathstyle:"displaystyle",tabular:s.tabular||!0,colFormat:s.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a={category:W,baseFontFamily:s.fontFamily,params:ft(e),allowedInText:!!s.allowedInText,infix:!!s.infix,parse:i};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,s){let i=0;for(const t of s)i=Math.max(i,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let s=e[0]||[];const i={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)i.strokeWidth=m.toPx(t[1],"px"),isFinite(i.strokeWidth)||(i.strokeWidth=1),i.strokeStyle=t[2],i.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?i.backgroundcolor=t[2]:"mathcolor"===t[1]?i.strokeColor=t[2]:"padding"===t[1]?i.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(i.shadow=t[2]))}}"dashed"===i.strokeStyle?i.svgStrokeStyle="5,5":"dotted"===i.strokeStyle&&(i.svgStrokeStyle="1,5")}i.borderStyle=i.strokeWidth+"px "+i.strokeStyle+" "+i.strokeColor,s=s.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),i.notation={};for(const t of s)i.notation[t]=!0;return i.notation.updiagonalarrow&&(i.notation.updiagonalstrike=!1),i.notation.box&&(i.notation.left=!1,i.notation.right=!1,i.notation.bottom=!1,i.notation.top=!1),i})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const s={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":s.hasBarLine=!0;break;case"\\\\atopfrac":s.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s.hasBarLine=!1,s.leftDelim="(",s.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":s.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":s.mathstyle="textstyle"}return"\\cfrac"===t&&(s.continuousFraction=!0),s})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const s=e[0],i=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:s,denom:i,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let s=parseInt(e[0]);return isFinite(s)||(s=10067),{type:"mord",body:String.fromCodePoint(s)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",s=!0;for(const i of t)"string"==typeof i.body?e+=i.body:s=!1;return s?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const s={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(s.limits="nolimits",s.isFunction=!0),s})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const s={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return s.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?s.limits="nolimits":"\\operatorname*"===t&&(s.limits="limits"),s})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"};var wt={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,s){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!s)return t;const i=t.codePointAt(0);for(let t=0;t=it[t].offset&&i=1;)i.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?i=H[t]:vt[t]&&(i={value:vt[t]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const s in V)Object.prototype.hasOwnProperty.call(V,s)&&s.startsWith(t)&&!V[s].infix&&e.push({match:s,frequency:V[s].frequency});for(const s in H)Object.prototype.hasOwnProperty.call(H,s)&&s.startsWith(t)&&e.push({match:s,frequency:H[s].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/,LETTER_AND_DIGITS:/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/};const St=N.makeSymbol,At=N.makeSpan,Mt=N.makeVlist;function Ct(t,e,s,i,a,o){const n=St("Size"+s+"-Regular",wt.getValue("math",e)),r=N.makeStyleWrap(t,At(n,"delimsizing size"+s),a.mathstyle,M.TEXT,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function _t(t,e){let s="";return"Size1-Regular"===e?s=" delim-size1":"Size4-Regular"===e&&(s=" delim-size4"),At(St(e,wt.getValue("math",t)),"delimsizinginner"+s)}function Tt(t,e,s,i,a,o){let n,r,l,c;n=l=c=wt.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(wt.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(wt.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(wt.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(wt.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((s-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;i&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(_t(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],zt=[0,1.2,1.8,2.4,3],Et=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],qt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Pt(t,e,s,i,a,o){if(!e||0===e.length||"."===e)return Bt(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Dt.includes(e)?Et:Lt.includes(e)?It:qt;const r=function(t,e,s,i){for(let o=Math.min(2,3-i.mathstyle.size);oe)return s[o]}var a;return s[s.length-1]}(wt.getValue("math",e),s,n,a);return"small"===r.type?function(t,e,s,i,a,o){const n=St("AMS-Regular",wt.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,s,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier/s.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,i,a,o):"large"===r.type?Ct(t,e,r.size,i,a,o):Tt(t,e,s,i,a,o)}function Bt(t,e,s){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(s||""))}var Ot={makeSizedDelim:function(t,e,s,i,a){return"."===e?Bt(t,i,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Lt.includes(e)||Dt.includes(e)?Ct(t,e,s,!1,i,a):Ft.includes(e)?Tt(t,e,zt[s],!1,i,a):null)},makeCustomSizedDelim:Pt,makeLeftRightDelim:function(t,e,s,i,a,o){if("."===e)return Bt(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=i+n,c=s-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Pt(t,e,h,!0,a,o)}};const $t=N.makeSpan,Rt=N.makeOrd,Kt=N.makeInner,Nt=N.makeHlist,Wt=N.makeVlist,Ht=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,Vt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Ut={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class jt{constructor(t,e,s,i){this.mode=t,this.type=e,this.body=s,this.applyStyle(i)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Ut[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",Vt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ht.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const s of e)for(const e of s)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const s of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[s]))for(const i of this[s])i&&(e=e.concat(i.filter(t)));if(Array.isArray(this.array))for(const s of this.array)for(const i of s)i&&(e=e.concat(i.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),s=Rt(Jt(e,this.body));return this.cssId&&(s.cssId=this.cssId),s.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),s}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const s=[];let i=0;for(const t of e)t.align&&i++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Wt(t,s,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const s of e){if(s.align&&b>=u.length)break;if(s.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(s)+N.depth(s)+o&&(o=(o+l-(N.height(s)+N.depth(s)))/2),r.setTop(r.height-N.height(s)-(o+i));const c=$t(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=i;const d=Wt(t,[s,o,c,i]);if(!this.index)return this.bind(t,Rt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=$t(Jt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Wt(t,[m],"shift",-.6*(u-f));return this.bind(t,Rt([$t(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let s=Jt(t.cramp(),this.body);(this.superscript||this.subscript)&&(s=this.attachSupsub(t,Rt(s),"mord"));let i=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(i=N.skew(s));const a=Math.min(N.height(s),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=$t($t(o),"accent-body"+n);return r=Wt(t,[s,-a,r]),r.children[1].setLeft(2*i),Rt(r,"accent")}decomposeLine(t){const e=t.mathstyle,s=Jt(t.cramp(),this.body),i=h.defaultRuleThickness/e.sizeMultiplier,a=$t(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=i,a.maxFontSize=1,"overline"===this.position)o=Wt(t,[s,3*i,a,i]);else{const e=$t(s);o=Wt(t,[i,a,3*i,e],"top",N.height(e))}return Rt(o,this.position)}decomposeOverunder(t){const e=Jt(t,this.body),s=t.clone({mathstyle:"scriptstyle"}),i=this.overscript?$t(Jt(s,this.overscript),t.mathstyle.adjustTo(s.mathstyle)):null,a=this.underscript?$t(Jt(s,this.underscript),t.mathstyle.adjustTo(s.mathstyle)):null;return Xt(t,e,0,0,i,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=$t(Jt(t,this.body),"inner");return Rt([e,$t(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,s=Rt("","rule");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return s.setStyle("border-right-width",a,"em"),s.setStyle("border-top-width",o,"em"),s.setStyle("margin-top",-(o-i),"em"),s.setStyle("border-color",t.color),s.width=a,s.height=o+i,s.depth=-i,s}decomposeOp(t){const e=t.mathstyle;let s,i=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(i=!0);let a=0,o=0;if(this.symbol){const n=i?"Size2-Regular":"Size1-Regular";s=N.makeSymbol(n,this.body,"op-symbol "+(i?"large-op":"small-op")),s.type="mop",a=(s.height-s.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=s.italic,this.bind(t,s)}else Array.isArray(this.body)?(s=N.makeOp(Jt(t,this.body)),this.bind(t,s)):s=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const i=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===i||"auto"===i&&e.size===M.DISPLAY.size?this.attachLimits(t,s,a,o):this.attachSupsub(t,s,"mop")}return this.symbol&&s.setTop(a),s}decomposeBox(t){const e=Rt(Jt(t,this.body)),s=$t();s.setStyle("position","absolute");const i="number"==typeof this.padding?this.padding:h.fboxsep;s.setStyle("height",e.height+e.depth+2*i,"em"),0!==i?s.setStyle("width","calc(100% + "+2*i+"em)"):s.setStyle("width","100%"),s.setStyle("top",-i,"em"),s.setStyle("left",-i,"em"),s.setStyle("z-index","-1"),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.framecolor&&s.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&s.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+i,"em");const a=$t([s,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-i+e.depth,"em"),a.height=e.height+i,a.depth=e.depth+i,a.setLeft(i),a.setRight(i),a}decomposeEnclose(t){const e=Rt(Jt(t,this.body)),s="auto"===this.padding?.2:this.padding;e.setStyle("padding",s,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-s,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let i="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(i+='0?s.setWidth(this.width):s.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";s=$t("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?s=this.decomposeBox(t):"enclose"===this.type?s=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(s=this.makeSpan(t,this.body),s.classes="",this.error&&(s.classes+=" ML__error"),this.suggestion&&(s.classes+=" ML__suggestion")):"placeholder"===this.type?s=this.makeSpan(t,"⬚"):"first"===this.type&&(s=this.makeSpan(t,"​"));if(!s)return s;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(s)?s[s.length-1].caret=this.caret:s.caret=this.caret),this.containsCaret&&(Array.isArray(s)?(s[0].classes=(s[0].classes||"")+" ML__contains-caret",s[s.length-1].classes=(s[s.length-1].classes||"")+" ML__contains-caret"):s.classes=(s.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(s)){const e=s[s.length-1];s[s.length-1]=this.attachSupsub(t,e,e.type)}else s=[this.attachSupsub(t,s,s.type)];return Array.isArray(s)?s:[s]}attachSupsub(t,e,s){if(!this.superscript&&!this.subscript)return e;const i=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Jt(t.sup(),this.superscript);a=$t(e,i.adjustTo(i.sup()))}if(this.subscript){const e=Jt(t.sub(),this.subscript);o=$t(e,i.adjustTo(i.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-i.metrics.supDrop,l=N.depth(e)+i.metrics.subDrop),n=i===M.DISPLAY?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const c=M.TEXT.sizeMultiplier*i.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const s=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*s){l=4*s-(r-a.depth)+N.height(o);const t=.8*i.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Wt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,i.metrics.sub1,N.height(o)-.8*i.metrics.xHeight),p=Wt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),p=Wt(t,[a],"shift",-r),p.children[0].setRight(d));const m=$t(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(s,[e,m])}attachLimits(t,e,s,i){const a=this.superscript?$t(Jt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?$t(Jt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Xt(t,e,s,i,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const s="textord"===this.type?"mord":this.type,i=N.makeSpanOfType(s,e),a=this.getStyle();i.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+o):t.parentSize!==t.size&&(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+t.size),i.maxFontSize=Math.max(i.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(i.classes+=" ML__text"),t.mathstyle.isTight()&&(i.isTight=!0),"math"!==this.mode&&(i.italic=0),i.setRight(i.italic),"number"==typeof t.opacity&&i.setStyle("opacity",t.opacity),this.bind(t,i),this.caret&&(this.superscript||this.subscript||(i.caret=this.caret,t.mathstyle.isTight()&&(i.isTight=!0))),i}}function Gt(t){const e=$t("​","arraycolsep");return e.setWidth(t,"em"),e}function Zt(t,e,s,i){const a=[];for(const o of e){const e=$t(Jt(t,i));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-s)}return Wt(t,a,"individualShift")}function Xt(t,e,s,i,a,o,n){if(!a&&!o)return e;e=$t(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+s;c=Wt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-i),c.children[2].setLeft(i)}else if(o&&!a){const a=N.height(e)-s;c=Wt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-i)}else if(!o&&a){const o=N.depth(e)+s;c=Wt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(i)}return N.makeSpanOfType(n,c,"op-limits")}function Jt(t,e){function s(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function i(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Ut[t.size]/Ut[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var Yt={MathAtom:jt,decompose:Jt,makeRoot:function(t,e){const s=new jt(t=t||"math","root",e||[]);return 0!==s.body.length&&"first"===s.body[0].type||s.body.unshift(new jt("","first")),s},GREEK_REGEX:Ht};const Qt={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},te={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ee=function(t){const e=t.toLowerCase().split("!");let s,i,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*s,n=(1-l)*n+l*i,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*s,n=l*n+(1-l)*i,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},se=function(t){let e=t.toUpperCase();for(const t in te)if(te[t]===e){e=t;break}for(const t in Qt)if(Qt[t]===e){e=t;break}return e},ie=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ae=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const oe=Yt.MathAtom;class ne{constructor(t,e,s){this.tokens=t,this.index=0,this.args=e,this.macros=s,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===i.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ee(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let s=10,i=/[0-9]/;this.parseLiteral("'")?(s=8,i=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(s=16,i=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(i);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(i);)a+=this.get().value;const o=t?parseInt(a,s):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),s=new oe("math","group");return s.mathstyle=")"===t?"textstyle":"displaystyle",s.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),s.body&&0!==s.body.length?s:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new oe("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const s=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(s),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=wt.getEnvironmentInfo(t),s=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else s.push(this.scanArg(t.type));const i=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new oe(this.parseMode,"array",h,e.parser?e.parser(t,s,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let s=null,i=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new oe("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!s?(s=this.get(),i=this.swapMathList([])):this.parseAtom();let o;if(s){const t=this.swapMathList(a),e=wt.getInfo("\\"+s.value,"math",this.macros);o=e?[new oe(this.parseMode,e.type,e.value||s.value,e.parse?e.parse("\\"+s.value,[i,t]):null)]:[new oe(this.parseMode,"mop",s.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new oe(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new oe(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let s=1;for(;!this.end()&&0!==s;)this.hasLiteral("(")&&(s+=1),this.hasLiteral(")")&&(s-=1),0!==s&&this.parseAtom();return 0===s&&this.parseLiteral(")"),t.rightDelim=0===s?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const s=wt.getInfo(e,"math",this.macros);return s?"mopen"===s.type||"mclose"===s.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const s=this.scanDelim();if(!s)return null;const i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new oe(this.parseMode,"leftright");return o.leftDelim=s,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(i),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const s=this.scanArg();if(s){const i=this.lastMathAtom();i[e]=i[e]||[],i[e]=i[e].concat(s),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new oe(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const s=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)i=this.scanString();else if("number"===t)i=this.scanNumber();else if("dimen"===t)i=this.scanDimen();else if("skip"===t)i=this.scanSkip();else if("colspec"===t)i=this.scanColspec();else if("color"===t)i=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ee(e);if(t)i=i||{},i.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)i=i||{},i.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(i=i||{},i.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(s);return i||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const s=this.scanToken();return this.parseMode=e,Array.isArray(s)?s:s?[s]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const s=this.parseMode;this.parseMode=t;const i=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=s;const a=this.swapMathList(i);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new oe("text",""," ",this.style));else if("placeholder"===t.type)e=new oe(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new oe(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const s=this.scanSkip();isFinite(s)&&(e=new oe(this.parseMode,"spacing",null,this.style),e.width=s),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const s=wt.getInfo("\\"+t.value,this.parseMode,this.macros),i=[];let a="",o="";if(s&&s.params)for(const t of s.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)i.push(e);else if(t.placeholder){const e=new oe(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,i.push([e])}else i.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(s&&!s.infix){if(s.parse){const a=s.parse("\\"+t.value,i);if(a.type)e=new oe(this.parseMode,s.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new oe(this.parseMode,s.type||"mop",s.value||t.value,i),s.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}s||(e=new oe(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const s=wt.getInfo(t.value,this.parseMode,this.macros);if(s){const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new oe(this.parseMode,s.type,s.value||t.value,i),s.isFunction&&(e.isFunction=!0)}else e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=wt.matchCodepoint(this.parseMode,t.value.codePointAt(0)),s&&s.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else"#"===t.type&&("?"===t.value?e=this.placeholder():this.args&&(e=this.args[t.value]||this.placeholder()));return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let s,i=0;"string"==typeof this.macros[t]?(s=this.macros[t],/(^|[^\\])#1/.test(s)&&(i=1),/(^|[^\\])#2/.test(s)&&(i=2),/(^|[^\\])#3/.test(s)&&(i=3),/(^|[^\\])#4/.test(s)&&(i=4),/(^|[^\\])#5/.test(s)&&(i=5),/(^|[^\\])#6/.test(s)&&(i=6),/(^|[^\\])#7/.test(s)&&(i=7),/(^|[^\\])#8/.test(s)&&(i=8),/(^|[^\\])#9/.test(s)&&(i=9)):(s=this.macros[t].def,i=this.macros[t].args||0);for(let t=1;t<=i;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new oe(this.parseMode,"group",re(n(s),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=i;t++){if(o+="{",Array.isArray(e[t]))for(let s=0;s1&&(e.extent=parseInt(s[1]));const i=s[0].split("/");for(const t of i){const s=t.match(/([^:]*):(.*)/);s&&e.path.push({relation:s[1],offset:parseInt(s[2])})}return e}var de={pathFromString:he,pathToString:ce,pathDistance:function(t,e){let s=0,i=-1,a=!1;for(;!a;)i+=1,a=i>=t.length||i>=e.length,a=a||!(t[i].relation===e[i].relation&&t[i].offset===e[i].offset);return s=i===t.length&&i===e.length?0:i+1===t.length&&i+1===e.length&&t[i].relation===e[i].relation?1:2,s},pathCommonAncestor:function(t,e){const s=[],i=Math.min(t.length-1,e.length-1);let a=0;for(;a<=i&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)s.push(t[a]),a+=1;return s},clone:function(t){return he(ce(t)).path}};const pe={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},me={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ue={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function fe(t,e,s){if(!s)return s;if("string"==typeof s)return s;if("string"==typeof s.mode&&s.mode!==t)return null;if(!e)return s?s.value:void 0;let i=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return i=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&wt.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==s.after?/nothing/.test(s.after)&&i||/letter/.test(s.after)&&a||/digit/.test(s.after)&&o||/function/.test(s.after)&&n||/frac/.test(s.after)&&r||/surd/.test(s.after)&&l||/binop/.test(s.after)&&c||/relop/.test(s.after)&&h||/punct/.test(s.after)&&d||/array/.test(s.after)&&p||/openfence/.test(s.after)&&m||/closefence/.test(s.after)&&u||/text/.test(s.after)&&f||/space/.test(s.after)&&g?s.value:null:s.value}function ge(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function ye(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function be(t,e){let s="";Array.isArray(t)||(t=[t]);for(const i of t){let t;const a=i.match(/(^[^:]*):/),o=a?a[1]:"";if(o===ge("mac")||o===ge("win")||o===ge("ios")||o===ge("android")||o===ge("chromeos")||o===ge("other")){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}if(t){const i="mac"===ge("mac")||"ios"===ge("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!i&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:i?"⌘":"command",Shift:i?"⇧":"shift",Alt:i?"⌥":"alt",Ctrl:i?"⌃":"control","\n":i?"⏎":"return",Return:i?"⏎":"return",Enter:i?"⌤":"enter",Tab:i?"⇥":"tab",Esc:"esc",Backspace:i?"⌫":"backspace",Del:i?"⌦":"del",PageUp:i?"⇞":"page up",PageDown:i?"⇟":"page down",Home:i?"⤒":"home",End:i?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;s.length>0&&(s+=e||" or "),s+=o}}return s}var xe={KEYBOARD_SHORTCUTS:pe,INLINE_SHORTCUTS:ue,stringify:be,startsWithString:function(t,e){const s=[];for(let i=0;i<=t.length-1;i++){const a=t.substring(i);e&&e.overrideDefaultInlineShortcuts||Object.keys(ue).forEach(t=>{t.startsWith(a)&&!s.includes(t)&&s.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&s.push(t)})}return s},forString:function(t,e,s,i){let a="";i&&i.overrideDefaultInlineShortcuts||(a=fe(t,e,ue[s]));const o=i&&i.inlineShortcuts?i.inlineShortcuts:null;let n;return o&&(n=fe(t,e,o[s])),n||a},selectorForKeystroke:function(t,e){for(const s of[ge("mac")+":"+t+":"+e,ge("win")+":"+t+":"+e,ge("ios")+":"+t+":"+e,ge("android")+":"+t+":"+e,ge("chromeos")+":"+t+":"+e,ge("other")+":"+t+":"+e,ge("mac")+":"+e,ge("win")+":"+e,ge("ios")+":"+e,ge("android")+":"+e,ge("chromeos")+":"+e,t+":"+e,e])if(pe[s])return pe[s];return""},forCommand:function(t){let e=[];if("string"==typeof t){const s=me[t];Array.isArray(s)?e=s.slice():s&&e.push(s)}t=ye(t);const s=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(pe).forEach(t=>{if(s.test(ye(pe[t]))){const s=t.match(/:([^:]*)$/);s&&e.push(s[1])}}),be(e)}};function ke(t,e){this.root=Yt.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function ve(t){const e=Object.assign(new ke(t.config,t.target),t);return e.path=de.clone(t.path),e}function we(t,e){let s=0;for(let i=0;i0;)s.col+=1,(!t[s.row]||s.col>=t[s.row].length)&&(s.col=0,s.row+=1),e-=1;return s}function Ae(t,e){let s;return"object"!=typeof e&&(e=Se(t,e)),Array.isArray(t[e.row])&&(s=t[e.row][e.col]||null),!s||0!==s.length&&"first"===s[0].type||s.unshift(Ie()),s}function Me(t){let e=0,s=0,i=1;for(const e of t)s+=1,e.length>i&&(i=e.length);return e=s*i,e}function Ce(t,e,s){if(!t)return[];e||(e=",");let i,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?a.push(i):i=new Yt.MathAtom("math","mpunct",e,s),a=a.concat(o));return a}function _e(t,e,s){const i={...e};if(i.row+=s,i.row<0){if(i.col+=s,i.row=t.length-1,i.col<0)return null;for(;i.row>=0&&!Ae(t,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=t.length){for(i.col+=s,i.row=0;i.rowt.length-1)return null}return i}function Te(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function Le(t,e){if(!t)return!1;if(Array.isArray(t)){for(const s of t)if(Le(s,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(s){return s===e||Le(t[s],e)})))return!0;if(t.array)for(let s=Me(t.array);s>=0;s--)if(Le(Ae(t.array,s),e))return!0}return!1}function Fe(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function De(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return ze(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function ze(t,e){if(!t)return"";let s,i=!1;if(i||"^"!==t[0]&&"_"!==t[0]||(s=Ee(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+s.match+"}",t+=ze(s.rest,e),i=!0),i||(s=t.match(/^(sqrt|\u221a)(.*)/),s&&(s=Ee(s[2],{...e,noWrap:!0}),t="\\sqrt{"+s.match+"}",t+=ze(s.rest,e),i=!0)),i||(s=t.match(/^(\\cbrt|\u221b)(.*)/),s&&(s=Ee(s[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+s.match+"}",t+=ze(s.rest,e),i=!0)),i||(s=t.match(/^abs(.*)/),s&&(s=Ee(s[1],{...e,noWrap:!0}),t="\\left|"+s.match+"\\right|",t+=ze(s.rest,e),i=!0)),i||(s=t.match(/^["”“](.*?)["”“](.*)/),s&&(t="\\text{"+s[1]+"}",t+=ze(s[2],e),i=!0)),i||(s=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),s&&(t=qe(s[1],e),t+=ze(s[2],e),i=!0)),!i&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(s=Ee(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+s.match+"\\mright)":t[0]+s.match,t+=ze(s.rest,e),i=!0),i||(s=t.match(/^([a-zA-Z]+)(.*)/),s&&(t=qe(s[1],e),t+=ze(s[2],e),i=!0)),!i)if(s=Ee(t,{...e,noWrap:!0}),s.match&&"/"===s.rest[0]){const a=Ee(s.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+s.match+"}{"+a.match+"}"+ze(a.rest,e)),i=!0}else s.match&&(t="("===t[0]?"\\left("+s.match+"\\right)"+ze(s.rest,e):s.match+ze(s.rest,e),i=!0);return i||(s=t.match(/^(\s+)(.*)$/),s&&(t=" "+ze(s[2],e),i=!0)),t}function Ee(t,e){let s="",i=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?s=ze(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),s="\\left"+a+ze(t.substring(1,r-1),e)+"\\right"+o),i=t.substring(r)):(s=t.substring(1,r),i="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let s=xe.forString("math",null,t,e);if(s)return s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),{match:s,rest:t.substring(s.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(i=t.substring(a[1].length),s=a[1]))}return{match:s,rest:i}}function qe(t,e){let s=xe.forString("math",null,t,e);return s?(s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),s+=" "):s=t,s}function Ie(){return new Yt.MathAtom("","first")}ke.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,s)},ke.prototype.filter=function(t,e){e=e<0?-1:1;const s=[],i=new ke;i.path=de.clone(this.path),i.extent=this.extent,i.root=this.root,e>=0?i.collapseForward():(i.collapseBackward(),i.move(1));const a=i.anchor();do{t.bind(i)(i.path,i.anchor())&&s.push(i.toString()),e>=0?i.next({iterateAll:!0}):i.previous({iterateAll:!0})}while(a!==i.anchor());return s},ke.prototype.forEach=function(t){this.root.forEach(t)},ke.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const s=this.siblings(),i=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=i;e0?0:1)},ke.prototype.setRange=function(t,e,s){s=s||{};const i=de.pathDistance(t,e);if(0===i)return s.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(de.clone(t),0);if(1===i){const i=e[e.length-1].offset-t[t.length-1].offset;return s.extendToWordBoundary?(t=this.wordBoundary(t,i<0?1:-1),e=this.wordBoundary(e,i<0?-1:1),this.setRange(t,e)):this.setPath(de.clone(t),i)}let a=de.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=de.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},ke.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let s=0;s0?this.path[this.path.length-1].relation:""},ke.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},ke.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},ke.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},ke.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},ke.prototype.insertFirstAtom=function(){this.siblings()},ke.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ae(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Ie()),t},ke.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},ke.prototype.isCollapsed=function(){return 0===this.extent},ke.prototype.setExtent=function(t){this.extent=t},ke.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},ke.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},ke.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),s=this.endOffset();for(;t[e]&&"text"===t[e].mode&&wt.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[s]&&"text"===t[s].mode&&wt.LETTER_AND_DIGITS.test(t[s].body);)s+=1;if(s-=1,e>=s)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,s-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),s=this.endOffset();for(;Te(t[e]);)e-=1;for(;Te(t[s]);)s+=1;s-=1,this.setSelection(e,s-e)}else this.setSelection(0,"end")},ke.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},ke.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},ke.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),s=this.startOffset(),i=this.endOffset();for(let a=s;a0&&"command"===t[e].type;)e-=1;let s=this.startOffset()+1;for(;s<=t.length-1&&"command"===t[s].type;)s+=1;return s>e?{start:e+1,end:s}:null},ke.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const s=this.commandOffsets();if(s){const i=t?this.anchorOffset()+1:s.end,a=this.siblings();for(let t=s.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==s.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},ke.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let s=e.length-1;s>=0;s--)"command"===e[s].type?e.splice(s,1):t(e[s]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let s=Me(e.array);s>=0;s--)t(Ae(e.array,s))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},ke.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let s=this.startOffset();if("text"===t[s].mode)for(;s>=1&&"text"===t[s].mode;)e.unshift(t[s]),s--;else for(;s>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[s].type);)e.unshift(t[s]),s--;return e},ke.prototype.setSelection=function(t,e,s){t=t||0,e=e||0;const i=this.path[this.path.length-1].relation;s||(s=i);const a=this.parent();if(!a&&"body"!==s)return!1;const o=s.startsWith("cell");if(!o&&!a[s]||o&&!a.array)return!1;const n=s!==i;this.path[this.path.length-1].relation=s;const r=this.siblings().length;this.path[this.path.length-1].relation=i;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=s,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},ke.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let s=e[this.relation()];const i=this.parent();for(;s&&!i[s];)s=e[s];if(s)return void this.setSelection(0,0,s);if(this.parent().array){const t=Me(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ae(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const s=this.anchor();if(!s.captureSelection){let t;if(s.array){t="";const e=Me(s.array);let i=e-1;for(;!t&&i0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},ke.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const s=this.relation();if("denom"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Se(this.parent().array,s);e=_e(this.parent().array,e,-1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},ke.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const s=this.relation();if("numer"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Se(this.parent().array,s);e=_e(this.parent().array,e,1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},ke.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,s=0;const i=ve(this);s=this.extent+t;const a=e+s;if(a<0&&0!==s){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",i);e=this.path[this.path.length-1].offset,s=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",i);this.isCollapsed()&&(e-=1),s-=1}this.setSelection(e,s),this._announce("move",i)},ke.prototype.skip=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=ve(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(s&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!s)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let s="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(s){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",i)}},ke.prototype.jump=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,i.length-1));const o=t<0?0:i.length-1;s?this.extend(o-a):this.move(o-a)},ke.prototype.jumpToMathFieldBoundary=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const i=ve(this),a=[{relation:"body",offset:this.path[0].offset}];let o;s?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(i,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',s=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let i=s.indexOf(document.activeElement)+t;i<0&&(i=s.length-1),i>=s.length&&(i=0),s[i].focus()}return this.suppressChangeNotifications=s,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",i),this.selectionDidChange(),this.suppressChangeNotifications=s,!0},ke.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e=i.mode),s+=1,i=this.ancestor(s);return e},ke.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e={color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontShape:i.fontShape,fontSeries:i.fontSeries,fontSize:i.fontSize}),s+=1,i=this.ancestor(s);return e},ke.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let s=0,i=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(s++,i=o),"first"!==t[e].body[o].type&&a++;0===a&&1===s&&(t[e]=t[e].body[i])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=Fe(t.numer),t.denom=Fe(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=Fe(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=Fe(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=Fe(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=Fe(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=Fe(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=Fe(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=Me(t.array);e>=0;e--)this.simplifyParen(Ae(t.array,e))})}},ke.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const s=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const i=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=De(t,{...this.config,format:"ASCIIMath"}),o=le.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)wt.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new Yt.MathAtom("command","command",e))}else""===t?o=[new Yt.MathAtom("command","command","\\")]:(t=De(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=le.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=le.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=le.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,s){e&&s&&(Array.isArray(e)?e.forEach(e=>t(e,s)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(s),t(e.body,s),t(e.numer,s),t(e.denom,s),t(e.index,s),t(e.overscript,s),t(e.underscript,s),t(e.subscript,s),t(e.superscript,s))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=i,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=s},ke.prototype._insertSmartFence=function(t,e){const s=this.parent();if("leftright"===s.type&&"|"!==s.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const i=wt.RIGHT_DELIM[t];if(i&&("leftright"!==s.type||"|"!==s.leftDelim)){let s="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;s=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",s+=a?"?":i;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(s,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(wt.RIGHT_DELIM).forEach(e=>{t===wt.RIGHT_DELIM[e]&&(a=e)}),a){if(s&&"leftright"===s.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),s.rightDelim=t,this.move(1),this.contentDidChange(),!0;const i=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==i[a].type||"?"!==i[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),i[a].rightDelim=t,i[a].body=i[a].body.concat(i.slice(a+1,this.endOffset()+1)),i.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(s&&"leftright"===s.type&&"?"===s.rightDelim){this.contentWillChange(),s.rightDelim=t;const e=i.slice(this.endOffset()+1);return i.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===i.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},ke.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let s=e.start;for(;s=0;e--)t[e].suggestion&&t.splice(e,1)},ke.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const s=[],i=t.substr(e);for(const t of i){const e=new Yt.MathAtom("command","command",t);e.suggestion=!0,s.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(s))},ke.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},ke.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},ke.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(s+=1)}i.row+=1}return s}(t,e.col)){!function(t,e){let s=0;for(;s"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==s.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,s.slice(e+1,e+2)),s.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,s.slice(t,e)),s.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},ke.prototype.moveToNextPlaceholder_=function(){this.leap(1)},ke.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},ke.prototype.moveToNextChar_=function(){this.move(1)},ke.prototype.moveToPreviousChar_=function(){this.move(-1)},ke.prototype.moveUp_=function(){this.up()},ke.prototype.moveDown_=function(){this.down()},ke.prototype.moveToNextWord_=function(){this.skip(1)},ke.prototype.moveToPreviousWord_=function(){this.skip(-1)},ke.prototype.moveToGroupStart_=function(){this.setSelection(0)},ke.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},ke.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},ke.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},ke.prototype.deleteNextChar_=function(){this.delete_(1)},ke.prototype.deletePreviousChar_=function(){this.delete_(-1)},ke.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},ke.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},ke.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},ke.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},ke.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},ke.prototype.transpose_=function(){},ke.prototype.extendToNextChar_=function(){this.extend(1)},ke.prototype.extendToPreviousChar_=function(){this.extend(-1)},ke.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendUp_=function(){this.up({extend:!0})},ke.prototype.extendDown_=function(){this.down({extend:!0})},ke.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},ke.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},ke.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},ke.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},ke.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Ie()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Ie()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},ke.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Ie()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Ie()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},ke.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Ie()]),this.setSelection(0,"end",t)},ke.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},ke.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=ve(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},ke.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const s=this.relation();if(e.array){const i=Se(e.array,s);"after row"===t||"before row"===t?(i.col=0,i.row=i.row+("after row"===t?1:0),e.array.splice(i.row,0,[[]])):(i.col+="after column"===t?1:0,e.array[i.row].splice(i.col,0,[]));const a=we(e.array,i);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},ke.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",s=wt.getEnvironmentInfo(e),i=[[t.body]];s.parser&&Object.assign(t,s.parser(e,[],i)),t.tabularMode=s.tabular,t.parseMode=this.anchorMode(),t.env={...s},t.env.name=e,t.array=i,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},ke.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},ke.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},ke.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},ke.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},ke.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function s(t,s){let i=!0;return e.forEachSelected(e=>{i=i&&e[t]===s},{recursive:!0}),i}t.color&&s("color",t.color)&&(t.color="none"),t.backgroundColor&&s("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&s("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&s("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&s("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&s("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Pe={EditableMathlist:ke,parseMathString:De};const Be={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Oe={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},$e={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Re(t){let e,s=!0;"Unidentified"===t.key&&t.target&&(e=$e[t.target.value]||t.target.value),e||(Be[t.key]?(e=Be[t.key],s=!1):e=Oe[t.key],e||(e=$e[t.key.toLowerCase()])),!e&&t.code&&(e=Oe[t.code]||t.code);const i=[];return t.ctrlKey&&i.push("Ctrl"),t.metaKey&&i.push("Meta"),s&&t.altKey&&i.push("Alt"),s&&t.shiftKey&&i.push("Shift"),0===i.length?e:(i.push(e),i.join("-"))}function Ke(t,e){let s,i=null,a=null,o=!1,n=!1;function r(t){clearTimeout(s),s=setTimeout((function(){clearTimeout(s),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const s=t.value;t.value="",s.length>0&&e.typedText(s)}const c=t||e.container;c.addEventListener("keydown",(function(s){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==s.key&&"Unidentified"!==s.key&&229!==s.keyCode)n=!1;else{n=!0,o=!1;const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i}return!(!o&&"CapsLock"!==s.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(s.code))||(i=s,a=null,e.keystroke(Re(s),s))}),!0),c.addEventListener("keypress",(function(t){o||(i&&a&&e.keystroke(Re(i),i),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!i||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const s=t.value;t.value="",s.length>0&&e.paste(s)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){i=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i,n=!1,o=!1,r(l)}else o||r(l)})}var Ne={delegateKeyboardEvents:Ke,select:Ke.select,keyboardEventToString:Re,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const We={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},He={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function Ve(t){let e=He[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ue(t,e){t.popover.innerHTML=e;const s=t._getCaretPosition();s&&je(t,s),t.popover.classList.add("is-visible")}function je(t,e){const s=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>i-a?t.popover.style.left=i-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>s-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Ge(t){t.popover.classList.remove("is-visible")}var Ze={getNote:Ve,SAMPLES:We,NOTES:He,showPopoverWithLatex:function(t,e,s){if(!e||0===e.length)return void Ge(t);const i=e,a=function(t,e){const s=le.parseTokens(n(t),"math",null,e.config.macros),i=Yt.decompose({mathstyle:"displaystyle",macros:e.config.macros},s),a=N.makeSpan(i,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(We[i]||e,t),o=Ve(i),r=xe.forCommand(i);let l=s?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=s?'
    ':"",Ue(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ue,hidePopover:Ge,updatePopoverPosition:function t(e,s){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(s&&s.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&je(e,t)}else Ge(e)}};function Xe(t,e,s){let i="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";i=function t(e,s,i,a){if(0===i.length)return"";if(0===s.length)return i.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=s[0];let c=i[0][l];"fontFamily"===l&&(c=i[0].fontFamily||i[0].baseFontFamily);const h=function(t,e,s){let i=0;if("fontFamily"===e)for(;t[i]&&("mop"===t[i].type||(t[i].fontFamily||t[i].baseFontFamily)===s);)i++;else if("mode"===e)for(;t[i]&&t[i][e]===s;)i++;else for(;t[i]&&("mop"===t[i].type||t[i][e]===s);)i++;return i}(i,l,c);if("text"===i[0].mode){if("fontShape"===l&&i[0].fontShape)"it"===i[0].fontShape?(n="\\textit{",r="}"):"sl"===i[0].fontShape?(n="\\textsl{",r="}"):"sc"===i[0].fontShape?(n="\\textsc{",r="}"):"n"===i[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+i[0].fontShape+"}",r="}");else if("fontSeries"===l&&i[0].fontSeries)"b"===i[0].fontSeries?(n="\\textbf{",r="}"):"l"===i[0].fontSeries?(n="\\textlf{",r="}"):"m"===i[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+i[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(s+=" & "),s+=Xe(this,this.array[i][e],t);i1&&(s+=" "),s+=Xe(this,this.body,t),s+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?s+="("+Xe(this,this.body,t)+")":(s+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(s+=" "),s+=Xe(this,this.body,t),s+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" "));break;case"delim":case"sizeddelim":s+=n+"{"+this.delim+"}";break;case"rule":s+=n,this.shift&&(s+=`[${Xe(this,this.shift,t)}em]`),s+=`{${Xe(this,this.width,t)}em}{${Xe(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":s+=`${n}{${Xe(this,this.body,t)}}`;break;case"overunder":s+=`${n}{${Xe(this,this.overscript||this.underscript,t)}}{${Xe(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?s+=n+"{"+Xe(this,this.body,t)+"}":'\\char"'===n?s+=this.latex+" ":"\\unicode"===n?(s+='\\unicode{"',s+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),s+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?s+=n+"{"+Xe(this,this.body,t)+"}":"\\operatorname"===n?s+=n+"{"+Xe(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(s+="\\limits "),"nolimits"===this.limits&&(s+="\\nolimits "));break;case"box":if("\\bbox"===n){if(s+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(se(this.backgroundcolor)),s+=`[${t.join(",")}]`}s+=`{${Xe(this,this.body,t)}}`}else"\\boxed"===n?s+=`\\boxed{${Xe(this,this.body,t)}}`:(s+=n,this.framecolor&&(s+=`{${se(this.framecolor)}}`),this.backgroundcolor&&(s+=`{${se(this.backgroundcolor)}}`),s+=`{${Xe(this,this.body,t)}}`);break;case"spacing":s+=n,"\\hspace"===n||"\\hspace*"===n?(s+="{",this.width?s+=this.width+"em":s+="0em",s+="}"):(s+=" ",this.width&&(s+=this.width+"em "));break;case"enclose":if(s+=n,"\\enclose"===n){s+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(s+=t+e,t=" ");s+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+se(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+se(this.strokeColor)+'"',t=","),e&&(s+=`[${e}]`)}s+=`{${Xe(this,this.body,t)}}`;break;case"mathstyle":s+="\\"+this.mathstyle+" ";break;case"space":s+=this.latex;break;case"placeholder":s+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":s+=this.latex}if(this.superscript){let e=Xe(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),s+="^"+e):s+="^{"+e+"}"}if(this.subscript){const e=Xe(this,this.subscript,t);1===e.length?s+="_"+e:s+="_{"+e+"}"}return s},Je.plural=function(t,e,s){(s=s||{}).type=s.type||"cardinal";const i=Je.locale.substring(0,2),a="ordinal"===s.type?Je.ordinal:Je.cardinal;let o,n="ordinal"===s.type?Je._ordinalPluralCategories.indexOf(a.select(t)):Je._cardinalPluralCategories.indexOf(a.select(t));return Je.strings[Je.locale]&&(o=Je.strings[Je.locale][e]),!o&&Je.strings[i]&&(o=Je.strings[i][e]),o||(o=Je.strings.en[e],o||(o=e),n="ordinal"===s.type?Je._ordinalPluralCategories.indexOf(Je._ordinalEnglish.select(t)):Je._cardinalPluralCategories.indexOf(Je._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Je.merge=function(t,e){if(t&&e){const s=Je._locale;Je.locale=t,Je.strings[t]={...Je.strings[t],...e},Je.locale=s}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Je.merge(t,e[t])))},Object.defineProperty(Je,"locale",{set(t){Je._locale=t,Je._ordinal=null,Je._cardinal=null},get:()=>(Je._locale||(Je._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Je._locale)}),Object.defineProperty(Je,"ordinal",{get:()=>(Je._ordinal||(Je._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Je._ordinalEnglishPluralCategories=Je._ordinalEnglish.resolvedOptions().pluralCategories,Je._ordinal=new Intl.PluralRules(Je.locale,{type:"ordinal"}),Je._ordinalPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._ordinal)}),Object.defineProperty(Je,"cardinal",{get:()=>(Je._cardinal||(Je._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Je._cardinalEnglishPluralCategories=Je._cardinalEnglish.resolvedOptions().pluralCategories,Je._cardinal=new Intl.PluralRules(Je.locale,{type:"cardinal"}),Je._cardinaPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._cardinal)}),Je.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const Ye={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},Qe={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ts={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let es={};const ss={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function is(t,e,s){t=t.replace(/(^|[^\\])#@/g,"$1#?");const i=le.parseTokens(n(t),"math",e,s.config.macros),a=Yt.decompose({mathstyle:"displaystyle",macros:s.config.macros},i),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function as(t,e,s){let i="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},Ye,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;i+="
    "+e[t].label+"
    "}}return i+="
    ",i+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function os(t,e,s){for(let i=0;i"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&Qe[n]&&(a.setAttribute("data-shifted",Qe[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",Qe[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],s&&(o=[s,o]),a.getAttribute("data-alt-keys")){const t=es[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function ns(t,e){const s={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=s[t.config.virtualKeyboardLayout]?s[t.config.virtualKeyboardLayout]:s.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const s of t){const t=s.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=i[e.name];if(r||(r=s.qwerty[e.name]),r)for(const t of r){let s=e.class||"";s&&(s=" "+s),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(s)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var rs={make:function(t,e){let s='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ts["foreground-color"]=[];for(const t of ae)ts["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ts["background-color"]=[];for(const t of ie)ts["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});es={...ts},Object.keys(es).forEach(t=>{es[t]=es[t].slice()});const i="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];es[e]||(es[e]=[]),es[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),es[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),es[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),es[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),es[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),es[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),es[e].unshift({latex:"\\mathbb{"+i[t]+"}",aside:"blackboard",insert:"\\mathbb{"+i[t]+"}"}),es[e].unshift({latex:"\\mathbf{"+i[t]+"}",aside:"bold",insert:"\\mathbf{"+i[t]+"}"}),es[e].unshift({latex:"\\mathsf{"+i[t]+"}",aside:"sans",insert:"\\mathsf{"+i[t]+"}"}),es[e].unshift({latex:"\\mathcal{"+i[t]+"}",aside:"script",insert:"\\mathcal{"+i[t]+"}"}),es[e].unshift({latex:"\\mathfrak{"+i[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+i[t]+"}"})}for(let t=0;t<=26;t++){const e=i[t];es[e]||(es[e]=[]),es[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),es[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),es[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),es[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];es[e]||(es[e]=[]),es[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),es[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),es[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),es[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),es[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ss,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},Ye,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let i=n[e].layers||[];n[e].layer&&i.push(n[e].layer),i=Array.from(new Set(i));for(const n of i){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const s of e)t+="${s.label?s.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}s+="
    ",s+=as(t,a,e);const i="function"==typeof o[n]?o[n]():o[n];s+=ns(t,i),s+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=s,os(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:os};const ls={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},cs={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},hs={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function ds(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ps(t,e){return t&&e.generateID?' extid="'+t+'"':""}function ms(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(i=!0,us(t)&&(n=t.index,t.index+=1),fs(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=vs(t.atoms[r].subscript,0,0,s).mathML,a+=vs(t.atoms[n].superscript,0,0,s).mathML,a+="";else if(n>=0){if(a=""+o,us(t)){const e=vs(t.atoms[n].superscript,0,0,s).mathML,i=vs(t.atoms[n+1].superscript,0,0,s).mathML;a+=""!==e&&""!==e||""!==i&&""!==i?""===e||""===e?"":e:""}else a+=vs(t.atoms[n].superscript,0,0,s).mathML;a+=""}else r>=0?(a=""+o,a+=vs(t.atoms[r].subscript,0,0,s).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return i}function us(t){return t.index"+t,a+=vs(o.subscript,0,0,s).mathML,a+=vs(o.superscript,0,0,s).mathML,a+=""):o.superscript?(a=""+t,a+=vs(o.superscript,0,0,s).mathML,a+=""):o.subscript&&(a=""+t,a+=vs(o.subscript,0,0,s).mathML,a+=""),a.length>0&&(i=!0,e.mathML+=a,e.lastType=""),i))}function ys(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(i=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),i}function bs(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,s=t.index,i=!1,a=!1;for(;s=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(i=!0,o=""+o+"",n<0&&us(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=vs(t.atoms[n].superscript,0,0,s).mathML,o+=""),t.mathML+=o,t.lastType="mn"),i}function xs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=ws(t.atoms[l],s),a+=vs(t.atoms,l+1,c,s).mathML,a+=ws(t.atoms[c],s),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,gs(a,t,s)&&(i=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function ks(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=vs(n.subscript,0,0,s).mathML,a+=vs(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=vs(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=vs(n.subscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Ss(e.body)+"":ws(e,s);a+=r,t.index+=1,gs(a,t,s)&&(i=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function vs(t,e,s,i){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(s=s||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(i);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function ws(t,e){let s="";const i=Ss(t.body);return i&&(s=""+i+""),s}function Ss(t){if(!t)return"";if("string"==typeof t)return ds(t);if(!Array.isArray(t)&&"string"==typeof t.body)return ds(t.body);let e="";for(const s of t)"string"==typeof s.body&&(e+=s.body);return ds(e)}Yt.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let i,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=vs(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(hs[this.lFence]||this.lFence)+"")),c+="",i=0;i"+vs(this.array[a][i],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(hs[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hs[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=vs(this.numer,0,0,t).mathML||" ",c+=vs(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+vs(this.numer,0,0,t).mathML+"",c+=""+vs(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hs[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=vs(this.body,0,0,t).mathML,c+=vs(this.index,0,0,t).mathML,c+=""):(c+="",c+=vs(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hs[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=vs(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hs[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(hs[this.delim]||this.delim)+"";break;case"accent":c+='",c+=vs(this.body,0,0,t).mathML,c+=""+(hs[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+vs(l,0,0,t).mathML,c+=vs(n,0,0,t).mathML,c+=vs(r,0,0,t).mathML,c+=""):r?(c+=""+vs(l,0,0,t).mathML,c+=vs(r,0,0,t).mathML,c+=""):n&&(c+=""+vs(l,0,0,t).mathML,c+=vs(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const s=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;s?c="&#x"+s[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const i=/\d/.test(c)?"mn":"mi";c="<"+i+d+ps(this.id,t)+">"+ds(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&hs[p]?""+hs[p]+"":ws(this,t);break;case"mpunct":c='"+(hs[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+vs(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+vs(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},Yt.toMathML=function(t,e){return vs(t,0,0,e).mathML};const As={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},Ms={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Cs={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},_s={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Ts(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Ls(t){return t&&_s[t]||-1}function Fs(t){return/=|=>/.test(t)?"right":"left"}function Ds(t){if("f"===t||"g"===t)return!0;const e=Cs[t];return!!e&&!!/%[^01_^]?/.test(e)}function zs(t){t=(t||"").trim();let e=As[t];if(!e)if(/^\\[^{}]+$/.test(t)){const s=wt.getInfo(t,"math",{});e=s&&s.value||t.slice(1)}else e=t;return e}function Es(t){if(!t)return null;const e=zs($s(t)),s=[Ls(e),Fs(e)];return s[0]<=0?null:s}function qs(t){return null!==Es(t)}const Is={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Ps={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Bs={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Os={",":"list",";":"list2"};function $s(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const s of t)e+=$s(s);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const s of t.body)e+=$s(s);return e}return""}function Rs(t){return"string"==typeof t.sym?function(t){let e=Cs[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const s=wt.getInfo("\\"+t,"math");!s||s.fontFamily&&"cmr"!==s.fontFamily&&"ams"!==s.fontFamily||(e="\\"+t)}return e||(e=wt.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Ks(t){return parseFloat(t.num)}function Ns(t){return"object"==typeof t&&void 0!==t.num}function Ws(t){let e=0;return Ns(t)&&(e="object"==typeof t.num?void 0!==t.num.re?li(t.num.re):0:parseFloat(t.num)),e}function Hs(t){let e=0;return Ns(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?li(t.num.im):0),e}function Vs(t){return t&&void 0!==t.sup}function Us(t){return t&&void 0!==t.sub}function js(t,e,s){let i=!1;const a=t.atoms[t.index];return a&&a.type===e&&(i=void 0===s||$s(a)===s),i}function Gs(t,...e){const s={fn:t};if(e){const t=[];for(const s of e)s&&t.push(s);t.length>0&&(s.arg=t)}return s}function Zs(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Xs(t){if(Ns(t)){const e=Ws(t),s=Hs(t);return 0!==s?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-s).toString()):t.num=(-e).toString(),t}return Gs("negate",t)}function Js(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function Ys(t,e){let s=t.atoms[t.index];return!s||void 0===s.superscript&&void 0===s.subscript?s=null:t.index+=1,s||(s=t.atoms[t.index+1],s&&"msubsup"===s.type&&(s.superscript||s.subscript)?t.index+=2:s=null),s?(void 0!==s.subscript&&(t.ast.sub=oi(s.subscript,e)),void 0!==s.superscript&&("msubsup"===s.type?/['\u2032]|\\prime/.test($s(s.superscript))?(t.index+=1,s=t.atoms[t.index+1],s&&"msubsup"===s.type&&/['\u2032]|\\prime/.test($s(s.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test($s(s.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=oi(s.superscript,e)):t.ast.sup=oi(s.superscript,e))):t.index+=1,t}function Qs(t,e){const s=t.ast;if(ei(t,"!!"))return t.index+=1,t.ast=Gs("factorial2",s),Qs(t=Ys(t,e),e);if(ei(t,"++"))return t.index+=1,t.ast=Gs("increment",s),Qs(t=Ys(t,e),e);if(ei(t,"--"))return t.index+=1,t.ast=Gs("decrement",s),Qs(t=Ys(t,e),e);const i=t.atoms[t.index];return i&&i.latex&&Ps[i.latex.trim()]&&(t.ast=Gs(Ps[i.latex.trim()],s),t=Qs(t=Ys(t,e),e)),t}function ti(t,e,s,i){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&$s(o)===e)t.index+=1,o=(t=ii(t,i)).atoms[t.index],o&&"mclose"===o.type&&$s(o)===s&&(Js(t)&&(t.ast={group:t.ast}),t=Qs(t=Ys(t,i),i));else if("textord"===o.type&&$s(o)===e)t.index+=1,o=(t=ii(t,i)).atoms[t.index],o&&"textord"===o.type&&$s(o)===s&&(t.index+=1,t=Qs(t=Ys(t,i),i));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=ii(t,i)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=Qs(t=Ys(t,i),i))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=ii(t,i)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===s&&(t.index+=1,t=Qs(t=Ys(t,i),i));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==s)return;t.ast=oi(o.body,i),Js(t)&&(t.ast={group:t.ast}),t=Qs(t=Ys(t,i),i)}return t.minPrec=a,t}{let i=!0;if("mopen"===o.type?(e=o.latex.trim(),s=wt.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,s=wt.RIGHT_DELIM[e]):"leftright"===o.type?(i=!1,e=o.leftDelim,"?"===(s=o.rightDelim)&&(s=wt.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),s=wt.RIGHT_DELIM[e]),e&&s){if("|"===e&&"|"===s){const i=t.atoms[t.index+1];i&&"textord"===i.type&&"|"===i.latex&&(e="\\lVert",s="\\rVert")}if(t=ti(t,e,s))return i&&(t.index+=1),t.ast={fn:Is[e+s]||e+s,arg:[t.ast]},t.minPrec=a,t}}}function ei(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===$s(t.atoms[t.index])+$s(t.atoms[t.index+1])}function si(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!js(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,s=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return s&&(t.index+=1),s}return t.index+=1,js(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):js(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function ii(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let s=function t(e,s){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let i=e.atoms[e.index];if("text"===i.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=zs($s(i));if(si(e))e.ast=Gs(e.ast,t(e,s).ast);else{if("root"===i.type)return e.index=0,e.atoms=i.body,t(e,s);if("mbin"===i.type&&"-"===a)e.index+=1,(e=t(e,s)).ast=Xs(e.ast);else if("mbin"===i.type&&"+"===a)e.index+=1,(e=t(e,s)).ast=Gs("add",e.ast);else if("mord"===i.type&&/^[0-9.]$/.test(i.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ai(t)))),e=[t])}return e}function oi(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const s=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;s.push(e)}else{const i=ii(t,e).ast;if(!i)return;s.push(i)}return s.length>1?Gs("text",...s):s[0]||void 0}({atoms:ai(t)},e)}function ni(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let s="";if(e.length>0){"."!==t[0]&&(s+=t[0]);let i="";for(const a of e)s+=i+a,i=t[2];"."!==t[1]&&(s+=t[1])}return s}function ri(t,e){const s=t.length;t=t.substr(0,e.precision-2);for(let s=0;s1&&(i+o.repeat(n+1)).startsWith(t))return"0"===o?i.replace(/(\d{3})/g,"$1"+e.groupSeparator):i.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return s!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function li(t){return parseFloat(parseFloat(t).toPrecision(15))}function ci(t,e){let s="";if("number"==typeof e.precision){if("number"!=typeof t){let s="",i="";if("-"===t[0]?(s="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(i=a[4]||"","0"===o){let i=0;for(;"0"===n[i]&&i=e.precision)a="0",s="";else{a=t[i];const s=ri(t.substr(i+1),e);s&&(a+=e.decimalMarker+s)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),i>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-i).toString():a+="10^{"+(1-i).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const s=ri(n,e);s&&(t+=e.decimalMarker+s)}}else if(t.length>e.precision){const s=t.length;let i=t[0];const a=ri(t.substr(2),e);a&&(i+=e.decimalMarker+a,"}"!==i[i.length-1]&&(i+="\\ldots")),"1"!==i?i+=e.exponentProduct:i="",e.exponentMarker?i+=e.exponentMarker+(s-2).toString():i+="10^{"+(s-2).toString()+"}",t=i}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return i&&(i=e.exponentMarker?e.exponentMarker+i:e.exponentProduct+" 10^{"+i+"}"),s+t+i}t=li(t)}if("engineering"===e.scientificNotation)if(0===t)s="0";else{const i=Math.abs(t);let a=Math.round(Math.log10(i));a-=a%3,i<1e3&&(a=0);let o=i/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=ri(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",s=(t<0?"-":"")+o+a}else{const i="string"==typeof t?t:t.toString();let a,o,n,r=i.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=i,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=ri(n,e)),n&&(n=e.decimalMarker+n),s=a+n+(o||"")}return s}Yt.MathAtom.prototype.toAST=function(t){let e,s,i,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(s=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),s=le.parseTokens(n(s),"math",null,t.macros),i=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),i=le.parseTokens(n(i),"math",null,t.macros),o=Gs("divide",oi(s,t),oi(i,t))):o.fn="divide"):o.group=oi(this.body,t);break;case"genfrac":o=Gs("divide",oi(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Zs(1):oi(this.denom,t));break;case"surd":o=this.index?Gs("pow",oi(this.body,t),Gs("divide",Zs(1),oi(this.index,t))):Gs("sqrt",oi(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=zs($s(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=wt.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=oi(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Gs("card",oi(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>oi(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const s=[];s.push(oi(e[0],t));let i=oi(e[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(t=>"string"!=typeof t)),s.push(i||{}),o.args.push(s)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},Yt.toAST=function(t,e){return oi(t,e)};var hi=function t(e,s){const i=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},s);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Ns(e)){const s=Ks(e);if(s===-1/0)a="-\\infty ";else if(s===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(s)?"\\text{NaN}":ci(e.num,i);else{const t=Ws(e),s=Hs(e);isNaN(t)||isNaN(s)?a="\\text{NaN}":Math.abs(s)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ci(t,i)),Math.abs(s)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=s>0?"+":""),a+=(1!==Math.abs(s)?ci(s,i):"")+"\\imaginaryI "))}Vs(e)&&(a+="^{"+t(e.sup,i)+"}"),Us(e)&&(a+="_{"+t(e.sub,i)+"}")}else if(e.group)a=t(e.group,i),Ns(e.group)||Rs(e.group)?0!==Hs(e.group)&&(a=ni(e.fence||"(),",a)):a=ni(e.fence||"(),",a),Vs(e)&&(a+="^{"+t(e.sup,i)+"}"),Us(e)&&(a+="_{"+t(e.sub,i)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Ts(e,0),i)+"|_{",e.arg&&2===e.arg.length)a+=t(Ts(e,1));else{let s="";for(let i=1;i=2)a=t(Ts(e,0),i),Ns(Ts(e,0))||Rs(Ts(e,0))||(a=ni(e.fence||"(),",a)),a+="^{"+t(Ts(e,1),i)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,i)).join(" = ");else{const s=function(t){let e=Cs[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=s;let o="";if(/%(?![01_^])/.test(s)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ni(e.fence||"(),",...e.arg.map(e=>t(e,i)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Ts(e,0),i),r=t(Ts(e,1),i),l=[...e.arg];/%0/.test(s)&&(a=a.replace("%0",n),l.shift()),/%1/.test(s)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ni(e.fence||"(),",...l.map(e=>t(e,i))))}else o=ni(e.fence||"(),","");a=Vs(e)?a.replace("%^","^{"+t(e.sup,i)+"}"):a.replace("%^",""),a=Us(e)?a.replace("%_","_{"+t(e.sub,i)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const s=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?s.push(ni("() ",t(a,i))):0!==Ws(o=a)&&0!==Hs(o)?s.push(ni("() ",t(a,i))):Vs(e)&&0!==Hs(a)&&1!==Hs(a)?s.push(ni("() ",t(a,i))):s.push(t(a,i));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Ns(e.arg[0])&&"divide"!==e.arg[0].fn||Ns(e.arg[1])&&(0!==Ws(e.arg[1])||1!==Hs(e.arg[1]))?s.join(" \\times "):s[0]+s[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Ns(e.arg[0])&&Ks(e.arg[0])<0?s[0]:"+"+s[0];else{a=s[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function pi(t){let e=0;if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&(e+=1);return 1===e}function mi(t){let e="";if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&"string"==typeof s.body&&(e+=s.body);return e}function ui(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],s,a)}else t.addEventListener(a,s,i)}}function fi(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],s,a)}else t.removeEventListener(a,s,i)}}function gi(t,e){let s=document.getElementById(t);return s?s.setAttribute("data-refcount",parseInt(s.getAttribute("data-refcount"))+1):(s=document.createElement("div"),s.setAttribute("aria-hidden","true"),s.setAttribute("data-refcount","1"),s.className=e,s.id=t,document.body.appendChild(s)),s}function yi(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function bi(t){return t.element&&t.element.mathfield===t}Yt.toSpeakableFragment=function(t,e){function s(t){return""+t+""}if(!t)return"";let i="";if(t.id&&"math"===e.speechMode&&(i+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=Yt.toSpeakableFragment(t.body,e),t.index){let s=Yt.toSpeakableFragment(t.index,e);s=s.trim();const a=s.replace(//g,"");i+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+s+', of '+n+'. End root'}else pi(t.body)?i+=" the square root of "+n+" , ":i+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":i+=di[t.leftDelim]||t.leftDelim,i+=Yt.toSpeakableFragment(t.body,e),i+=di[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":i+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=t.latex?t.latex.trim():"";if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){i=Yt.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)i+=a;else{if("mbin"===t.type&&(i+=''),a){const t=di[a]||(o?di[o.trim()]:"");if(t)i+=" "+t;else{const t=o?function(t){let e=Ze.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";i+=t||function(t){let s="";return e.textToSpeechMarkup?/[a-z]/.test(t)?s+=' '+t+"":/[A-Z]/.test(t)?s+="capital "+t.toLowerCase():s+=t:/[a-z]/.test(t)?s+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?s+=" 'capital "+t.toUpperCase()+"'":s+=t,s}(a)}}else i+=Yt.toSpeakableFragment(t.body,e);"mbin"===t.type&&(i+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let s=Yt.toSpeakableFragment(t.superscript,e);s=s.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the summation from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=Yt.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the summation from '+s+' of ',r=!0}else i+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let s=Yt.toSpeakableFragment(t.superscript,e);s=s.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the product from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=Yt.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the product from '+s+' of ',r=!0}else i+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=Yt.toSpeakableFragment(t.superscript,e);a=a.trim();let o=Yt.toSpeakableFragment(t.subscript,e);o=o.trim(),i+=' the integral from '+s(o)+' to '+s(a)+' of ',r=!0}else i+=' the integral of ';else if("string"==typeof t.body){i+=di[t.body]||di[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?i+=" "+t.latex.substr(1):i+=" "+t.latex)}break;case"enclose":n=Yt.toSpeakableFragment(t.body,e),pi(t.body)?i+=" crossed out "+n+" , ":i+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let s=Yt.toSpeakableFragment(t.superscript,e);s=s.trim();const a=s.replace(/<[^>]*>/g,"");if(pi(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(i+='')}"′"===a?i+=" prime ":"2"===a?i+=" squared ":"3"===a?i+=" cubed ":isNaN(parseInt(a))?i+=" to the "+s+"; ":i+=' to the '+a+" power; "}else isNaN(parseInt(a))?i+=" raised to the "+s+"; ":i+=' raised to the '+a+" power; "}if(!r&&t.subscript){let s=Yt.toSpeakableFragment(t.subscript,e);s=s.trim(),pi(t.subscript)?i+=" sub "+s:i+=" subscript "+s+". End subscript. "}}return i},Yt.toSpeakableText=function(t,e){const s=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(s.speechMode="math",window.sre&&"sre"===s.textToSpeechRules){s.generateID=!0;const e=Yt.toMathML(t,s);return e?(s.textToSpeechMarkup&&(s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup=s.textToSpeechMarkup,"ssml"===s.textToSpeechRulesOptions.markup&&(s.textToSpeechRulesOptions.markup="ssml_step"),s.textToSpeechRulesOptions.rate=s.speechEngineRate),s.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(s.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let i=Yt.toSpeakableFragment(t,s);if("ssml"===s.textToSpeechMarkup){let t="";s.speechEngineRate&&(t=''),i=''+t+"

    "+i+"

    "+(t?"
    ":"")+""}else i="mac"===s.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?i.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):i.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return i};class xi{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let s=this.element.textContent;s&&(s=s.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?i+="\n \n \n ":i+='',i+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(i+=`"):i+="",i+="",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=i;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=gi("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=gi("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,ui(this.element,"focus",this),ui(this.element,"blur",this),ui(this.textarea,"cut",this),ui(this.textarea,"copy",this),ui(this.textarea,"paste",this),Ne.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?ui(this.field,"pointerdown",this):ui(this.field,"touchstart:active mousedown",this),ui(window,"resize",this);const o={...e};o.onSelectionDidChange=xi.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=xi.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Pe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const s=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=s}}(this.mathlist),s.length>0&&this.$latex(s),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>bi(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,fi(this.textarea,"cut",this),fi(this.textarea,"copy",this),fi(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,yi(this.popover),yi(this.keystrokeCaption),yi(this.virtualKeyboard),yi(document.getElementById("mathlive-alternate-keys-panel")),fi(this.element,"pointerdown",this),fi(this.element,"touchstart:active mousedown",this),fi(this.element,"focus",this),fi(this.element,"blur",this),fi(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let s;return Array.from(e.children).forEach((function(e){s=s||t(e)})),s}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const s=t.getBoundingClientRect();s.lefte.right&&(e.right=s.right),s.bottom>e.bottom&&(e.bottom=s.bottom),s.top=t.left&&s<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,s,i);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(i=de.pathFromString(e[0]).path,0===s.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const i=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=i=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1;const r=this.field.querySelector(".ML__mathlive").getBoundingClientRect();if(s=d>r.right?[{relation:"body",offset:this.mathlist.root.body.length-1}]:this._pathFromPoint(d,p,{bias:0}),s){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,s),s=de.clone(this.mathlist.path),s[s.length-1].offset-=1):this.mathlist.setPath(s,0),o=!0,this.style={},3===t.detail||vi>2?(n(t),3!==t.detail&&3!==vi||this.mathlist.selectAll_()):i||(i=!0,window.PointerEvent?(ui(e.field,"pointermove",h),ui(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(ui(window,"blur",n),t.touches?(ui(t.target,"touchmove",h),ui(t.target,"touchend",n)):(ui(window,"mousemove",h),ui(window,"mouseup",n))),2!==t.detail&&2!==vi||(a=!0,this.mathlist.selectGroup_()))}}else ki=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Ze.hidePopover(this),this.mathlist.removeCommandString())}Ze.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const s=t?t.path:[],i=this.mathlist.path,a=i[i.length-1];let o="";for(;s.length>i.length;)o+="out of "+e(t.parent(),s[s.length-1])+"; ",s.pop();if(!this.mathlist.isCollapsed())return wi(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=wi(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,s)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Ze.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Ze.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const s=this.element.getBoundingClientRect();e.style.left=s.left+"px",e.style.top=s.top-64+"px",e.innerHTML=""+(xe.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,s=!1,i=[],a=!1;if(Array.isArray(t)?(e=t[0],i=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...i),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);0===e.length?Ze.hidePopover(this):Ze.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,s=!0}else"function"==typeof this[e]&&(a=this[e](...i),s=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),s}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let s=0,i=!1;for(this.mathlist.contentWillChange();!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),i||(a.applyStyle({mode:"text"}),a.latex=a.body),s-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let s=0,i=!1;for(;!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),i||a.applyStyle({mode:"math",type:"mord"}),s-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,s=!1;for(;!s;){const i=this.mathlist.sibling(e);s=!(i&&("text"===i.mode&&!i.type||"math"===i.mode&&/mord|textord|mpunct/.test(i.type))),s||(t=i.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(s));const i=this.getTextBeforeAnchor_()+s;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(s))return!0;if(/[\^_]/.test(s))return/(^|\s)[a-zA-Z][^_]$/.test(i)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[s];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(i))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(s))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(i))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(i)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(i))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(s))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(i)&&!/(dxd|abc|xyz|uvw)$/.test(i))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(i))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(i)&&!/(αβγ)$/.test(i))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(s))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let s,i,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=Ne.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!s&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const i=this.mode;s?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==i&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(s||a||(a=xe.selectorForKeystroke(this.mode,t)),!s&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!s){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||s)&&s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(Ne.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const s=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[i],{...this.config,suppressChangeNotifications:!0}),this.mode=s}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(s,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),s.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),s=Ne.charToEvent(e);if(!this.$keystroke(Ne.keyboardEventToString(s),s))return}let s="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=i(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),i=wt.suggest(e+t);a=i.length>1,0===i.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Ze.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),i[0].match!==e+t&&this.mathlist.insertSuggestion(i[0].match,-i[0].match.length+e.length+1),s=i[0].match)}else if("math"===this.mode){const s={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(s){if("moveToSuperscript"===s){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===s&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(s)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Ze.showPopoverWithLatex(this,s,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let s=0;sbi(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,s=!1;for(;t&&!s;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,s=!0),e+=1,t=this.mathlist.ancestor(e)}const s=Yt.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),i=N.makeSpan(s,"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",i.height,"em");const o=[a];if(0!==i.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",i.height+i.depth,"em"),t.setStyle("vertical-align",-i.depth,"em"),o.push(t)}o.push(i);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+Yt.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let s="";if("latex"===(e=e||"latex")||"latex-expanded"===e)s=t.toLatex("latex-expanded"===e);else if("mathML"===e)s=t.toMathML(this.config);else if("spoken"===e)s=Yt.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",s=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const i=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),s=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=i,this.config.generateID=a}else if("json"===e){const e=Yt.toAST(t,this.config);s=JSON.stringify(e)}else"ASCIIMath"===e&&(s=function t(e,s){if(!e)return"";if(Array.isArray(e)){let s="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let i=0;for(s='"';e[i]&&"text"===e[i].mode;)s+=e[i].body,i++;s+='"'+t(e.slice(i))}else{let i=0;for(;e[i]&&"math"===e[i].mode;)s+=t(e[i]),i++;s+=t(e.slice(i))}return s.trim()}if("text"===e.mode)return'"'+e.body+'"';let i="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":i=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(i+="(",i+=t(e.numer),i+=")/(",i+=t(e.denom),i+=")"):(i+="("+t(e.numer)+"),",i+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?i+="root("+t(e.index)+")("+t(e.body)+")":i+="sqrt("+t(e.body)+")";break;case"leftright":i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",i+=t(e.body),i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":i=ls[a]||a||("string"==typeof e.body?e.body:""),"\\"===i[0]&&(i+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?i=String.fromCharCode(parseInt("0x"+o[1])):i.length>0&&"\\"===i.charAt(0)&&(i="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":i=a&&ls[a]?ls[a]:a&&cs[a]?cs[a]:e.body;break;case"mopen":case"mclose":i+=e.body;break;case"mpunct":i=cs[a]||a;break;case"mop":"​"!==e.body&&(i="",i+="\\operatorname"===a?t(e.body):e.body||a,i+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":i=" "}if(e.subscript){i+="_";const s=t(e.subscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}if(e.superscript){i+="^";const s=t(e.superscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}return i}(t,this.config));return s}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const s=Yt.makeRoot("math",e);return this.formatMathlist(s,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!0:s.subscript&&(i=!1),e+=1,s=this.mathlist.ancestor(e);return i?t:0}_subscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!1:s.subscript&&(i=!0),e+=1,s=this.mathlist.ancestor(e);return i?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const s=this._getSelectionBounds();s&&(t={x:s.right+e.left-this.field.scrollLeft,y:s.top+e.top-this.field.scrollTop})}if(t){const s=t.x-window.scrollX;se.right&&this.field.scroll({top:0,left:s-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const s=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=s)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,s){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Ze.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,s&&this.$insert(s,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Ze.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(wt.commandAllowed(t,e)){const s=le.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(s)}else{const s=le.parseTokens(n(e),t,null,this.config.macros);s?this.mathlist.spliceCommandStringAroundInsertionPoint(s):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);if(0===e.length)Ze.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const s=this.suggestionIndex%e.length,i=t.length-e[s].match.length;0!==i&&this.mathlist.insertSuggestion(e[s].match,i),Ze.showPopoverWithLatex(this,e[s].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const s=this;let i,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),ui(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),i=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+s.config.namespace+"command-pressed");n&&s.$perform(JSON.parse(n));const l=t.getAttribute("data-"+s.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&s.$perform(JSON.parse(l))}),300))}})),ui(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),ui(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?s.style.width="286px":4===e.length||2===e.length?s.style.width="146px":1===e.length?s.style.width="86px":s.style.width="146px",s.style.height="auto";let i="";for(const t of e)i+="";i="
      "+i+"
    ",s.innerHTML=i,rs.makeKeycap(this,s.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-s.clientHeight<0&&(s.style.width="auto",e.length<=6?s.style.height="56px":e.length<=12?s.style.height="108px":s.style.height="205px");const t=(a.top-s.clientHeight+5).toString()+"px",i=Math.max(0,Math.min(window.innerWidth-s.offsetWidth,(a.left+a.right-s.offsetWidth)/2))+"px";s.style.transform="translate("+i+","+t+")",s.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",yi(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let s=!1;for(let i=0;i=1){s=[];for(let t=1;t<=i;t++)s.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),i=t.mathlist.endOffset()+1;if(i<=e.length-1){s=[];for(let t=i;t<=e.length-1;t++)s.push(e[t])}break}case"start":case"end":break;case"group":s=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(s=t.mathlist.parent());break}}return s}(this,t);if(null===s)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const i={...this.config};(e.withHighlighting||"amazon"===i.speechEngine)&&(i.textToSpeechMarkup=window.sre&&"sre"===i.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(i.generateID=!0));const a=Yt.toSpeakableText(s,i);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,i),!1}}let ki,vi=0;function wi(t,e,s){const i=Object.assign({},t.config);return i.textToSpeechMarkup="",i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup="none",e+Yt.toSpeakableText(s,i)}function Si(t,e,s,i){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=wi(t,"deleted: ",i):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(s):"replacement"===e?a=wi(t,"",t.mathlist.sibling(0)):"line"===e?(a=wi(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+Yt.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=i?wi(t,e+" ",i):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}xi.prototype.undo_=xi.prototype.undo,xi.prototype.redo_=xi.prototype.redo,xi.prototype.scrollIntoView_=xi.prototype.scrollIntoView,xi.prototype.scrollToStart_=xi.prototype.scrollToStart,xi.prototype.scrollToEnd_=xi.prototype.scrollToEnd,xi.prototype.insert_=xi.prototype.$insert;var Ai={isValidMathfield:bi,MathField:xi};function Mi(t,e,s){let i=s,a=0;const o=t.length;for(;i0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=Mi(s,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+s.length),mathstyle:i}),c=r+s.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){s.textContent=t}return s.className="sr-only",s}(t,s)),/\bspeakable-text\b/i.test(s.renderAccessibleContent)&&s.renderToSpeakableText){const i=document.createElement("span");i.innerHTML=s.renderToSpeakableText(t,s),i.className="sr-only",e.appendChild(i)}return e.appendChild(a),e}return a}function Li(t,e){let s=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))s=document.createDocumentFragment(),s.appendChild(Ti(t,void 0,e,!0));else{const i=_i(t,e.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;s=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Pi(t,e,s){if(!window)return;if(!s&&window.mathlive&&(s=window.mathlive.config),"amazon"!==(s=s||{}).speechEngine)return void(s.handleSpeak&&s.handleSpeak(e));if(!window.AWS)return;const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:s.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=s.onReadAloudStatus||window.mathlive.onReadAloudStatus;i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),s=new Blob([t.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(s);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const s of window.mathlive.readAloudMarks)s.time0&&Array.from(e.children).forEach(e=>{t(e,s)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=i,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function Bi(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Oi(t,e){Di&&((e=e||{}).renderToMarkup=e.renderToMarkup||zi,e.renderToMathML=e.renderToMathML||Ei,e.renderToSpeakableText=e.renderToSpeakableText||qi,e.macros=e.macros||wt.MACROS,Di.renderMathInElement(Bi(t),e))}function $i(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const Ri={latexToMarkup:zi,latexToMathML:Ei,latexToSpeakableText:qi,latexToAST:function(t,e){if(!Yt.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,wt.MACROS);const s=le.parseTokens(n(t),"math",null,e.macros);return Yt.toAST(s,e)},astToLatex:function(t,e){return hi(t,e)},makeMathField:function(t,e){if(!Ai)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Ii,e.handleReadAloud=e.handleReadAloud||Pi,new Ai.MathField(Bi(t),e)},renderMathInDocument:function(t){Oi(document.body,t)},renderMathInElement:Oi,revertToOriginalContent:function(t,e){(t=(t=Bi(t)).children[1])instanceof Ai.MathField?t.revertToOriginalContent():($i(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Bi(t)).children[1])instanceof Ai.MathField?t.originalContent:($i(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Pi,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let s=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(s=e.time/1e3);let i=window.mathlive.readAloudTokens.indexOf(t);i>=0&&(i+=e,i2,000 Note: additional spaces around the arrows - nicefrac: '^{#1}\\!\\!/\\!_{#2}', - - // From bracket.sty, Diract notation - bra: '\\mathinner{\\langle{#1}|}', - ket: '\\mathinner{|{#1}\\rangle}', - braket: '\\mathinner{\\langle{#1}\\rangle}', - set: '\\mathinner{\\lbrace #1 \\rbrace}', - Bra: '\\left\\langle #1\\right|', - Ket: '\\left|#1\\right\\rangle', - Braket: '\\left\\langle{#1}\\right\\rangle', - Set: '\\left\\lbrace #1 \\right\\rbrace', -}; - -const RIGHT_DELIM = { - '(': ')', - '{': '}', - '[': ']', - '|': '|', - '\\lbrace': '\\rbrace', - '\\{': '\\}', - '\\langle': '\\rangle', - '\\lfloor': '\\rfloor', - '\\lceil': '\\rceil', - '\\vert': '\\vert', - '\\lvert': '\\rvert', - '\\Vert': '\\Vert', - '\\lVert': '\\rVert', - '\\lbrack': '\\rbrack', - '\\ulcorner': '\\urcorner', - '\\llcorner': '\\lrcorner', - '\\lgroup': '\\rgroup', - '\\lmoustache': '\\rmoustache', -}; - -// Frequency of a symbol. -// String constants corresponding to frequency values, -// which are the number of results returned by latexsearch.com -// When the precise number is known, it is provided. Otherwise, -// the following constants are used to denote an estimate. -const CRYPTIC = 'CRYPTIC'; -const ARCANE = 'ARCANE'; -// const VERY_RARE = 'VERY_RARE'; -const RARE = 'RARE'; -const UNCOMMON = 'UNCOMMON'; -const COMMON = 'COMMON'; -const SUPERCOMMON = 'SUPERCOMMON'; - -/** - * @type {Object.} - * @private - */ -const FREQUENCY_VALUE = { - CRYPTIC: 0, - ARCANE: 200, - VERY_RARE: 600, - RARE: 1200, - UNCOMMON: 2000, - COMMON: 3000, - SUPERCOMMON: 4000, -}; - -/** - * Set the frequency of the specified symbol. - * Default frequency is UNCOMMON - * The argument list is a frequency value, followed by one or more symbol strings - * For example: - * frequency(COMMON , '\\sin', '\\cos') - * @param {string|number} value The frequency as a string constant, - * or a numeric value [0...2000] - * @param {...string} - * @memberof module:definitions - * @private - */ -function frequency(value, ...symbols) { - const v = typeof value === 'string' ? FREQUENCY_VALUE[value] : value; - - for (const symbol of symbols) { - if (MATH_SYMBOLS[symbol]) { - MATH_SYMBOLS[symbol].frequency = v; - } - if (FUNCTIONS[symbol]) { - // Make a copy of the entry, since it could be shared by multiple - // symbols - FUNCTIONS[symbol] = Object.assign({}, FUNCTIONS[symbol]); - FUNCTIONS[symbol].frequency = v; - } - } -} - -/** - * - * @param {string} latexName The common LaTeX command for this symbol - * @param {(string|string[])} mode - * @param {string} fontFamily - * @param {string} type - * @param {string} value - * @param {(number|string)} [frequency] - * @memberof module:definitions - * @private - */ -function defineSymbol(latexName, fontFamily, type, value, frequency) { - if (fontFamily && !/^(ams|cmr|bb|cal|frak|scr)$/.test(fontFamily)) { - console.log(fontFamily, latexName); - } - // Convert a frequency constant to a numerical value - if (typeof frequency === 'string') frequency = FREQUENCY_VALUE[frequency]; - MATH_SYMBOLS[latexName] = { - type: type === ORD ? MATHORD : type, - baseFontFamily: fontFamily, - value: value, - category: category, // To group items when generating the documentation - frequency: frequency, - }; -} - -/** - * Define a set of single-character symbols and all their attributes. - * The value associated with the symbol is the symbol itself. - * @param {string} string a string of single character symbols - * @param {string} mode - * @param {string} fontFamily - * @param {string} type - * @param {(string|number)} [frequency] - * @memberof module:definitions - * @private - */ -function defineSymbols(string) { - for (let i = 0; i < string.length; i++) { - const ch = string.charAt(i); - defineSymbol(ch, '', MATHORD, ch); - } -} - -/** - * Define a set of single-character symbols as a range of Unicode codepoints - * @param {number} from First Unicode codepoint - * @param {number} to Last Unicode codepoint - * @memberof module:definitions - * @private - */ -function defineSymbolRange(from, to) { - for (let i = from; i <= to; i++) { - const ch = String.fromCodePoint(i); - defineSymbol(ch, '', 'mord', ch); - } -} - -const CODEPOINT_SHORTCUTS = { - 8739: '|', - 0x00b7: '\\cdot', - 0x00bc: '\\frac{1}{4}', - 0x00bd: '\\frac{1}{2}', - 0x00be: '\\frac{3}{4}', - 0x2070: '^{0}', - 0x2071: '^{i}', - 0x00b9: '^{1}', - 0x00b2: '^{2}', - 0x00b3: '^{3}', - 0x2074: '^{4}', - 0x2075: '^{5}', - 0x2076: '^{6}', - 0x2077: '^{7}', - 0x2078: '^{8}', - 0x2079: '^{9}', - 0x207a: '^{+}', - 0x207b: '^{-}', - 0x207c: '^{=}', - 0x207f: '^{n}', - - 0x2080: '_{0}', - 0x2081: '_{1}', - 0x2082: '_{2}', - 0x2083: '_{3}', - 0x2084: '_{4}', - 0x2085: '_{5}', - 0x2086: '_{6}', - 0x2087: '_{7}', - 0x2088: '_{8}', - 0x2089: '_{9}', - 0x208a: '_{+}', - 0x208b: '_{-}', - 0x208c: '_{=}', - 0x2090: '_{a}', - 0x2091: '_{e}', - 0x2092: '_{o}', - 0x2093: '_{x}', - - 0x2032: '\\prime', - 0x2033: '\\doubleprime', - 0x2220: '\\angle', - - 0x2102: '\\C', - 0x2115: '\\N', - 0x2119: '\\P', - 0x211a: '\\Q', - 0x211d: '\\R', - 0x2124: '\\Z', -}; - -/** - * Given a character, return a LaTeX expression matching its Unicode codepoint. - * If there is a matching symbol (e.g. \alpha) it is returned. - * @param {string} parseMode - * @param {number} cp - * @return {string} - * @memberof module:definitions - * @private - */ -function matchCodepoint(parseMode, cp) { - const s = String.fromCodePoint(cp); - - // Some symbols map to multiple codepoints. - // Some symbols are 'pseudosuperscript'. Convert them to a super(or sub)script. - // Map their alternative codepoints here. - if (parseMode === 'math' && CODEPOINT_SHORTCUTS[s]) - return CODEPOINT_SHORTCUTS[s]; - - // Don't map 'simple' code point. - // For example "C" maps to \doubleStruckCapitalC, not the desired "C" - if (cp > 32 && cp < 127) return s; - - let result = ''; - if (parseMode === 'math') { - for (const p in MATH_SYMBOLS) { - if (Object.prototype.hasOwnProperty.call(MATH_SYMBOLS, p)) { - if (MATH_SYMBOLS[p].value === s) { - result = p; - break; - } - } - } - } else { - for (const p in TEXT_SYMBOLS) { - if (Object.prototype.hasOwnProperty.call(TEXT_SYMBOLS, p)) { - if (TEXT_SYMBOLS[p] === s) { - result = p; - break; - } - } - } - } - - return result || s; -} - -/** - * Given a Unicode character returns {char:, variant:, style} corresponding - * to this codepoint. `variant` is optional. - * This maps characters such as "blackboard uppercase C" to - * {char: 'C', variant: 'double-struck', style:''} - * @param {string} char - */ - -/* Some symbols in the MATHEMATICAL ALPHANUMERICAL SYMBOLS block had - been previously defined in other blocks. Remap them */ -const MATH_LETTER_EXCEPTIONS = { - 0x1d455: 0x0210e, - 0x1d49d: 0x0212c, - 0x1d4a0: 0x02130, - 0x1d4a1: 0x02131, - 0x1d4a3: 0x0210b, - 0x1d4a4: 0x02110, - 0x1d4a7: 0x02112, - 0x1d4a8: 0x02133, - 0x1d4ad: 0x0211b, - 0x1d4ba: 0x0212f, - 0x1d4bc: 0x0210a, - 0x1d4c4: 0x02134, - 0x1d506: 0x0212d, - 0x1d50b: 0x0210c, - 0x1d50c: 0x02111, - 0x1d515: 0x0211c, - 0x1d51d: 0x02128, - 0x1d53a: 0x02102, - 0x1d53f: 0x0210d, - 0x1d545: 0x02115, - 0x1d547: 0x02119, - 0x1d548: 0x0211a, - 0x1d549: 0x0211d, - 0x1d551: 0x02124, -}; - -const MATH_UNICODE_BLOCKS = [ - { start: 0x1d400, len: 26, offset: 65, style: 'bold' }, - { start: 0x1d41a, len: 26, offset: 97, style: 'bold' }, - { start: 0x1d434, len: 26, offset: 65, style: 'italic' }, - { start: 0x1d44e, len: 26, offset: 97, style: 'italic' }, - { start: 0x1d468, len: 26, offset: 65, style: 'bolditalic' }, - { start: 0x1d482, len: 26, offset: 97, style: 'bolditalic' }, - - { start: 0x1d49c, len: 26, offset: 65, variant: 'script' }, - { start: 0x1d4b6, len: 26, offset: 97, variant: 'script' }, - { start: 0x1d4d0, len: 26, offset: 65, variant: 'script', style: 'bold' }, - { start: 0x1d4ea, len: 26, offset: 97, variant: 'script', style: 'bold' }, - - { start: 0x1d504, len: 26, offset: 65, variant: 'fraktur' }, - { start: 0x1d51e, len: 26, offset: 97, variant: 'fraktur' }, - { start: 0x1d56c, len: 26, offset: 65, variant: 'fraktur', style: 'bold' }, - { start: 0x1d586, len: 26, offset: 97, variant: 'fraktur', style: 'bold' }, - - { start: 0x1d538, len: 26, offset: 65, variant: 'double-struck' }, - { start: 0x1d552, len: 26, offset: 97, variant: 'double-struck' }, - - { start: 0x1d5a0, len: 26, offset: 65, variant: 'sans-serif' }, - { start: 0x1d5ba, len: 26, offset: 97, variant: 'sans-serif' }, - { - start: 0x1d5d4, - len: 26, - offset: 65, - variant: 'sans-serif', - style: 'bold', - }, - { - start: 0x1d5ee, - len: 26, - offset: 97, - variant: 'sans-serif', - style: 'bold', - }, - { - start: 0x1d608, - len: 26, - offset: 65, - variant: 'sans-serif', - style: 'italic', - }, - { - start: 0x1d622, - len: 26, - offset: 97, - variant: 'sans-serif', - style: 'italic', - }, - { - start: 0x1d63c, - len: 26, - offset: 65, - variant: 'sans-serif', - style: 'bolditalic', - }, - { - start: 0x1d656, - len: 26, - offset: 97, - variant: 'sans-serif', - style: 'bolditalic', - }, - - { start: 0x1d670, len: 26, offset: 65, variant: 'monospace' }, - { start: 0x1d68a, len: 26, offset: 97, variant: 'monospace' }, - - { start: 0x1d6a8, len: 25, offset: 0x391, style: 'bold' }, - { start: 0x1d6c2, len: 25, offset: 0x3b1, style: 'bold' }, - { start: 0x1d6e2, len: 25, offset: 0x391, style: 'italic' }, - { start: 0x1d6fc, len: 25, offset: 0x3b1, style: 'italic' }, - { start: 0x1d71c, len: 25, offset: 0x391, style: 'bolditalic' }, - { start: 0x1d736, len: 25, offset: 0x3b1, style: 'bolditalic' }, - { - start: 0x1d756, - len: 25, - offset: 0x391, - variant: 'sans-serif', - style: 'bold', - }, - { - start: 0x1d770, - len: 25, - offset: 0x3b1, - variant: 'sans-serif', - style: 'bold', - }, - { - start: 0x1d790, - len: 25, - offset: 0x391, - variant: 'sans-serif', - style: 'bolditalic', - }, - { - start: 0x1d7aa, - len: 25, - offset: 0x3b1, - variant: 'sans-serif', - style: 'bolditalic', - }, - - { start: 0x1d7ce, len: 10, offset: 48, variant: '', style: 'bold' }, - { start: 0x1d7d8, len: 10, offset: 48, variant: 'double-struck' }, - { start: 0x1d7e3, len: 10, offset: 48, variant: 'sans-serif' }, - { - start: 0x1d7ec, - len: 10, - offset: 48, - variant: 'sans-serif', - style: 'bold', - }, - { start: 0x1d7f6, len: 10, offset: 48, variant: 'monospace' }, -]; - -function unicodeToMathVariant(char) { - let codepoint = char; - if (typeof char === 'string') codepoint = char.codePointAt(0); - if ( - (codepoint < 0x1d400 || codepoint > 0x1d7ff) && - (codepoint < 0x2100 || codepoint > 0x214f) - ) { - return { char: char }; - } - - // Handle the 'gap' letters by converting them back into their logical range - for (const c in MATH_LETTER_EXCEPTIONS) { - if (Object.prototype.hasOwnProperty.call(MATH_LETTER_EXCEPTIONS, c)) { - if (MATH_LETTER_EXCEPTIONS[c] === codepoint) { - codepoint = c; - break; - } - } - } - - for (let i = 0; i < MATH_UNICODE_BLOCKS.length; i++) { - if ( - codepoint >= MATH_UNICODE_BLOCKS[i].start && - codepoint < - MATH_UNICODE_BLOCKS[i].start + MATH_UNICODE_BLOCKS[i].len - ) { - return { - char: String.fromCodePoint( - codepoint - - MATH_UNICODE_BLOCKS[i].start + - MATH_UNICODE_BLOCKS[i].offset - ), - variant: MATH_UNICODE_BLOCKS[i].variant, - style: MATH_UNICODE_BLOCKS[i].style, - }; - } - } - - return { char: char }; -} - -/** - * Given a character and variant ('bb', 'cal', etc...) - * return the corresponding unicode character (a string) - * @param {string} char - * @param {string} variant - * @memberof module:definitions - * @private - */ -function mathVariantToUnicode(char, variant, style) { - if (!/[A-Za-z0-9]/.test(char)) return char; - if (!variant && !style) return char; - - const codepoint = char.codePointAt(0); - - for (let i = 0; i < MATH_UNICODE_BLOCKS.length; i++) { - if (!variant || MATH_UNICODE_BLOCKS[i].variant === variant) { - if (!style || MATH_UNICODE_BLOCKS[i].style === style) { - if ( - codepoint >= MATH_UNICODE_BLOCKS[i].offset && - codepoint < - MATH_UNICODE_BLOCKS[i].offset + - MATH_UNICODE_BLOCKS[i].len - ) { - const result = - MATH_UNICODE_BLOCKS[i].start + - codepoint - - MATH_UNICODE_BLOCKS[i].offset; - return String.fromCodePoint( - MATH_LETTER_EXCEPTIONS[result] || result - ); - } - } - } - } - - return char; -} - -function codepointToLatex(parseMode, cp) { - // Codepoint shortcuts have priority over variants - // That is, "\N" vs "\mathbb{N}" - if (parseMode === 'text') return String.fromCodePoint(cp); - - let result; - if (CODEPOINT_SHORTCUTS[cp]) return CODEPOINT_SHORTCUTS[cp]; - const v = unicodeToMathVariant(cp); - if (!v.style && !v.variant) return matchCodepoint(parseMode, cp); - result = v.char; - if (v.variant) { - result = '\\' + v.variant + '{' + result + '}'; - } - if (v.style === 'bold') { - result = '\\mathbf{' + result + '}'; - } else if (v.style === 'italic') { - result = '\\mathit{' + result + '}'; - } else if (v.style === 'bolditalic') { - result = '\\mathbf{\\mathit{' + result + '}}'; - } - return '\\mathord{' + result + '}'; -} - -function unicodeStringToLatex(parseMode, s) { - let result = ''; - for (const cp of s) { - result += codepointToLatex(parseMode, cp.codePointAt(0)); - } - return result; -} - -/** - * - * @param {string} mode - * @param {string} command - * @return {boolean} True if command is allowed in the mode - * (note that command can also be a single character, e.g. "a") - * @memberof module:definitions - * @private - */ -function commandAllowed(mode, command) { - if ( - FUNCTIONS[command] && - (mode !== 'text' || FUNCTIONS[command].allowedInText) - ) { - return true; - } - - if ({ text: TEXT_SYMBOLS, math: MATH_SYMBOLS }[mode][command]) { - return true; - } - - return false; -} - -function getValue(mode, symbol) { - if (mode === 'math') { - return MATH_SYMBOLS[symbol] && MATH_SYMBOLS[symbol].value - ? MATH_SYMBOLS[symbol].value - : symbol; - } - return TEXT_SYMBOLS[symbol] ? TEXT_SYMBOLS[symbol] : symbol; -} - -function getEnvironmentInfo(name) { - let result = ENVIRONMENTS[name]; - if (!result) { - result = { - params: '', - parser: null, - mathstyle: 'displaystyle', - tabular: true, - colFormat: [], - lFence: '.', - rFence: '.', - // arrayStretch: 1, - }; - } - return result; -} - -/** - * @param {string} symbol A command (e.g. '\alpha') or a character (e.g. 'a') - * @param {string} parseMode One of 'math' or 'text' - * @param {object} macros A macros dictionary - * @return {object} An info structure about the symbol, or null - * @memberof module:definitions - * @private - */ -function getInfo(symbol, parseMode, macros) { - if (symbol.length === 0) return null; - - let info = null; - - if (symbol.charAt(0) === '\\') { - // This could be a function or a symbol - info = FUNCTIONS[symbol]; - if (info) { - // We've got a match - if (parseMode === 'math' || info.allowedInText) return info; - - // That's a valid function, but it's not allowed in non-math mode, - // and we're in non-math mode - return null; - } - - if (!info) { - // It wasn't a function, maybe it's a symbol? - if (parseMode === 'math') { - info = MATH_SYMBOLS[symbol]; - } else if (TEXT_SYMBOLS[symbol]) { - info = { value: TEXT_SYMBOLS[symbol] }; - } - } - - if (!info) { - // Maybe it's a macro - const command = symbol.slice(1); - if (macros && macros[command]) { - let def = macros[command]; - if (typeof def === 'object') { - def = def.def; - } - let argCount = 0; - // Let's see if there are arguments in the definition. - if (/(^|[^\\])#1/.test(def)) argCount = 1; - if (/(^|[^\\])#2/.test(def)) argCount = 2; - if (/(^|[^\\])#3/.test(def)) argCount = 3; - if (/(^|[^\\])#4/.test(def)) argCount = 4; - if (/(^|[^\\])#5/.test(def)) argCount = 5; - if (/(^|[^\\])#6/.test(def)) argCount = 6; - if (/(^|[^\\])#7/.test(def)) argCount = 7; - if (/(^|[^\\])#8/.test(def)) argCount = 8; - if (/(^|[^\\])#9/.test(def)) argCount = 9; - info = { - type: 'group', - allowedInText: false, - params: [], - infix: false, - }; - while (argCount >= 1) { - info.params.push({ - optional: false, - type: 'math', - defaultValue: null, - placeholder: null, - }); - argCount -= 1; - } - } - } - } else { - if (parseMode === 'math') { - info = MATH_SYMBOLS[symbol]; - } else if (TEXT_SYMBOLS[symbol]) { - info = { value: TEXT_SYMBOLS[symbol] }; - } - } - - // Special case `f`, `g` and `h` are recognized as functions. - if ( - info && - info.type === 'mord' && - (info.value === 'f' || info.value === 'g' || info.value === 'h') - ) { - info.isFunction = true; - } - - return info; -} - -/** - * Return an array of suggestion for completing string 's'. - * For example, for 'si', it could return ['sin', 'sinh', 'sim', 'simeq', 'sigma'] - * Infix operators are excluded, since they are deprecated commands. - * @param {string} s - * @return {string[]} - * @memberof module:definitions - * @private - */ -function suggest(s) { - if (s.length <= 1) return []; - const result = []; - - // Iterate over items in the dictionary - for (const p in FUNCTIONS) { - if (Object.prototype.hasOwnProperty.call(FUNCTIONS, p)) { - if (p.startsWith(s) && !FUNCTIONS[p].infix) { - result.push({ match: p, frequency: FUNCTIONS[p].frequency }); - } - } - } - - for (const p in MATH_SYMBOLS) { - if (Object.prototype.hasOwnProperty.call(MATH_SYMBOLS, p)) { - if (p.startsWith(s)) { - result.push({ match: p, frequency: MATH_SYMBOLS[p].frequency }); - } - } - } - - result.sort((a, b) => { - if (a.frequency === b.frequency) { - return a.match.length - b.match.length; - } - return (b.frequency || 0) - (a.frequency || 0); - }); - - return result; -} - -// Fonts -const MAIN = ''; // The "main" KaTeX font (in fact one of several -// depending on the math variant, size, etc...) -const AMS = 'ams'; // Some symbols are not in the "main" KaTeX font -// or have a different glyph available in the "AMS" -// font (`\hbar` and `\hslash` for example). - -// Type -const ORD = 'mord'; -const MATHORD = 'mord'; // Ordinary, e.g. '/' -const BIN = 'mbin'; // e.g. '+' -const REL = 'mrel'; // e.g. '=' -const OPEN = 'mopen'; // e.g. '(' -const CLOSE = 'mclose'; // e.g. ')' -const PUNCT = 'mpunct'; // e.g. ',' -const INNER = 'minner'; // for fractions and \left...\right. - -// const ACCENT = 'accent'; -const SPACING = 'spacing'; - -/** - * An argument template has the following syntax: - * - * := - * - * where - * - is a string whose value is displayed when the argument - * is missing - * - is one of 'string', 'color', 'dimen', 'auto', 'text', 'math' - * - is the default value if none is provided for an optional - * parameter - * - * @param {string} argTemplate - * @param {boolean} isOptional - * @memberof module:definitions - * @private - */ -function parseParamTemplateArgument(argTemplate, isOptional) { - let r = argTemplate.match(/=(.+)/); - let defaultValue = '{}'; - let type = 'auto'; - let placeholder = null; - - if (r) { - console.assert( - isOptional, - "Can't provide a default value for required parameters" - ); - defaultValue = r[1]; - } - // Parse the type (:type) - r = argTemplate.match(/:([^=]+)/); - if (r) type = r[1].trim(); - - // Parse the placeholder - r = argTemplate.match(/^([^:=]+)/); - if (r) placeholder = r[1].trim(); - - return { - optional: isOptional, - type: type, - defaultValue: defaultValue, - placeholder: placeholder, - }; -} - -function parseParamTemplate(paramTemplate) { - if (!paramTemplate || paramTemplate.length === 0) return []; - - let result = []; - let params = paramTemplate.split(']'); - if (params[0].charAt(0) === '[') { - // We found at least one optional parameter. - result.push(parseParamTemplateArgument(params[0].slice(1), true)); - // Parse the rest - for (let i = 1; i <= params.length; i++) { - result = result.concat(parseParamTemplate(params[i])); - } - } else { - params = paramTemplate.split('}'); - if (params[0].charAt(0) === '{') { - // We found a required parameter - result.push(parseParamTemplateArgument(params[0].slice(1), false)); - // Parse the rest - for (let i = 1; i <= params.length; i++) { - result = result.concat(parseParamTemplate(params[i])); - } - } - } - - return result; -} - -function parseArgAsString(arg) { - return arg.map(x => x.body).join(''); -} - -/** - * Define one or more environments to be used with - * \begin{}...\end{}. - * - * @param {string|string[]} names - * @param {string} params The number and type of required and optional parameters. - * @param {object} options - * - - * @param {function(*)} parser - * @memberof module:definitions - * @private - */ -function defineEnvironment(names, params, options, parser) { - if (typeof names === 'string') names = [names]; - if (!options) options = {}; - const parsedParams = parseParamTemplate(params); - - // Set default values of functions - const data = { - // 'category' is a global variable keeping track of the - // the current category being defined. This value is used - // strictly to group items in generateDocumentation(). - category: category, - - // Params: the parameters for this function, an array of - // {optional, type, defaultValue, placeholder} - params: parsedParams, - - // Callback to parse the arguments - parser: parser, - - mathstyle: 'displaystyle', - - tabular: options.tabular || true, - colFormat: options.colFormat || [], - }; - for (const name of names) { - ENVIRONMENTS[name] = data; - } -} - -/** - * Define one of more functions. - * - * @param {string|string[]} names - * @param {string} params The number and type of required and optional parameters. - * For example: '{}' defines a single mandatory parameter - * '[index=2]{indicand:auto}' defines two params, one optional, one required - - * @param {object} options - * - infix - * - allowedInText - * @param {function} parseFunction - * @memberof module:definitions - * @private - */ -function defineFunction(names, params, options, parseFunction) { - if (typeof names === 'string') { - names = [names]; - } - - if (!options) options = {}; - - // Set default values of functions - const data = { - // 'category' is a global variable keeping track of the - // the current category being defined. This value is used - // strictly to group items in generateDocumentation(). - category: category, - - // The base font family, if present, indicates that this font family - // should always be used to render atom. For example, functions such - // as "sin", etc... are always drawn in a roman font, - // regardless of the font styling a user may specify. - baseFontFamily: options.fontFamily, - - // The parameters for this function, an array of - // {optional, type, defaultValue, placeholder} - params: parseParamTemplate(params), - - allowedInText: !!options.allowedInText, - infix: !!options.infix, - parse: parseFunction, - }; - for (const name of names) { - FUNCTIONS[name] = data; - } -} - -category = 'Environments'; -/* - - ::= * - ::= ('l'|'c'|'r') - ::= '|' | '||' | '' - -'math', - frequency 0 -'displaymath', - frequency 8 - -'equation' centered, numbered - frequency 8 - -'subequations' with an 'equation' environment, appends a letter to eq no - frequency 1 - -'array', {columns:text} - cells are textstyle math - no fence - -'eqnarray' DEPRECATED see http://www.tug.org/pracjourn/2006-4/madsen/madsen.pdf - {rcl} - first and last cell in each row is displaystyle math - each cell has a margin of \arraycolsep - Each line has a eqno - frequency 7 - - -'theorem' text mode. Prepends in bold 'Theorem ', then body in italics. - -'multline' single column - first row left aligned, last right aligned, others centered - last line has an eqn. counter. multline* will omit the counter - no output if inside an equation - - -'gather' at most two columns - first column centered, second column right aligned - frequency 1 - -'gathered' must be in equation environment - single column, - centered - frequency: COMMON - optional argument: [b], [t] to vertical align - -'align' multiple columns, - alternating rl - there is some 'space' (additional column?) between each pair - each line is numbered (except when inside an equation environment) - there is an implicit {} at the beginning of left columns - -'aligned' must be in equation environment - frequency: COMMON - @{}r@{}l@{\quad}@{}r@{}l@{} - -'split' must be in an equation environment, - two columns, additional columns are interpreted as line breaks - first column is right aligned, second column is left aligned - entire construct is numbered (as opposed to 'align' where each line is numbered) - frequency: 0 - - -'alignedat' -From AMSMath: ----The alignedat environment was changed to take two arguments rather -than one: a mandatory argument (as formerly) specifying the number of -align structures, and a new optional one specifying the placement of the -environment (parallel to the optional argument of aligned). However, -aligned is simpler to use, allowing any number of aligned structures -automatically, and therefore the use of alignedat is deprecated. - - - 'alignat' {pairs:number} - {rl} alternating as many times as indicated by arg - no space between column pairs (unlike align) - there is an implicit {} at the beginning of left columns - frequency: 0 - - 'flalign' multiple columns - alternate rl - third column further away than align...? - frequency: 0 - - -'matrix' at most 10 columns - cells centered - no fence - no colsep at beginning or end - (mathtools package add an optional arg for the cell alignment) - frequency: COMMON - -'pmatrix' fence: () - frequency: COMMON - -'bmatrix' fence: [] - frequency: COMMON - -'Bmatrix' fence: {} - frequency: 237 - -'vmatrix' fence: \vert - frequency: 368 - -'Vmatrix' fence: \Vert - frequency: 41 - -'smallmatrix' displaystyle: scriptstyle (?) - frequency: 279 - -'cases' - frequency: COMMON - l@{2}l - -'center' text mode only? - frequency: ? -*/ -// See https://en.wikibooks.org/wiki/LaTeX/Mathematics -// and http://www.ele.uri.edu/faculty/vetter/Other-stuff/latex/Mathmode.pdf - -/* -The star at the end of the name of a displayed math environment causes that -the formula lines won't be numbered. Otherwise they would automatically get a number. - -\notag will also turn off the numbering. -\shoveright and \shoveleft will force alignment of a line - -The only difference between align and equation is the spacing of the formulas. -You should attempt to use equation when possible, and align when you have multi-line formulas. -Equation will have space before/after < 1em if line before/after is short enough. - -Also: equation throws an error when you have an & inside the environment, -so look out for that when converting between the two. - - - -Whereas align produces a structure whose width is the full line width, aligned -gives a width that is the actual width of the contents, thus it can be used as -a component in a containing expression, e.g. for putting the entire alignment -in a parenthesis -*/ -defineEnvironment('math', '', { frequency: 0 }, function() { - return { mathstyle: 'textstyle' }; -}); - -defineEnvironment( - 'displaymath', - '', - { - frequency: 8, - }, - function() { - return { - mathstyle: 'displaystyle', - }; - } -); - -// defineEnvironment('text', '', { -// frequency: 0, -// }, function(name, args) { -// return { -// mathstyle: 'text', // @todo: not quite right, not a style, a parsemode... -// }; -// }); - -defineEnvironment( - 'array', - '{columns:colspec}', - { - frequency: COMMON, - }, - function(name, args) { - return { - colFormat: args[0], - mathstyle: 'textstyle', - }; - } -); - -defineEnvironment('eqnarray', '', {}, function() { - return {}; -}); - -defineEnvironment('equation', '', {}, function() { - return { - colFormat: [{ align: 'c' }], - }; -}); - -defineEnvironment('subequations', '', {}, function() { - return { - colFormat: [{ align: 'c' }], - }; -}); - -// Note spelling: MULTLINE, not multiline. -defineEnvironment('multline', '', {}, function() { - return { - firstRowFormat: [{ align: 'l' }], - colFormat: [{ align: 'c' }], - lastRowFormat: [{ align: 'r' }], - }; -}); - -// An AMS-Math environment -// See amsmath.dtx:3565 -// Note that some versions of AMS-Math have a gap on the left. -// More recent version suppresses that gap, but have an option to turn it back on -// for backward compatibility. -defineEnvironment(['align', 'aligned'], '', {}, function(name, args, array) { - let colCount = 0; - for (const row of array) { - colCount = Math.max(colCount, row.length); - } - const colFormat = [{ gap: 0 }, { align: 'r' }, { gap: 0 }, { align: 'l' }]; - let i = 2; - while (i < colCount) { - colFormat.push({ gap: 1 }); - colFormat.push({ align: 'r' }); - colFormat.push({ gap: 0 }); - colFormat.push({ align: 'l' }); - i += 2; - } - colFormat.push({ gap: 0 }); - - return { - colFormat: colFormat, - jot: 0.3, // Jot is an extra gap between lines of numbered equation. - // It's 3pt by default in LaTeX (ltmath.dtx:181) - }; -}); - -// defineEnvironment('alignat', '', {}, function(name, args) { -// return { - -// }; -// }); - -// defineEnvironment('flalign', '', {}, function(name, args) { -// return { - -// }; -// }); - -defineEnvironment('split', '', {}, function() { - return {}; -}); - -defineEnvironment(['gather', 'gathered'], '', {}, function() { - // An AMS-Math environment - // % The \env{gathered} environment is for several lines that are - // % centered independently. - // From amstex.sty - // \newenvironment{gathered}[1][c]{% - // \relax\ifmmode\else\nonmatherr@{\begin{gathered}}\fi - // \null\,% - // \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi - // \bgroup\Let@\restore@math@cr - // \ifinany@\else\openup\jot\fi\ialign - // \bgroup\hfil\strut@$\m@th\displaystyle##$\hfil\crcr - - return { - colFormat: [{ gap: 0.25 }, { align: 'c' }, { gap: 0 }], - jot: 0.3, - }; -}); - -// defineEnvironment('cardinality', '', {}, function() { -// const result = {}; - -// result.mathstyle = 'textstyle'; -// result.lFence = '|'; -// result.rFence = '|'; - -// return result; -// }); - -defineEnvironment( - [ - 'matrix', - 'pmatrix', - 'bmatrix', - 'Bmatrix', - 'vmatrix', - 'Vmatrix', - 'smallmatrix', - 'matrix*', - 'pmatrix*', - 'bmatrix*', - 'Bmatrix*', - 'vmatrix*', - 'Vmatrix*', - 'smallmatrix*', - ], - '[columns:colspec]', - {}, - function(name, args) { - // From amstex.sty: - // \def\matrix{\hskip -\arraycolsep\array{*\c@MaxMatrixCols c}} - // \def\endmatrix{\endarray \hskip -\arraycolsep} - const result = {}; - - result.mathstyle = 'textstyle'; - - switch (name) { - case 'pmatrix': - case 'pmatrix*': - result.lFence = '('; - result.rFence = ')'; - break; - - case 'bmatrix': - case 'bmatrix*': - result.lFence = '['; - result.rFence = ']'; - break; - - case 'Bmatrix': - case 'Bmatrix*': - result.lFence = '\\lbrace'; - result.rFence = '\\rbrace'; - break; - - case 'vmatrix': - case 'vmatrix*': - result.lFence = '\\vert'; - result.rFence = '\\vert'; - break; - - case 'Vmatrix': - case 'Vmatrix*': - result.lFence = '\\Vert'; - result.rFence = '\\Vert'; - break; - - case 'smallmatrix': - case 'smallmatrix*': - result.mathstyle = 'scriptstyle'; - break; - - case 'matrix': - case 'matrix*': - // Specifying a fence, even a null fence, - // will prevent the insertion of an initial and final gap - result.lFence = '.'; - result.rFence = '.'; - break; - default: - } - - result.colFormat = args[0] || [ - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - { align: 'c' }, - ]; - - return result; - } -); - -defineEnvironment('cases', '', {}, function() { - // From amstex.sty: - // \def\cases{\left\{\def\arraystretch{1.2}\hskip-\arraycolsep - // \array{l@{\quad}l}} - // \def\endcases{\endarray\hskip-\arraycolsep\right.} - // From amsmath.dtx - // \def\env@cases{% - // \let\@ifnextchar\new@ifnextchar - // \left\lbrace - // \def\arraystretch{1.2}% - // \array{@{}l@{\quad}l@{}}% - - return { - arraystretch: 1.2, - lFence: '\\lbrace', - rFence: '.', - colFormat: [{ align: 'l' }, { gap: 1 }, { align: 'l' }], - }; -}); - -defineEnvironment('theorem', '', {}, function() { - return {}; -}); - -defineEnvironment('center', '', {}, function() { - return { colFormat: [{ align: 'c' }] }; -}); - -category = ''; -// Simple characters allowed in math mode -defineSymbols('0123456789/@.'); -defineSymbolRange(0x0041, 0x005a); // a-z -defineSymbolRange(0x0061, 0x007a); // A-Z - -category = 'Trigonometry'; -defineFunction( - [ - '\\arcsin', - '\\arccos', - '\\arctan', - '\\arctg', - '\\arcctg', - '\\arg', - '\\ch', - '\\cos', - '\\cosec', - '\\cosh', - '\\cot', - '\\cotg', - '\\coth', - '\\csc', - '\\ctg', - '\\cth', - '\\sec', - '\\sin', - '\\sinh', - '\\sh', - '\\tan', - '\\tanh', - '\\tg', - '\\th', - ], - '', - null, - function(name) { - return { - type: 'mop', - limits: 'nolimits', - symbol: false, - isFunction: true, - body: name.slice(1), - baseFontFamily: 'cmr', - }; - } -); - -frequency(SUPERCOMMON, '\\cos', '\\sin', '\\tan'); - -frequency( - UNCOMMON, - '\\arcsin', - '\\arccos', - '\\arctan', - '\\arctg', - '\\arcctg', - '\\arcsec', - '\\arccsc' -); - -frequency( - UNCOMMON, - '\\arsinh', - '\\arccosh', - '\\arctanh', - '\\arcsech', - '\\arccsch' -); - -frequency( - UNCOMMON, - '\\arg', - '\\ch', - '\\cosec', - '\\cosh', - '\\cot', - '\\cotg', - '\\coth', - '\\csc', - '\\ctg', - '\\cth', - '\\lg', - '\\lb', - '\\sec', - '\\sinh', - '\\sh', - '\\tanh', - '\\tg', - '\\th' -); - -category = 'Functions'; - -defineFunction( - [ - '\\deg', - '\\dim', - '\\exp', - '\\hom', - '\\ker', - '\\lb', - '\\lg', - '\\ln', - '\\log', - ], - '', - null, - function(name) { - return { - type: 'mop', - limits: 'nolimits', - symbol: false, - isFunction: true, - body: name.slice(1), - baseFontFamily: 'cmr', - }; - } -); -frequency(SUPERCOMMON, '\\ln', '\\log', '\\exp'); - -frequency(292, '\\hom'); -frequency(COMMON, '\\dim'); -frequency(COMMON, '\\ker', '\\deg'); // >2,000 - -defineFunction(['\\lim', '\\mod'], '', null, function(name) { - return { - type: 'mop', - limits: 'limits', - symbol: false, - body: name.slice(1), - baseFontFamily: 'cmr', - }; -}); -defineFunction(['\\det', '\\max', '\\min'], '', null, function(name) { - return { - type: 'mop', - limits: 'limits', - symbol: false, - isFunction: true, - body: name.slice(1), - baseFontFamily: 'cmr', - }; -}); -frequency(SUPERCOMMON, '\\lim'); -frequency(COMMON, '\\det'); -frequency(COMMON, '\\mod'); -frequency(COMMON, '\\min'); -frequency(COMMON, '\\max'); - -category = 'Decoration'; - -// A box of the width and height -defineFunction( - '\\rule', - '[raise:dimen]{width:dimen}{thickness:dimen}', - null, - function(name, args) { - return { - type: 'rule', - shift: args[0], - width: args[1], - height: args[2], - }; - } -); - -defineFunction( - '\\color', - '{:color}', - { allowedInText: true }, - (_name, args) => { - return { color: args[0] }; - } -); - -// From the xcolor package. -// As per xcolor, this command does not set the mode to text -// (unlike what its name might suggest) -defineFunction( - '\\textcolor', - '{:color}{content:auto*}', - { allowedInText: true }, - (_name, args) => { - return { color: args[0] }; - } -); - -frequency(3, '\\textcolor'); - -// An overline -defineFunction('\\overline', '{:auto}', null, function(name, args) { - return { - type: 'line', - position: 'overline', - skipBoundary: true, - body: args[0], - }; -}); -frequency(COMMON, '\\overline'); // > 2,000 - -defineFunction('\\underline', '{:auto}', null, function(name, args) { - return { - type: 'line', - position: 'underline', - skipBoundary: true, - body: args[0], - }; -}); -frequency(COMMON, '\\underline'); // > 2,000 - -defineFunction('\\overset', '{annotation:auto}{symbol:auto}', null, function( - name, - args -) { - return { - type: 'overunder', - overscript: args[0], - skipBoundary: true, - body: args[1], - }; -}); -frequency(COMMON, '\\overset'); // > 2,000 - -defineFunction('\\underset', '{annotation:auto}{symbol:auto}', null, function( - name, - args -) { - return { - type: 'overunder', - underscript: args[0], - skipBoundary: true, - body: args[1], - }; -}); -frequency(COMMON, '\\underset'); // > 2,000 - -defineFunction( - ['\\stackrel', '\\stackbin'], - '{annotation:auto}{symbol:auto}', - null, - function(name, args) { - return { - type: 'overunder', - overscript: args[0], - skipBoundary: true, - body: args[1], - mathtype: name === '\\stackrel' ? 'mrel' : 'mbin', - }; - } -); -frequency(COMMON, '\\stackrel'); // > 2,000 -frequency(0, '\\stackbin'); - -defineFunction('\\rlap', '{:auto}', null, function(name, args) { - return { - type: 'overlap', - align: 'right', - skipBoundary: true, - body: args[0], - }; -}); -frequency(270, '\\rlap'); - -defineFunction('\\llap', '{:auto}', null, function(name, args) { - return { - type: 'overlap', - align: 'left', - skipBoundary: true, - body: args[0], - }; -}); -frequency(18, '\\llap'); - -defineFunction('\\mathrlap', '{:auto}', null, function(name, args) { - return { - type: 'overlap', - mode: 'math', - align: 'right', - skipBoundary: true, - body: args[0], - }; -}); -frequency(CRYPTIC, '\\mathrlap'); - -defineFunction('\\mathllap', '{:auto}', null, function(name, args) { - return { - type: 'overlap', - mode: 'math', - align: 'left', - skipBoundary: true, - body: args[0], - }; -}); -frequency(CRYPTIC, '\\mathllap'); - -// Can be preceded by e.g. '\fboxsep=4pt' (also \fboxrule) -// Note: -// - \boxed: sets content in displaystyle mode (@todo: should change type of argument) -// equivalent to \fbox{$$$$} -// - \fbox: sets content in 'auto' mode (frequency 777) -// - \framebox[][]{} ( := 'c'|'t'|'b' (center, top, bottom) (frequency 28) -// @todo -defineFunction('\\boxed', '{content:math}', null, function(name, args) { - return { - type: 'box', - framecolor: 'black', - skipBoundary: true, - body: args[0], - }; -}); -frequency(1236, '\\boxed'); - -defineFunction( - '\\colorbox', - '{background-color:color}{content:auto}', - { allowedInText: true }, - function(name, args) { - return { - type: 'box', - backgroundcolor: args[0], - skipBoundary: true, - body: args[1], - }; - } -); -frequency(CRYPTIC, '\\colorbox'); - -defineFunction( - '\\fcolorbox', - '{frame-color:color}{background-color:color}{content:auto}', - { allowedInText: true }, - function(name, args) { - return { - type: 'box', - framecolor: args[0], - backgroundcolor: args[1], - skipBoundary: true, - body: args[2], - }; - } -); -frequency(CRYPTIC, '\\fcolorbox'); - -// \bbox, MathJax extension -// The first argument is a CSS border property shorthand, e.g. -// \bbox[red], \bbox[5px,border:2px solid red] -// The MathJax syntax is -// arglist ::= [,[,]] -// arg ::= [||`), - o[n].backdrop && - (t += `
    `), - o[n].container && - (t += `
    `), - o[n].rows) - ) { - t += "
    "; - for (const e of o[n].rows) { - t += '
      '; - for (const i of e) - (t += '${ - i.label ? i.label : '' - }`); - t += '
    '; - } - (t += '
    '), - o[n].container && (t += ""), - o[n].backdrop && (t += ""); - } - o[n] = t; - } - (i += - "
    "), - (i += ni(t, a, e)); - const s = 'function' == typeof o[n] ? o[n]() : o[n]; - (i += li(t, s)), (i += '
    '); - } - } - const l = document.createElement('div'); - (l.className = 'ML__keyboard'), - e - ? l.classList.add(e) - : t.config.virtualKeyboardTheme - ? l.classList.add(t.config.virtualKeyboardTheme) - : /android|cros/i.test(navigator.userAgent) && - l.classList.add('material'), - (l.innerHTML = i), - ri( - t, - l.querySelectorAll( - '.keycap, .action, .fnbutton, .bigfnbutton' - ) - ); - const c = l.getElementsByClassName('layer-switch'); - for (let e = 0; e < c.length; ++e) - c[e].classList.contains('shift') - ? t._attachButtonHandlers(c[e], { - pressed: ['shiftKeyboardLayer', 'shift'], - default: [ - 'switchKeyboardLayer', - c[e].getAttribute('data-layer'), - ], - pressAndHoldEnd: 'unshiftKeyboardLayer', - }) - : t._attachButtonHandlers(c[e], { - default: [ - 'switchKeyboardLayer', - c[e].getAttribute('data-layer'), - ], - }); - const h = l.getElementsByClassName('keyboard-layer'); - return ( - Array.from(h).forEach(t => { - t.addEventListener('mousedown', t => { - t.preventDefault(), t.stopPropagation(); - }), - t.addEventListener('touchstart', t => { - t.preventDefault(), t.stopPropagation(); - }); - }), - h[0].classList.add('is-visible'), - window.addEventListener('mouseup', function() { - t.hideAlternateKeys_(), t.unshiftKeyboardLayer_(); - }), - window.addEventListener('blur', function() { - t.hideAlternateKeys_(), t.unshiftKeyboardLayer_(); - }), - window.addEventListener('touchend', function() { - t.hideAlternateKeys_(), t.unshiftKeyboardLayer_(); - }), - window.addEventListener('touchcancel', function() { - t.hideAlternateKeys_(), t.unshiftKeyboardLayer_(); - }), - l - ); - }, - makeKeycap: ri, - }; - const hi = { - '−': '-', - '-': '-', - '\\alpha': 'alpha', - '\\beta': 'beta', - '\\gamma': 'gamma', - '\\delta': 'delta', - '\\epsilon': 'epsilon', - '\\varepsilon': 'varepsilon', - '\\zeta': 'zeta', - '\\eta': 'eta', - '\\theta': 'theta', - '\\vartheta': 'vartheta', - '\\iota': 'iota', - '\\kappa': 'kappa', - '\\lambda': 'lambda', - '\\mu': 'mu', - '\\nu': 'nu', - '\\xi': 'xi', - '\\pi': 'pi', - '\\rho': 'rho', - '\\sigma': 'sigma', - '\\tau': 'tau', - '\\upsilon': 'upsilon', - '\\phi': 'phi', - '\\varphi': 'varphi', - '\\chi': 'chi', - '\\psi': 'psi', - '\\omega': 'omega', - '\\Gamma': 'Gamma', - '\\Delta': 'Delta', - '\\Theta': 'Theta', - '\\Lambda': 'Lambda', - '\\Xi': 'Xi', - '\\Pi': 'Pi', - '\\Sigma': 'Sigma', - '\\Phi': 'Phi', - '\\Psi': 'Psi', - '\\Omega': 'Omega', - }, - di = { - '\\pm': '+-', - '\\times': 'xx', - '\\colon': ':', - '\\vert': '|', - '\\Vert': '||', - '\\mid': '|', - '\\lbrace': '{', - '\\rbrace': '}', - '\\langle': '(:', - '\\rangle': ':)', - }, - pi = { - '\\pm': '±', - '\\times': '×', - '\\colon': ':', - '\\vert': '|', - '\\Vert': '∥', - '\\mid': '∣', - '\\lbrace': '{', - '\\rbrace': '}', - '\\langle': '⟨', - '\\rangle': '⟩', - '\\lfloor': '⌊', - '\\rfloor': '⌋', - '\\lceil': '⌈', - '\\rceil': '⌉', - '\\vec': '⃗', - '\\acute': '´', - '\\grave': '`', - '\\dot': '˙', - '\\ddot': '¨', - '\\tilde': '~', - '\\bar': '¯', - '\\breve': '˘', - '\\check': 'ˇ', - '\\hat': '^', - }; - function mi(t) { - return t - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>'); - } - function ui(t, e) { - return t && e.generateID ? ' extid="' + t + '"' : ''; - } - function fi(t, e, i) { - let s = !1; - e = e || t.atoms.length; - let a = '', - o = '', - n = -1, - r = -1; - const l = t.atoms[t.index]; - if ( - (t.index < e && - ('mord' === l.type || 'textord' === l.type) && - '0123456789,.'.indexOf(l.body) < 0 && - ((o = l.toMathML(i)), - l.superscript && (n = t.index), - l.subscript && (r = t.index), - (t.index += 1)), - o.length > 0) - ) { - if ( - ((s = !0), - gi(t) && ((n = t.index), (t.index += 1)), - yi(t) && ((r = t.index), (t.index += 1)), - n >= 0 && r >= 0) - ) - (a = '' + o), - (a += Si(t.atoms[r].subscript, 0, 0, i).mathML), - (a += Si(t.atoms[n].superscript, 0, 0, i).mathML), - (a += ''); - else if (n >= 0) { - if (((a = '' + o), gi(t))) { - const e = Si(t.atoms[n].superscript, 0, 0, i).mathML, - s = Si(t.atoms[n + 1].superscript, 0, 0, i).mathML; - a += - ('' !== e && '' !== e) || - ('' !== s && '' !== s) - ? '' === e || - '' === e - ? '' - : e - : ''; - } else a += Si(t.atoms[n].superscript, 0, 0, i).mathML; - a += ''; - } else - r >= 0 - ? ((a = '' + o), - (a += Si(t.atoms[r].subscript, 0, 0, i).mathML), - (a += '')) - : (a = o); - ('mi' !== t.lastType && - 'mn' !== t.lastType && - 'mtext' !== t.lastType && - 'fence' !== t.lastType) || - /^(.*)<\/mo>$/.test(a) || - (a = '' + a), - o.endsWith('>f') || o.endsWith('>g') - ? ((a += ''), - (t.lastType = 'applyfunction')) - : (t.lastType = /^(.*)<\/mo>$/.test(a) - ? 'mo' - : 'mi'), - (t.mathML += a); - } - return s; - } - function gi(t) { - return ( - t.index < t.atoms.length && - t.atoms[t.index].superscript && - 'msubsup' === t.atoms[t.index].type - ); - } - function yi(t) { - return ( - t.index < t.atoms.length && - t.atoms[t.index].subscript && - 'msubsup' === t.atoms[t.index].type - ); - } - function bi(t, e, i) { - let s = !1, - a = '', - o = e.atoms[e.index - 1]; - return ( - !!o && - (o.superscript || - o.subscript || - ((gi(e) || yi(e)) && - ((o = e.atoms[e.index]), (e.index += 1))), - !!o && - (o.superscript && o.subscript - ? ((a = '' + t), - (a += Si(o.subscript, 0, 0, i).mathML), - (a += Si(o.superscript, 0, 0, i).mathML), - (a += '')) - : o.superscript - ? ((a = '' + t), - (a += Si(o.superscript, 0, 0, i).mathML), - (a += '')) - : o.subscript && - ((a = '' + t), - (a += Si(o.subscript, 0, 0, i).mathML), - (a += '')), - a.length > 0 && - ((s = !0), (e.mathML += a), (e.lastType = '')), - s)) - ); - } - function xi(t, e, i) { - let s = !1; - e = e || t.atoms.length; - const a = t.index; - let o = ''; - for (; t.index < e && 'text' === t.atoms[t.index].mode; ) - (o += t.atoms[t.index].body ? t.atoms[t.index].body : ' '), - (t.index += 1); - return ( - o.length > 0 && - ((s = !0), - (o = - '' + o + ''), - (t.mathML += o), - (t.lastType = 'mtext')), - s - ); - } - function ki(t, e, i) { - let s = !1; - e = e || t.atoms.length; - const a = t.index; - let o = '', - n = (function(t) { - let e = -1, - i = t.index, - s = !1, - a = !1; - for (; i < t.atoms.length && !s && !a; ) - (s = - 'mord' !== t.atoms[i].type || - '0123456789,.'.indexOf(t.atoms[i].body) < 0), - (a = !s && t.atoms[i].superscript), - i++; - return a && (e = i - 1), e; - })(t); - for ( - n >= 0 && n < e && (e = n); - t.index < e && - 'mord' === t.atoms[t.index].type && - '0123456789,.'.indexOf(t.atoms[t.index].body) >= 0; - - ) - (o += t.atoms[t.index].body), (t.index += 1); - return ( - o.length > 0 && - ((s = !0), - (o = '' + o + ''), - n < 0 && gi(t) && ((n = t.index), (t.index += 1)), - n >= 0 && - ((o = '' + o), - (o += Si(t.atoms[n].superscript, 0, 0, i).mathML), - (o += '')), - (t.mathML += o), - (t.lastType = 'mn')), - s - ); - } - function vi(t, e, i) { - let s = !1; - e = e || t.atoms.length; - let a = '', - o = ''; - if (t.index < e && 'mopen' === t.atoms[t.index].type) { - let n = !1, - r = 0; - const l = t.index; - let c = -1, - h = l + 1; - for (; h < e && !n; ) - 'mopen' === t.atoms[h].type - ? (r += 1) - : 'mclose' === t.atoms[h].type && (r -= 1), - -1 === r && ((n = !0), (c = h)), - (h += 1); - n && - ((a = ''), - (a += Ai(t.atoms[l], i)), - (a += Si(t.atoms, l + 1, c, i).mathML), - (a += Ai(t.atoms[c], i)), - (a += ''), - ('mi' !== t.lastType && - 'mn' !== t.lastType && - 'mfrac' !== t.lastType && - 'fence' !== t.lastType) || - (a = '' + a), - (t.index = c + 1), - bi(a, t, i) && ((s = !0), (t.lastType = ''), (a = '')), - (o = 'fence')); - } - return ( - a.length > 0 && ((s = !0), (t.mathML += a), (t.lastType = o)), s - ); - } - function wi(t, e, i) { - let s = !1; - e = e || t.atoms.length; - let a = '', - o = ''; - const n = t.atoms[t.index]; - if (t.index < e && ('mbin' === n.type || 'mrel' === n.type)) - (a += t.atoms[t.index].toMathML(i)), (t.index += 1), (o = 'mo'); - else if (t.index < e && 'mop' === n.type) { - if ('limits' === n.limits && (n.superscript || n.subscript)) { - const t = Ai(n, i); - n.superscript && n.subscript - ? ((a += - ('nolimits' !== n.limits - ? '' - : '') + t), - (a += Si(n.subscript, 0, 0, i).mathML), - (a += Si(n.superscript, 0, 0, i).mathML), - (a += - 'nolimits' !== n.limits - ? '' - : '')) - : n.superscript - ? ((a += - ('nolimits' !== n.limits ? '' : '') + - t), - (a += Si(n.superscript, 0, 0, i).mathML), - (a += - 'nolimits' !== n.limits ? '' : '')) - : ((a += - ('nolimits' !== n.limits - ? '' - : '') + t), - (a += Si(n.subscript, 0, 0, i).mathML), - (a += - 'nolimits' !== n.limits - ? '' - : '')), - (o = 'mo'); - } else { - const e = t.atoms[t.index], - n = 0 === e.latex.indexOf('\\operatorname'), - r = n - ? '' + - Mi(e.body) + - '' - : Ai(e, i); - (a += r), - (t.index += 1), - bi(a, t, i) && ((s = !0), (t.lastType = ''), (a = '')), - (t.index -= 1), - n || /^(.*)<\/mo>$/.test(r) - ? (o = n ? 'mi' : 'mo') - : ((a += ''), - (o = 'applyfunction')); - } - ('mi' !== t.lastType && 'mn' !== t.lastType) || - /^(.*)<\/mo>$/.test(a) || - (a = '' + a), - (t.index += 1); - } - return ( - a.length > 0 && ((s = !0), (t.mathML += a), (t.lastType = o)), s - ); - } - function Si(t, e, i, s) { - const a = { atoms: t, index: e || 0, mathML: '', lastType: '' }; - if ( - ((i = i || (t ? t.length : 0)), - 'number' == typeof t || 'boolean' == typeof t) - ) - a.mathML = t.toString(); - else if ('string' == typeof t) a.mathML = t; - else if (t && 'function' == typeof t.toMathML) - a.mathML = t.toMathML(s); - else if (Array.isArray(t)) { - let t = 0; - for (; a.index < i; ) - if ( - xi(a, i, s) || - ki(a, i, s) || - fi(a, i, s) || - wi(a, i, s) || - vi(a, i, s) - ) - t += 1; - else if (a.index < i) { - let e = a.atoms[a.index].toMathML(s); - 'mn' === a.lastType && - e.length > 0 && - 'genfrac' === a.atoms[a.index].type && - (e = '' + e), - 'genfrac' === a.atoms[a.index].type - ? (a.lastType = 'mfrac') - : (a.lastType = ''), - e.length > 0 && ((a.mathML += e), (t += 1)), - (a.index += 1); - } - t > 1 && (a.mathML = '' + a.mathML + ''); - } - return a; - } - function Ai(t, e) { - let i = ''; - const s = Mi(t.body); - return s && (i = '' + s + ''), i; - } - function Mi(t) { - if (!t) return ''; - if ('string' == typeof t) return mi(t); - if (!Array.isArray(t) && 'string' == typeof t.body) - return mi(t.body); - let e = ''; - for (const i of t) 'string' == typeof i.body && (e += i.body); - return mi(e); - } - (te.MathAtom.prototype.toMathML = function(t) { - const e = { - '\\exponentialE': 'ⅇ', - '\\imaginaryI': 'ⅈ', - '\\differentialD': 'ⅆ', - '\\capitalDifferentialD': 'ⅅ', - '\\alpha': 'α', - '\\pi': 'π', - '\\infty': '∞', - '\\forall': '∀', - '\\nexists': '∄', - '\\exists': '∃', - '\\hbar': 'ℏ', - '\\cdotp': '⋅', - '\\ldots': '…', - '\\cdots': '⋯', - '\\ddots': '⋱', - '\\vdots': '⋮', - '\\ldotp': '.', - }, - i = { - '\\!': -3 / 18, - '\\ ': 6 / 18, - '\\,': 3 / 18, - '\\:': 4 / 18, - '\\;': 5 / 18, - '\\enspace': 0.5, - '\\quad': 1, - '\\qquad': 2, - '\\enskip': 0.5, - }; - let s, - a, - o, - n, - r, - l, - c = '', - h = '', - d = - { - cal: 'script', - frak: 'fraktur', - bb: 'double-struck', - scr: 'script', - cmtt: 'monospace', - cmss: 'sans-serif', - }[this.fontFamily || this.font] || ''; - d && (d = ' mathvariant="' + d + '"'); - const p = this.latex ? this.latex.trim() : null; - if ('text' === this.mode) - c = '' + this.body + ''; - else - switch (this.type) { - case 'first': - break; - case 'group': - case 'root': - c = Si(this.body, 0, 0, t).mathML; - break; - case 'array': - if ( - (((this.lFence && '.' !== this.lFence) || - (this.rFence && '.' !== this.rFence)) && - ((c += ''), - this.lFence && - '.' !== this.lFence && - (c += - '' + - (pi[this.lFence] || this.lFence) + - '')), - (c += '' + - Si(this.array[a][s], 0, 0, t).mathML + - ''; - c += ''; - } - (c += ''), - ((this.lFence && '.' !== this.lFence) || - (this.rFence && '.' !== this.rFence)) && - (this.rFence && - '.' !== this.rFence && - (c += - '' + - (pi[this.lFence] || this.rFence) + - ''), - (c += '')); - break; - case 'genfrac': - (this.leftDelim || this.rightDelim) && (c += ''), - this.leftDelim && - '.' !== this.leftDelim && - (c += - '' + - (pi[this.leftDelim] || this.leftDelim) + - ''), - this.hasBarLine - ? ((c += ''), - (c += - Si(this.numer, 0, 0, t).mathML || - ' '), - (c += - Si(this.denom, 0, 0, t).mathML || - ' '), - (c += '')) - : ((c += ''), - (c += - '' + - Si(this.numer, 0, 0, t).mathML + - ''), - (c += - '' + - Si(this.denom, 0, 0, t).mathML + - ''), - (c += '')), - this.rightDelim && - '.' !== this.rightDelim && - (c += - '' + - (pi[this.rightDelim] || this.rightDelim) + - ''), - (this.leftDelim || this.rightDelim) && - (c += ''); - break; - case 'surd': - this.index - ? ((c += ''), - (c += Si(this.body, 0, 0, t).mathML), - (c += Si(this.index, 0, 0, t).mathML), - (c += '')) - : ((c += ''), - (c += Si(this.body, 0, 0, t).mathML), - (c += '')); - break; - case 'leftright': - (c = ''), - this.leftDelim && - '.' !== this.leftDelim && - (c += - '' + - (pi[this.leftDelim] || this.leftDelim) + - ''), - this.body && (c += Si(this.body, 0, 0, t).mathML), - this.rightDelim && - '.' !== this.rightDelim && - (c += - '' + - (pi[this.rightDelim] || this.rightDelim) + - ''), - (c += ''); - break; - case 'sizeddelim': - case 'delim': - c += - '' + - (pi[this.delim] || this.delim) + - ''; - break; - case 'accent': - (c += ''), - (c += Si(this.body, 0, 0, t).mathML), - (c += '' + (pi[p] || this.accent) + ''), - (c += ''); - break; - case 'line': - case 'overlap': - break; - case 'overunder': - (r = this.overscript), - (n = this.underscript), - r && n - ? (l = this.body) - : r - ? ((l = this.body), - this.body[0] && this.body[0].underscript - ? ((n = this.body[0].underscript), - (l = this.body[0].body)) - : this.body[0] && - 'first' === this.body[0].type && - this.body[1] && - this.body[1].underscript && - ((n = this.body[1].underscript), - (l = this.body[1].body))) - : n && - ((l = this.body), - this.body[0] && this.body[0].overscript - ? ((r = this.body[0].overscript), - (l = this.body[0].body)) - : this.body[0] && - 'first' === this.body[0].type && - this.body[1] && - this.body[1].overscript && - ((r = this.body[1].overscript), - (l = this.body[1].body))), - r && n - ? ((c += - '' + - Si(l, 0, 0, t).mathML), - (c += Si(n, 0, 0, t).mathML), - (c += Si(r, 0, 0, t).mathML), - (c += '')) - : r - ? ((c += - '' + - Si(l, 0, 0, t).mathML), - (c += Si(r, 0, 0, t).mathML), - (c += '')) - : n && - ((c += - '' + - Si(l, 0, 0, t).mathML), - (c += Si(n, 0, 0, t).mathML), - (c += '')); - break; - case 'placeholder': - case 'mord': { - c = - e[p] || - p || - ('string' == typeof this.body ? this.body : ''); - const i = p - ? p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/) - : null; - i - ? (c = '&#x' + i[1] + ';') - : c.length > 0 && - '\\' === c.charAt(0) && - (c = - 'string' == typeof this.body && - this.body.charCodeAt(0) > 255 - ? '&#x' + - ( - '000000' + - this.body.charCodeAt(0).toString(16) - ).substr(-4) + - ';' - : 'string' == typeof this.body - ? this.body.charAt(0) - : this.body); - const s = /\d/.test(c) ? 'mn' : 'mi'; - c = - '<' + - s + - d + - ui(this.id, t) + - '>' + - mi(c) + - ''; - break; - } - case 'mbin': - case 'mrel': - case 'textord': - case 'minner': - c = - p && e[p] - ? '' + e[p] + '' - : p && pi[p] - ? '' + pi[p] + '' - : Ai(this, t); - break; - case 'mpunct': - c = - '' + - (pi[p] || p) + - ''; - break; - case 'mop': - '​' !== this.body && - ((c = ''), - (c += - '\\operatorname' === p - ? this.body - : p || this.body), - (c += '')); - break; - case 'mathstyle': - break; - case 'box': - (c = '' + - Si(this.body, 0, 0, t).mathML + - ''); - break; - case 'spacing': - c += ''; - break; - case 'enclose': - c = '' + - Si(this.body, 0, 0, t).mathML + - ''; - break; - case 'space': - c += ' '; - } - return c; - }), - (te.toMathML = function(t, e) { - return Si(t, 0, 0, e).mathML; - }); - const Ci = { - '\\imaginaryI': 'ⅈ', - '\\imaginaryJ': 'ⅉ', - '\\pi': 'π', - '\\exponentialE': 'ℯ', - '﹢': '+', - '+': '+', - '−': '-', - '-': '-', - '﹣': '-', - '-': '-', - '\\times': '*', - '\\cdot': '*', - '⨉': '*', - '️✖': '*', - '️×': '*', - '.': '*', - '÷': '/', - '⁄': '/', - '/': '/', - '!': 'factorial', - '\\mp': 'minusplus', - '\\ne': '!=', - '\\coloneq': ':=', - '\\questeq': '?=', - '\\approx': 'approx', - '\\cong': 'congruent', - '\\sim': 'similar', - '\\equiv': 'equiv', - '\\pm': 'plusminus', - '\\land': 'and', - '\\wedge': 'and', - '\\lor': 'or', - '\\vee': 'or', - '\\oplus': 'xor', - '\\veebar': 'xor', - '\\lnot': 'not', - '\\neg': 'not', - '\\exists': 'exists', - '\\nexists': '!exists', - '\\forall': 'forAll', - '\\backepsilon': 'suchThat', - '\\therefore': 'therefore', - '\\because': 'because', - '\\nabla': 'nabla', - '\\circ': 'circle', - '\\ominus': 'ominus', - '\\odot': 'odot', - '\\otimes': 'otimes', - '\\zeta': 'Zeta', - '\\Gamma': 'Gamma', - '\\min': 'min', - '\\max': 'max', - '\\mod': 'mod', - '\\lim': 'lim', - '\\sum': 'sum', - '\\prod': 'prod', - '\\int': 'integral', - '\\iint': 'integral2', - '\\iiint': 'integral3', - '\\Re': 'Re', - '\\gothicCapitalR': 'Re', - '\\Im': 'Im', - '\\gothicCapitalI': 'Im', - '\\binom': 'nCr', - '\\partial': 'partial', - '\\differentialD': 'differentialD', - '\\capitalDifferentialD': 'capitalDifferentialD', - '\\Finv': 'Finv', - '\\Game': 'Game', - '\\wp': 'wp', - '\\ast': 'ast', - '\\star': 'star', - '\\asymp': 'asymp', - '\\to': 'to', - '\\gets': 'gets', - '\\in': 'elementof', - '\\notin': '!elementof', - '\\ni': 'ownedby', - '\\owns': 'ownedby', - '\\subset': 'subset', - '\\supset': 'superset', - '\\complement': 'complement', - '\\rightarrow': 'shortLogicalImplies', - '\\leftarrow': 'shortLogicalImpliedBy', - '\\leftrightarrow': 'shortLogicalEquivalent', - '\\longrightarrow': 'logicalImplies', - '\\longleftarrow': 'logicalImpliedBy', - '\\longleftrightarrow': 'logicalEquivalent', - '\\Rightarrow': 'shortImplies', - '\\Leftarrow': 'shortImpliedBy', - '\\Leftrightarrow': 'shortEquivalent', - '\\implies': 'implies', - '\\Longrightarrow': 'implies', - '\\impliedby': 'impliedBy', - '\\Longleftarrow': 'impliedBy', - '\\iff': 'equivalent', - '\\Longleftrightarrow': 'equivalent', - }, - _i = { - '+': 'add', - '*': 'multiply', - '-': 'subtract', - '/': 'divide', - '=': 'equal', - ':=': 'assign', - '!=': 'ne', - '?=': 'questeq', - approx: 'approx', - congruent: 'congruent', - similar: 'similar', - equiv: 'equiv', - '<': 'lt', - '>': 'gt', - '<=': 'le', - '>=': 'ge', - '≤': 'le', - '≥': 'ge', - '>>': 'gg', - '<<': 'll', - '**': 'pow', - '++': 'increment', - '--': 'decrement', - }, - Ti = { - equal: '%0 = %1', - ne: '%0 \\ne %1', - questeq: '%0 \\questeq %1', - approx: '%0 \\approx %1', - congruent: '%0 \\cong %1', - similar: '%0 \\sim %1', - equiv: '%0 \\equiv %1', - assign: '%0 := %1', - lt: '%0 < %1', - gt: '%0 > %1', - le: '%0 \\le %1', - ge: '%0 \\ge %1', - sin: '\\sin%_%^ %0', - cos: '\\cos%_%^ %0', - tan: '\\tan%_%^ %0', - cot: '\\cot%_%^ %0', - sec: '\\sec%_%^ %0', - csc: '\\csc%_%^ %0', - sinh: '\\sinh %0', - cosh: '\\cosh %0', - tanh: '\\tanh %0', - csch: '\\csch %0', - sech: '\\sech %0', - coth: '\\coth %0', - arcsin: '\\arcsin %0', - arccos: '\\arccos %0', - arctan: '\\arctan %0', - arccot: '\\arcctg %0', - arcsec: '\\arcsec %0', - arccsc: '\\arccsc %0', - arsinh: '\\arsinh %0', - arcosh: '\\arcosh %0', - artanh: '\\artanh %0', - arcsch: '\\arcsch %0', - arsech: '\\arsech %0', - arcoth: '\\arcoth %0', - ln: '\\ln%_%^ %', - log: '\\log%_%^ %', - lg: '\\lg %', - lb: '\\lb %', - sum: '\\sum%_%^ %0', - prod: '\\prod%_%^ %0', - Zeta: '\\zeta%_%^ %', - Gamma: '\\Gamma %', - min: '\\min%_%^ %', - max: '\\max%_%^ %', - mod: '\\mod%_%^ %', - lim: '\\lim%_%^ %', - binom: '\\binom %', - nabla: '\\nabla %', - curl: '\\nabla\\times %0', - div: '\\nabla\\cdot %0', - floor: '\\lfloor %0 \\rfloor%_%^', - ceil: '\\lceil %0 \\rceil%_%^', - abs: '\\left| %0 \\right|%_%^', - norm: '\\lVert %0 \\rVert%_%^', - ucorner: '\\ulcorner %0 \\urcorner%_%^', - lcorner: '\\llcorner %0 \\lrcorner%_%^', - angle: '\\langle %0 \\rangle%_%^', - group: '\\lgroup %0 \\rgroup%_%^', - moustache: '\\lmoustache %0 \\rmoustache%_%^', - brace: '\\lbrace %0 \\rbrace%_%^', - 'sqrt[]': '\\sqrt[%^]{%0}', - sqrt: '\\sqrt{%0}', - lcm: '\\operatorname{lcm}%', - gcd: '\\operatorname{gcd}%', - erf: '\\operatorname{erf}%', - erfc: '\\operatorname{erfc}%', - randomReal: '\\operatorname{randomReal}%', - randomInteger: '\\operatorname{randomInteger}%', - and: '%0 \\land %1', - or: '%0 \\lor %1', - xor: '%0 \\oplus %1', - not: '%0 \\lnot %1', - circle: '%0 \\circ %1', - ast: '%0 \\ast %1', - star: '%0 \\star %1', - asymp: '%0 \\asymp %1', - '/': '\\frac{%0}{%1}', - Re: '\\Re{%0}', - Im: '\\Im{%0}', - factorial: '%0!', - factorial2: '%0!!', - }, - Li = { - degree: 880, - nabla: 740, - curl: 740, - partial: 740, - differentialD: 740, - capitalDifferentialD: 740, - '**': 720, - odot: 710, - not: 680, - div: 660, - solidus: 660, - '/': 660, - setminus: 650, - '%': 640, - otimes: 410, - union: 350, - intersection: 350, - '*': 390, - ast: 390, - '.': 390, - oplus: 300, - ominus: 300, - '+': 275, - '-': 275, - '+-': 275, - '-+': 275, - circle: 265, - circledast: 265, - circledcirc: 265, - star: 265, - '..': 263, - to: 262, - in: 262, - '|': 261, - congruent: 265, - equiv: 260, - '=': 260, - '!=': 255, - '?=': 255, - similar: 250, - approx: 247, - '<': 245, - '>': 243, - '>=': 242, - '≥': 242, - '<=': 241, - complement: 240, - subset: 240, - superset: 240, - elementof: 240, - '!elementof': 240, - exists: 230, - '!exists': 230, - forall: 230, - and: 200, - xor: 195, - or: 190, - suchThat: 110, - ':': 100, - assign: 80, - ':=': 80, - therefore: 70, - because: 70, - shortLogicalImplies: 52, - shortImplies: 51, - logicalImplies: 50, - implies: 49, - shortLogicalImpliedBy: 48, - shortImpliedBy: 47, - logicalImpliedBy: 46, - impliedBy: 45, - shortLogicalEquivalent: 44, - shortEquivalent: 43, - logicalEquivalent: 42, - equivalent: 41, - ',': 40, - ';': 30, - }; - function Fi(t, e) { - return Array.isArray(t.arg) ? t.arg[e] : void 0; - } - function Di(t) { - return (t && Li[t]) || -1; - } - function zi(t) { - return /=|=>/.test(t) ? 'right' : 'left'; - } - function Ei(t) { - if ('f' === t || 'g' === t) return !0; - const e = Ti[t]; - return !!e && !!/%[^01_^]?/.test(e); - } - function qi(t) { - t = (t || '').trim(); - let e = Ci[t]; - if (!e) - if (/^\\[^{}]+$/.test(t)) { - const i = At.getInfo(t, 'math', {}); - e = (i && i.value) || t.slice(1); - } else e = t; - return e; - } - function Pi(t) { - if (!t) return null; - const e = qi(Ni(t)), - i = [Di(e), zi(e)]; - return i[0] <= 0 ? null : i; - } - function Ii(t) { - return null !== Pi(t); - } - const Bi = { - '\\lfloor\\rfloor': 'floor', - '\\lceil\\rceil': 'ceil', - '\\vert\\vert': 'abs', - '\\lvert\\rvert': 'abs', - '||': 'abs', - '\\Vert\\Vert': 'norm', - '\\lVert\\rVert': 'norm', - '\\ulcorner\\urcorner': 'ucorner', - '\\llcorner\\lrcorner': 'lcorner', - '\\langle\\rangle': 'angle', - '\\lgroup\\rgroup': 'group', - '\\lmoustache\\rmoustache': 'moustache', - '\\lbrace\\rbrace': 'brace', - }, - Oi = { - '!': 'factorial', - '\\dag': 'dagger', - '\\dagger': 'dagger', - '\\ddagger': 'dagger2', - '\\maltese': 'maltese', - '\\backprime': 'backprime', - '\\backdoubleprime': 'backprime2', - '\\prime': 'prime', - '\\doubleprime': 'prime2', - '\\$': '$', - '\\%': '%', - '\\_': '_', - '\\degree': 'degree', - }, - Ri = { - '+': 'add', - '-': 'add', - '*': 'multiply', - '=': 'equal', - ',': 'list', - ';': 'list2', - and: 'and', - or: 'or', - xor: 'xor', - union: 'union', - shortLogicalEquivalent: 'logicalEquivalent', - logicalEquivalent: 'logicalEquivalent', - shortEquivalent: 'equivalent', - equivalent: 'equivalent', - }, - Ki = { ',': 'list', ';': 'list2' }; - function Ni(t) { - if (Array.isArray(t)) { - let e = ''; - for (const i of t) e += Ni(i); - return e; - } - if ( - t.latex && - !/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex) - ) - return t.latex.trim(); - if ('leftright' === t.type) return ''; - if ('string' == typeof t.body) return t.body; - if (Array.isArray(t.body)) { - let e = ''; - for (const i of t.body) e += Ni(i); - return e; - } - return ''; - } - function $i(t) { - return 'string' == typeof t.sym - ? (function(t) { - let e = Ti[t]; - if (e) - return e - .replace('%1', '') - .replace('%0', '') - .replace('%', ''); - if (t.length > 1) { - const i = At.getInfo('\\' + t, 'math'); - !i || - (i.fontFamily && - 'cmr' !== i.fontFamily && - 'ams' !== i.fontFamily) || - (e = '\\' + t); - } - return e || (e = At.unicodeStringToLatex('math', t)), e; - })(t.sym) || t.sym - : ''; - } - function Wi(t) { - return parseFloat(t.num); - } - function Hi(t) { - return 'object' == typeof t && void 0 !== t.num; - } - function Vi(t) { - let e = 0; - return ( - Hi(t) && - (e = - 'object' == typeof t.num - ? void 0 !== t.num.re - ? hs(t.num.re) - : 0 - : parseFloat(t.num)), - e - ); - } - function Ui(t) { - let e = 0; - return ( - Hi(t) && - 'object' == typeof t.num && - (e = void 0 !== t.num.im ? hs(t.num.im) : 0), - e - ); - } - function ji(t) { - return t && void 0 !== t.sup; - } - function Gi(t) { - return t && void 0 !== t.sub; - } - function Zi(t, e, i) { - let s = !1; - const a = t.atoms[t.index]; - return a && a.type === e && (s = void 0 === i || Ni(a) === i), s; - } - function Xi(t, ...e) { - const i = { fn: t }; - if (e) { - const t = []; - for (const i of e) i && t.push(i); - t.length > 0 && (i.arg = t); - } - return i; - } - function Ji(t) { - return 'number' == typeof t - ? { num: t.toString() } - : 'string' == typeof t - ? { num: t } - : 'object' == typeof t - ? { num: t } - : void 0; - } - function Yi(t) { - if (Hi(t)) { - const e = Vi(t), - i = Ui(t); - return ( - 0 !== i - ? (0 !== e && (t.num.re = (-e).toString()), - (t.num.im = (-i).toString())) - : (t.num = (-e).toString()), - t - ); - } - return Xi('negate', t); - } - function Qi(t) { - const e = t.atoms[t.index + 1]; - return e && 'msubsup' === e.type; - } - function ts(t, e) { - let i = t.atoms[t.index]; - return ( - !i || (void 0 === i.superscript && void 0 === i.subscript) - ? (i = null) - : (t.index += 1), - i || - ((i = t.atoms[t.index + 1]), - i && 'msubsup' === i.type && (i.superscript || i.subscript) - ? (t.index += 2) - : (i = null)), - i - ? (void 0 !== i.subscript && - (t.ast.sub = rs(i.subscript, e)), - void 0 !== i.superscript && - ('msubsup' === i.type - ? /['\u2032]|\\prime/.test(Ni(i.superscript)) - ? ((t.index += 1), - (i = t.atoms[t.index + 1]), - i && - 'msubsup' === i.type && - /['\u2032]|\\prime/.test(Ni(i.superscript)) - ? (t.ast.sup = { sym: '″' }) - : ((t.ast.sup = { sym: '′' }), - (t.index -= 1))) - : /['\u2033]|\\doubleprime/.test( - Ni(i.superscript) - ) - ? (t.ast.sup = { sym: '″' }) - : t.ast && (t.ast.sup = rs(i.superscript, e)) - : (t.ast.sup = rs(i.superscript, e)))) - : (t.index += 1), - t - ); - } - function es(t, e) { - const i = t.ast; - if (ss(t, '!!')) - return ( - (t.index += 1), - (t.ast = Xi('factorial2', i)), - es((t = ts(t, e)), e) - ); - if (ss(t, '++')) - return ( - (t.index += 1), - (t.ast = Xi('increment', i)), - es((t = ts(t, e)), e) - ); - if (ss(t, '--')) - return ( - (t.index += 1), - (t.ast = Xi('decrement', i)), - es((t = ts(t, e)), e) - ); - const s = t.atoms[t.index]; - return ( - s && - s.latex && - Oi[s.latex.trim()] && - ((t.ast = Xi(Oi[s.latex.trim()], i)), - (t = es((t = ts(t, e)), e))), - t - ); - } - function is(t, e, i, s) { - if ( - ((t.index = t.index || 0), - 0 === t.atoms.length || t.index >= t.atoms.length) - ) - return (t.ast = void 0), t; - const a = t.minPrec; - t.minPrec = 0; - let o = t.atoms[t.index]; - if (e) { - if ('mopen' === o.type && Ni(o) === e) - (t.index += 1), - (o = (t = os(t, s)).atoms[t.index]), - o && - 'mclose' === o.type && - Ni(o) === i && - (Qi(t) && (t.ast = { group: t.ast }), - (t = es((t = ts(t, s)), s))); - else if ('textord' === o.type && Ni(o) === e) - (t.index += 1), - (o = (t = os(t, s)).atoms[t.index]), - o && - 'textord' === o.type && - Ni(o) === i && - ((t.index += 1), (t = es((t = ts(t, s)), s))); - else if ( - '\\lVert' === e && - 'textord' === o.type && - '|' === o.latex - ) { - if ( - ((o = t.atoms[t.index + 1]), - o && 'textord' === o.type && '|' === o.latex) - ) { - (t.index += 2), (o = (t = os(t, s)).atoms[t.index]); - const e = t.atoms[t.index + 1]; - o && - 'textord' === o.type && - '|' === o.latex && - e && - 'textord' === e.type && - '|' === e.latex && - ((t.index += 2), (t = es((t = ts(t, s)), s))); - } - } else if ('sizeddelim' === o.type && o.delim === e) - (t.index += 1), - (o = (t = os(t, s)).atoms[t.index]), - o && - 'sizeddelim' === o.type && - o.delim === i && - ((t.index += 1), (t = es((t = ts(t, s)), s))); - else { - if ( - 'leftright' !== o.type || - o.leftDelim !== e || - ('?' !== o.rightDelim && o.rightDelim !== i) - ) - return; - (t.ast = rs(o.body, s)), - Qi(t) && (t.ast = { group: t.ast }), - (t = es((t = ts(t, s)), s)); - } - return (t.minPrec = a), t; - } - { - let s = !0; - if ( - ('mopen' === o.type - ? ((e = o.latex.trim()), (i = At.RIGHT_DELIM[e])) - : 'sizeddelim' === o.type - ? ((e = o.delim), (i = At.RIGHT_DELIM[e])) - : 'leftright' === o.type - ? ((s = !1), - (e = o.leftDelim), - '?' === (i = o.rightDelim) && (i = At.RIGHT_DELIM[e])) - : 'textord' === o.type && - ((e = o.latex.trim()), (i = At.RIGHT_DELIM[e])), - e && i) - ) { - if ('|' === e && '|' === i) { - const s = t.atoms[t.index + 1]; - s && - 'textord' === s.type && - '|' === s.latex && - ((e = '\\lVert'), (i = '\\rVert')); - } - if ((t = is(t, e, i))) - return ( - s && (t.index += 1), - (t.ast = { fn: Bi[e + i] || e + i, arg: [t.ast] }), - (t.minPrec = a), - t - ); - } - } - } - function ss(t, e) { - return ( - (t.index = t.index || 0), - !(t.atoms.length <= 1 || t.index >= t.atoms.length - 1) && - e === Ni(t.atoms[t.index]) + Ni(t.atoms[t.index + 1]) - ); - } - function as(t) { - if ( - ((t.index = t.index || 0), - !(t.atoms.length <= 1 || t.index >= t.atoms.length - 1)) - ) { - if (!Zi(t, 'textord', '\\nabla')) { - const e = - t.atoms[t.index].latex + t.atoms[t.index + 1].latex, - i = /^(>=|<=|>>|<<|:=|!=|\*\*|\+\+|--)$/.test(e) - ? e - : ''; - return i && (t.index += 1), i; - } - return ( - (t.index += 1), - Zi(t, 'mbin', '\\times') - ? ((t.index += 1), (t.ast = 'curl'), t) - : Zi(t, 'mbin', '\\cdot') - ? ((t.index += 1), (t.ast = 'div'), t) - : void (t.index -= 1) - ); - } - } - function os(t, e) { - if ( - ((t.index = t.index || 0), - (t.ast = void 0), - 0 === t.atoms.length || t.index >= t.atoms.length) - ) - return t; - t.minPrec = t.minPrec || 0; - let i = (function t(e, i) { - if ( - ((e.index = e.index || 0), - (e.ast = void 0), - 0 === e.atoms.length || e.index >= e.atoms.length) - ) - return e; - let s = e.atoms[e.index]; - if ('text' === s.mode) { - let t = ''; - for ( - ; - e.atoms[e.index] && - 'text' === e.atoms[e.index].mode; - - ) - (t += e.atoms[e.index].body), (e.index += 1); - return (e.ast = { text: t }), e; - } - const a = qi(Ni(s)); - if (as(e)) e.ast = Xi(e.ast, t(e, i).ast); - else { - if ('root' === s.type) - return (e.index = 0), (e.atoms = s.body), t(e, i); - if ('mbin' === s.type && '-' === a) - (e.index += 1), ((e = t(e, i)).ast = Yi(e.ast)); - else if ('mbin' === s.type && '+' === a) - (e.index += 1), - ((e = t(e, i)).ast = Xi('add', e.ast)); - else if ( - 'mord' === s.type && - /^[0-9.]$/.test(s.latex) - ) { - let a = '', - o = !1, - n = /^[0-9.eEdD]$/; - for ( - ; - e.index < e.atoms.length && - !o && - (Zi(e, 'spacing') || - ((Zi(e, 'mord') || - Zi(e, 'mpunct', ',') || - Zi(e, 'mbin')) && - n.test(e.atoms[e.index].latex))); - - ) - if ('spacing' === e.atoms[e.index].type) - e.index += 1; - else if ( - void 0 !== e.atoms[e.index].superscript || - void 0 !== e.atoms[e.index].subscript - ) - o = !0; - else { - let t = e.atoms[e.index].latex; - 'd' === t || 'D' === t - ? ((t = 'e'), (n = /^[0-9+-.]$/)) - : 'e' === t || 'E' === t - ? Qi(e) - ? ((t = ''), - (e.index -= 1), - (o = !0)) - : ((t = 'E'), (n = /^[0-9+-.]$/)) - : n === /^[0-9+-.]$/ && (n = /^[0-9]$/), - (a += ',' === t ? '' : t), - (e.index += 1); - } - if ( - ((e.ast = a ? Ji(a) : void 0), - (s = e.atoms[e.index]), - s && 'genfrac' === s.type && !isNaN(e.ast.num)) - ) { - const s = e.ast; - (e = t(e, i)).ast = Xi('add', s, e.ast); - } - if ( - s && - 'group' === s.type && - s.latex && - s.latex.startsWith('\\nicefrac') - ) { - const s = e.ast; - (e = t(e, i)).ast = Xi('add', s, e.ast); - } - s && 'msubsup' === s.type && (e = ts(e, i)), - (e = es(e, i)); - } else if ('genfrac' === s.type || 'surd' === s.type) - (e.ast = s.toAST(i)), (e = es((e = ts(e, i)), i)); - else if ('mord' === s.type || 'mbin' === s.type) { - if (Ei(a) && !Ii(s)) { - e.ast = { fn: a }; - const s = (e = ts(e, i)).ast, - o = t(e, i).ast; - o && /^(list0|list|list2)$/.test(o.fn) - ? (s.arg = o.arg) - : o && (s.arg = [o]), - (e.ast = s); - } else - (e.ast = s.toAST(i)), - 'ⅈ' === e.ast.sym && - (e.ast = Ji({ im: '1' })), - (e = ts(e)); - e = es(e, i); - } else if ('textord' === s.type) { - if ( - !Ii(s) && - !At.RIGHT_DELIM[ - s.latex ? s.latex.trim() : s.body - ] - ) - if (Ei(a)) { - e.ast = { fn: a }; - const s = (e = ts(e, i)).ast; - (e.index += 1), - (s.arg = [t(e, i).ast]), - (e.ast = s), - (e = es(e, i)); - } else - (e.ast = s.toAST(i)), - void 0 === s.superscript && - (e.index += 1), - (e = es((e = ts(e, i)), i)); - } else if ('mop' === s.type) { - if ( - (/^\\(mathop|operatorname|operatorname\*)/.test( - s.latex - ) || - Ei(a)) && - !Ii(s) - ) - if ( - ((e.ast = { - fn: /^\\(mathop|operatorname|operatorname\*)/.test( - s.latex - ) - ? Ni(s.body) - : a, - }), - ji((e = ts(e, i)).ast)) - ) { - const s = { - sin: 'arcsin', - cos: 'arccos', - tan: 'arctan', - cot: 'arccot', - sec: 'arcsec', - csc: 'arccsc', - sinh: 'arsinh', - cosh: 'arcosh', - tanh: 'artanh', - csch: 'arcsch', - sech: 'arsech', - coth: 'arcoth', - }; - if (-1 === Wi(e.ast.sup) && s[a]) - e.ast = Xi(s[a], t(e, i).ast); - else { - const s = e.ast; - (s.arg = [t(e, i).ast]), (e.ast = s); - } - } else { - const s = e.ast, - a = t(e, i).ast; - a && /^(list0|list|list2)$/.test(a.fn) - ? (s.arg = a.arg) - : a && (s.arg = [a]), - (e.ast = s); - } - } else if ('array' === s.type) - (e.index += 1), (e.ast = s.toAST(i)); - else if ('group' === s.type) - (e.index += 1), (e.ast = s.toAST(i)); - else { - if ('mclose' === s.type) return e; - if ('error' === s.type) - return ( - (e.index += 1), - (e.ast = { error: s.latex }), - e - ); - } - } - if (void 0 === e.ast) { - const t = is(e, '(', ')', i) || is(e, null, null, i); - t - ? (e = t) - : Ii(s) || - ('placeholder' === s.type - ? (e.ast = Ji(0)) - : ((e.ast = { text: '?' }), - (e.ast.error = - "Unexpected token '" + s.type + "'"), - s.latex - ? (e.ast.latex = s.latex) - : s.body && - s.toLatex && - (e.ast.latex = s.toLatex())), - (e.index += 1)); - } - if ( - ((s = e.atoms[e.index]), - s && - ('mord' === s.type || - 'surd' === s.type || - 'mop' === s.type || - 'mopen' === s.type || - 'sizeddelim' === s.type || - 'leftright' === s.type)) - ) { - if ('sizeddelim' === s.type) - for (const t in At.RIGHT_DELIM) - if (s.delim === At.RIGHT_DELIM[t]) - return (e.index += 1), e; - if ( - ('mord' === s.type || - 'textord' === s.type || - 'mop' === s.type) && - Ii(s) - ) - return e; - const a = e.ast; - (e.ast = {}), - (e = t(e, i)) && e.ast && a - ? (Ei(a.fn) && void 0 === a.arg) || - (Array.isArray(a.arg) && 0 === a.arg.length) - ? 'list2' === e.ast.fn || - 'list' === e.ast.fn - ? (e.ast = Xi(a.fn, e.ast.arg)) - : (e.ast = Xi('multiply', a, e.ast)) - : 'multiply' === e.ast.fn - ? e.ast.arg.unshift(a) - : 0 === Ui(a) && - 0 !== Vi(a) && - 1 === Ui(e.ast) && - 0 === Vi(e.ast) - ? (e.ast = Ji({ im: Vi(a).toString() })) - : (e.ast = Xi('multiply', a, e.ast)) - : (e.ast = a); - } - return e; - })(t, e).ast, - s = !1; - const a = t.minPrec; - for (; !s; ) { - const o = t.atoms[t.index], - n = as(t); - let r, l; - if ( - ((s = !o || 'text' === o.mode || (!n && !Ii(o))), - s || (([r, l] = n ? [Di(n), zi(n)] : Pi(o)), (s = r < a)), - !s) - ) { - const a = n || qi(Ni(o)); - if ( - ((t.minPrec = 'left' === l ? r + 1 : r), - (t.index += 1), - '|' === a) - ) - if ( - void 0 !== o.subscript || - (t.atoms[t.index] && - void 0 !== t.atoms[t.index].subscript && - 'msubsup' === t.atoms[t.index].type) - ) { - t.ast = {}; - const s = ts(t, e).ast.sub; - if ( - ((i = Xi('bind', i)), - s && 'equal' === s.fn && i.arg) - ) - i.arg.push(Fi(s, 0)), i.arg.push(Fi(s, 1)); - else if ( - s && - i.arg && - ('list' === s.fn || 'list2' === s.fn) - ) { - let t = { sym: 'x' }; - for (let e = 0; e < s.arg.length; e++) - 'equal' === s.arg[e].fn - ? ((t = Fi(s.arg[e], 0)), - i.arg.push(t), - i.arg.push(Fi(s.arg[e], 1))) - : (i.arg.push(t), i.arg.push(s.arg[e])); - } else - s && (i.arg.push({ sym: 'x' }), i.arg.push(s)); - } else s = !0; - else { - const s = os(t, e).ast; - let o = Ki[a]; - o && i && i.fn !== o && (i = Xi(o, i)), - '-' === a - ? i && i.arg && 'add' === i.fn - ? void 0 !== s && i.arg.push(Yi(s)) - : (i = - i && 'subtract' === i.fn - ? Xi( - 'add', - Fi(i, 0), - Yi(Fi(i, 1)), - Yi(s) - ) - : !Hi(i) || - ji(i) || - !Hi(s) || - ji(s) || - (void 0 !== s.num.re && - '0' !== s.num.re) || - void 0 === s.num.im - ? Xi('subtract', i, s) - : { - num: { - re: i.num, - im: (-parseFloat( - s.num.im - )).toString(), - }, - }) - : ((o = Ri[a]), - 'add' === o && i && 'subtract' === i.fn - ? (i = Xi( - 'add', - Fi(i, 0), - Yi(Fi(i, 1)), - s - )) - : o && i && i.fn === o && !ji(i) - ? void 0 !== s && - (s.fn === o && !ji(s) && s.arg - ? (i.arg = [...i.arg, ...s.arg]) - : i.arg && i.arg.push(s)) - : o && s && s.arg && s.fn === o - ? (s.arg.unshift(i), (i = s)) - : (i = - 'multiply' === o && - Hi(i) && - !ji(i) && - s && - 10 === Wi(s) && - Hi(s.sup) - ? Ji( - Wi(i) * - Math.pow( - 10, - Wi(s.sup) - ) - ) - : 'add' === o && - Hi(i) && - !ji(i) && - s && - 0 !== Ui(s) && - !ji(s) - ? { - num: { - re: i.num, - im: s.num.im, - }, - } - : Xi(o || _i[a] || a, i, s))); - } - } - } - return (t.ast = i), t; - } - function ns(t) { - if (!t) return []; - let e; - if (Array.isArray(t)) { - e = []; - for (const i of t) { - const t = ns(i); - e = e.concat(t); - } - } else { - if ('spacing' === t.type) return []; - 'first' === t.type || 'box' === t.type - ? (e = ns(t.body)) - : (t.body && Array.isArray(t.body) && (t.body = ns(t.body)), - t.superscript && - Array.isArray(t.superscript) && - (t.superscript = ns(t.superscript)), - t.subscript && - Array.isArray(t.subscript) && - (t.subscript = ns(t.subscript)), - t.index && - Array.isArray(t.index) && - (t.index = ns(t.index)), - t.denom && - Array.isArray(t.denom) && - (t.denom = ns(t.denom)), - t.numer && - Array.isArray(t.numer) && - (t.numer = ns(t.numer)), - t.array && - Array.isArray(t.array) && - (t.array = t.array.map(t => t.map(t => ns(t)))), - (e = [t])); - } - return e; - } - function rs(t, e) { - return (function(t, e) { - (t.index = t.index || 0), (t.ast = void 0); - const i = []; - for (; t.atoms[t.index]; ) - if ('text' === t.atoms[t.index].mode) { - let e = ''; - for ( - ; - t.atoms[t.index] && - 'text' === t.atoms[t.index].mode; - - ) - (e += t.atoms[t.index].body), (t.index += 1); - i.push(e); - } else { - const s = os(t, e).ast; - if (!s) return; - i.push(s); - } - return i.length > 1 ? Xi('text', ...i) : i[0] || void 0; - })({ atoms: ns(t) }, e); - } - function ls(t) { - const e = Array.prototype.slice.call(arguments); - e.shift(), (t = t || '.. '); - let i = ''; - if (e.length > 0) { - '.' !== t[0] && (i += t[0]); - let s = ''; - for (const a of e) (i += s + a), (s = t[2]); - '.' !== t[1] && (i += t[1]); - } - return i; - } - function cs(t, e) { - const i = t.length; - t = t.substr(0, e.precision - 2); - for (let i = 0; i < t.length - 16; i++) { - const s = t.substr(0, i); - for (let a = 0; a < 17; a++) { - const o = t.substr(i, a + 1), - n = Math.floor((t.length - s.length) / o.length); - if (n > 1 && (s + o.repeat(n + 1)).startsWith(t)) - return '0' === o - ? s.replace(/(\d{3})/g, '$1' + e.groupSeparator) - : s.replace(/(\d{3})/g, '$1' + e.groupSeparator) + - e.beginRepeatingDigits + - o.replace( - /(\d{3})/g, - '$1' + e.groupSeparator - ) + - e.endRepeatingDigits; - } - } - return ( - i !== t.length && (t += '\\ldots'), - t.replace(/(\d{3})/g, '$1' + e.groupSeparator) - ); - } - function hs(t) { - return parseFloat(parseFloat(t).toPrecision(15)); - } - function ds(t, e) { - let i = ''; - if ('number' == typeof e.precision) { - if ('number' != typeof t) { - let i = '', - s = ''; - if ( - ('-' === t[0] - ? ((i = '-'), (t = t.substr(1))) - : '+' === t[0] && (t = t.substr(1)), - t.indexOf('.') >= 0) - ) { - const a = t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/), - o = a[1], - n = a[2].substring( - 0, - Math.min(e.precision - o.length, a[2].length) - ); - if (((s = a[4] || ''), '0' === o)) { - let s = 0; - for (; '0' === n[s] && s < n.length; ) s += 1; - let a = ''; - if (s <= 4) - (a = '0' + e.decimalMarker), - (a += n.substr(0, s)), - (a += cs(t.substr(a.length), e)); - else if (s + 1 >= e.precision) (a = '0'), (i = ''); - else { - a = t[s]; - const i = cs(t.substr(s + 1), e); - i && (a += e.decimalMarker + i); - } - '0' !== a && - (t.length - 1 > e.precision && - !a.endsWith('}') && - !a.endsWith('\\ldots') && - (a += '\\ldots'), - s > 4 && - ((a += e.exponentProduct), - e.exponentMarker - ? (a += - e.exponentMarker + - (1 - s).toString()) - : (a += - '10^{' + - (1 - s).toString() + - '}'))), - (t = a); - } else { - t = o.replace( - /\B(?=(\d{3})+(?!\d))/g, - e.groupSeparator - ); - const i = cs(n, e); - i && (t += e.decimalMarker + i); - } - } else if (t.length > e.precision) { - const i = t.length; - let s = t[0]; - const a = cs(t.substr(2), e); - a && - ((s += e.decimalMarker + a), - '}' !== s[s.length - 1] && (s += '\\ldots')), - '1' !== s ? (s += e.exponentProduct) : (s = ''), - e.exponentMarker - ? (s += e.exponentMarker + (i - 2).toString()) - : (s += '10^{' + (i - 2).toString() + '}'), - (t = s); - } else - t = t.replace( - /\B(?=(\d{3})+(?!\d))/g, - e.groupSeparator - ); - return ( - s && - (s = e.exponentMarker - ? e.exponentMarker + s - : e.exponentProduct + ' 10^{' + s + '}'), - i + t + s - ); - } - t = hs(t); - } - if ('engineering' === e.scientificNotation) - if (0 === t) i = '0'; - else { - const s = Math.abs(t); - let a = Math.round(Math.log10(s)); - (a -= a % 3), s < 1e3 && (a = 0); - let o = s / Math.pow(10, a); - const n = o.toString().match(/^(.*)\.(.*)$/); - n && n[1] && n[2] && (o = n[1] + e.decimalMarker + n[2]), - e.groupSeparator && (o = cs(o.toExponential(), e)), - (a = - 0 === a - ? '' - : e.exponentMarker - ? e.exponentMarker + a - : e.exponentProduct + ' 10^{' + a + '}'), - (i = (t < 0 ? '-' : '') + o + a); - } - else { - const s = 'string' == typeof t ? t : t.toString(); - let a, - o, - n, - r = s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i); - (a = s), - (n = ''), - r && - r[1] && - r[2] && - ((a = r[1]), - (o = e.exponentMarker - ? e.exponentMarker + r[2] - : e.exponentProduct + ' 10^{' + r[2] + '}')), - (r = a.match(/^(.*)\.(.*)$/)), - r && r[1] && r[2] && ((a = r[1]), (n = r[2])), - e.groupSeparator && - ((a = a.replace( - /\B(?=(\d{3})+(?!\d))/g, - e.groupSeparator - )), - (n = cs(n, e))), - n && (n = e.decimalMarker + n), - (i = a + n + (o || '')); - } - return i; - } - (te.MathAtom.prototype.toAST = function(t) { - let e, - i, - s, - a, - o = {}, - r = '', - l = { - bb: 'double-struck', - cal: 'script', - scr: 'script', - frak: 'fraktur', - cmrss: 'sans-serif', - cmrtt: 'monospace', - }[this.baseFontFamily || this.fontFamily], - c = ''; - 'b' === this.fontSeries && (c += 'bold'), - 'it' === this.fontShape && (c += 'italic'); - const h = this.latex ? this.latex.trim() : null; - switch (this.type) { - case 'root': - case 'group': - this.latex && this.latex.startsWith('\\nicefrac') - ? ((e = this.latex - .slice(9) - .match(/({.*}|[^}])({.*}|[^}])/)), - e - ? ((i = - 1 === e[1].length - ? e[1] - : e[1].substr(1, e[1].length - 2)), - (i = he.parseTokens( - n(i), - 'math', - null, - t.macros - )), - (s = - 1 === e[2].length - ? e[2] - : e[2].substr(1, e[2].length - 2)), - (s = he.parseTokens( - n(s), - 'math', - null, - t.macros - )), - (o = Xi('divide', rs(i, t), rs(s, t)))) - : (o.fn = 'divide')) - : (o.group = rs(this.body, t)); - break; - case 'genfrac': - o = Xi( - 'divide', - rs(this.numer, t), - this.denom && - this.denom[0] && - 'placeholder' === this.denom[0].type - ? Ji(1) - : rs(this.denom, t) - ); - break; - case 'surd': - o = this.index - ? Xi( - 'pow', - rs(this.body, t), - Xi('divide', 1, rs(this.index, t)) - ) - : Xi('sqrt', rs(this.body, t)); - break; - case 'rule': - break; - case 'line': - case 'overlap': - case 'accent': - case 'overunder': - break; - case 'mord': - case 'textord': - case 'mbin': - (e = h - ? h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/) - : void 0), - e - ? (r = String.fromCodePoint(parseInt(e[1], 16))) - : ((r = qi(Ni(this))), - r.length > 0 && - '\\' === r.charAt(0) && - 'string' == typeof this.body && - (r = this.body)), - (a = At.mathVariantToUnicode(r, l, c) - .replace(/[\\]/g, '\\\\') - .replace(/["]/g, '\\"') - .replace(/[\b]/g, '\\b') - .replace(/[\f]/g, '\\f') - .replace(/[\n]/g, '\\n') - .replace(/[\r]/g, '\\r') - .replace(/[\t]/g, '\\t')), - a !== r - ? ((o = { sym: a }), (l = 'normal')) - : (o = { sym: r }); - break; - case 'minner': - case 'mop': - break; - case 'box': - o = rs(this.body, t); - break; - case 'enclose': - break; - case 'array': - if ('cardinality' === this.env.name) - o = Xi('card', rs(this.array, t)); - else if ( - /array|matrix|pmatrix|bmatrix/.test(this.env.name) - ) { - o = { fn: 'array', args: [] }; - for (const e of this.array) - o.args.push(e.map(e => rs(e, t))); - } else if ('cases' === this.env.name) { - o = { fn: 'cases', args: [] }; - for (const e of this.array) - if (e[0]) { - const i = []; - i.push(rs(e[0], t)); - let s = rs(e[1], t); - s && - 'text' === s.fn && - s.arg && - /^(if|when|for)$/i.test(s.arg[0].trim()) && - (s = s.arg.filter( - t => 'string' != typeof t - )), - i.push(s || {}), - o.args.push(i); - } - } - break; - case 'spacing': - case 'space': - case 'mathstyle': - break; - default: - o = void 0; - } - return ( - o && l && 'normal' !== l && (o.variant = l), - o && - 'string' == typeof this.cssClass && - (o.class = this.cssClass), - o && 'string' == typeof this.cssId && (o.id = this.cssId), - o - ); - }), - (te.toAST = function(t, e) { - return rs(t, e); - }); - var ps = function t(e, i) { - const s = Object.assign( - { - precision: 14, - decimalMarker: '.', - groupSeparator: '\\, ', - product: '\\cdot ', - exponentProduct: '\\cdot ', - exponentMarker: '', - arcSeparator: '\\,', - scientificNotation: 'auto', - beginRepeatingDigits: '\\overline{', - endRepeatingDigits: '}', - }, - i - ); - let a = ''; - if (void 0 === e) return ''; - if (('string' == typeof e && (e = JSON.parse(e)), e.latex)) - a = e.latex; - else if (Hi(e)) { - const i = Wi(e); - if (i === -1 / 0) a = '-\\infty '; - else if (i === 1 / 0) a = '\\infty '; - else if ( - 'object' != typeof e.num || - ('string' != typeof e.num.re && 'string' != typeof e.num.im) - ) - a = isNaN(i) ? '\\text{NaN}' : ds(e.num, s); - else { - const t = Vi(e), - i = Ui(e); - isNaN(t) || isNaN(i) - ? (a = '\\text{NaN}') - : Math.abs(i) <= Number.EPSILON && - Math.abs(t) <= Number.EPSILON - ? (a = '0') - : (Math.abs(t) > Number.EPSILON && (a = ds(t, s)), - Math.abs(i) > Number.EPSILON && - (Math.abs(t) > Number.EPSILON && - (a += i > 0 ? '+' : ''), - (a += - (1 !== Math.abs(i) ? ds(i, s) : '') + - '\\imaginaryI '))); - } - ji(e) && (a += '^{' + t(e.sup, s) + '}'), - Gi(e) && (a += '_{' + t(e.sub, s) + '}'); - } else if (e.group) - (a = t(e.group, s)), - Hi(e.group) || $i(e.group) - ? 0 !== Ui(e.group) && (a = ls(e.fence || '(),', a)) - : (a = ls(e.fence || '(),', a)), - ji(e) && (a += '^{' + t(e.sup, s) + '}'), - Gi(e) && (a += '_{' + t(e.sub, s) + '}'); - else if (e.fn) - if ('bind' === e.fn) { - if ( - ((a = t(Fi(e, 0), s) + '|_{'), - e.arg && 2 === e.arg.length) - ) - a += t(Fi(e, 1)); - else { - let i = ''; - for (let s = 1; s < e.arg.length; s += 2) - (a += i + t(Fi(e, s)) + ' = ' + t(Fi(e, s + 1))), - (i = ', '); - } - a += '}'; - } else if ('divide' === e.fn) - a = - '\\frac{' + - t(Fi(e, 0), s) + - '}{' + - t(Fi(e, 1), s) + - '}'; - else if ('negate' === e.fn) a = '-' + t(Fi(e, 0), s); - else if ('subtract' === e.fn) - a = t(Fi(e, 0), s) + ' - ' + t(Fi(e, 1), s); - else if ( - ('add' !== e.fn && 'multiply' !== e.fn) || - !Array.isArray(e.arg) - ) - if ('list' === e.fn || 'list2' === e.fn) { - const i = []; - for (const a of e.arg) i.push(t(a, s)); - a = i.join('list2' === e.fn ? '; ' : ', '); - } else if ( - 'pow' === e.fn && - Array.isArray(e.arg) && - e.arg.length >= 2 - ) - (a = t(Fi(e, 0), s)), - Hi(Fi(e, 0)) || - $i(Fi(e, 0)) || - (a = ls(e.fence || '(),', a)), - (a += '^{' + t(Fi(e, 1), s) + '}'); - else if ('equal' === e.fn && e.arg && e.arg.length > 2) - a = e.arg.map(e => t(e, s)).join(' = '); - else { - const i = (function(t) { - let e = Ti[t]; - return ( - e || - (e = - t.length > 1 - ? '\\operatorname{' + t + '}%^%_ %' - : t + '%^%_ %'), - e - ); - })(e.fn); - a = i; - let o = ''; - if ( - /%(?![01_^])/.test(i) && - Array.isArray(e.arg) && - e.arg.length > 1 - ) - a += ls( - e.fence || '(),', - ...e.arg.map(e => t(e, s)) - ); - else if (Array.isArray(e.arg) && e.arg.length > 0) { - const n = t(Fi(e, 0), s), - r = t(Fi(e, 1), s), - l = [...e.arg]; - /%0/.test(i) && - ((a = a.replace('%0', n)), l.shift()), - /%1/.test(i) && - ((a = a.replace('%1', r)), l.shift()), - l.length > 0 && - (o = ls( - e.fence || '(),', - ...l.map(e => t(e, s)) - )); - } else o = ls(e.fence || '(),', ''); - (a = ji(e) - ? a.replace('%^', '^{' + t(e.sup, s) + '}') - : a.replace('%^', '')), - (a = Gi(e) - ? a.replace('%_', '_{' + t(e.sub, s) + '}') - : a.replace('%_', '')), - (a = a.replace(/%(?![01_^])/, o)), - (a = a.replace('%0', '').replace('%1', '')); - } - else { - const i = []; - for (const a of e.arg) - 'add' === a.fn || 'subtract' === a.fn - ? i.push(ls('() ', t(a, s))) - : 0 !== Vi((o = a)) && 0 !== Ui(o) - ? i.push(ls('() ', t(a, s))) - : ji(e) && 0 !== Ui(a) && 1 !== Ui(a) - ? i.push(ls('() ', t(a, s))) - : i.push(t(a, s)); - if ('multiply' === e.fn) - a = - !e.arg || - 2 !== e.arg.length || - (!Hi(e.arg[0]) && 'divide' !== e.arg[0].fn) || - (Hi(e.arg[1]) && - (0 !== Vi(e.arg[1]) || 1 !== Ui(e.arg[1]))) - ? i.join(' \\times ') - : i[0] + i[1]; - else if (e.arg && 1 === e.arg.length) - a = - 'negate' === e.arg[0].fn || - (Hi(e.arg[0]) && Wi(e.arg[0]) < 0) - ? i[0] - : '+' + i[0]; - else { - a = i[0]; - for (let t = 1; t < e.arg.length; t++) - 'negate' === e.arg[t].fn || - (Hi(e.arg[t]) && Wi(e.arg[t]) < 0) - ? (a += i[t]) - : (a += ' + ' + i[t]); - } - } - else if ('string' == typeof e.sym) { - a = $i(e); - let i = a.match(/^&#x([0-9a-f]+);$/i); - i && i[1] - ? (a = String.fromCodePoint(parseInt(i[1], 16))) - : ((i = a.match(/^&#([0-9]+);$/i)), - i && i[1] && (a = String.fromCodePoint(parseInt(i[1])))), - 'string' == typeof e.variant && - (a = - '\\' + - { - normal: 'mathrm', - 'double-struck': 'mathbb', - bold: 'mathbf', - fraktur: 'mathfrak', - script: 'mathscr', - 'sans-serif': 'mathsf', - monospace: 'mathtt', - }[e.variant] + - '{' + - a + - '}'), - ji(e) && (a += '^{' + t(e.sup, s) + '}'), - Gi(e) && (a += '_{' + t(e.sub, s) + '}'); - } else 'string' == typeof e.text && (a = '\\text{' + e.text + '}'); - var o; - return ( - 'string' == typeof e.error && - (a = '\\bbox[#F56165]{' + a + '}'), - a - ); - }; - const ms = { - '\\alpha': 'alpha ', - '\\mu': 'mew ', - '\\sigma': 'sigma ', - '\\pi': 'pie ', - '\\imaginaryI': 'eye ', - '\\sum': 'Summation ', - '\\prod': 'Product ', - a: 'a', - A: 'capital A', - '+': 'plus ', - '-': 'minus ', - ';': ' semi-colon ', - ',': ' comma ', - '|': 'Vertical bar', - '(': 'Open paren. ', - ')': ' Close paren. ', - '=': 'equals ', - '<': 'is less than ', - '\\lt': 'is less than ', - '<=': 'is less than or equal to ', - '\\le': 'is less than or equal to ', - '\\gt': 'is greater than ', - '>': 'is greater than ', - '\\ge': 'is greater than or equal to ', - '\\geq': 'is greater than or equal to ', - '\\leq': 'is less than or equal to ', - '!': 'factorial ', - '\\sin': 'sine ', - '\\cos': 'cosine ', - '​': '', - '−': 'minus ', - ':': ' such that ', - '\\colon': ' such that ', - '\\hbar': 'etch bar ', - '\\iff': - 'if, and only if, ', - '\\Longleftrightarrow': - 'if, and only if, ', - '\\land': 'and ', - '\\lor': 'or ', - '\\neg': 'not ', - '\\div': 'divided by ', - '\\forall': 'for all ', - '\\exists': 'there exists ', - '\\nexists': 'there does not exists ', - '\\in': 'element of ', - '\\N': - 'the set n', - '\\C': - 'the set c', - '\\Z': - 'the set z', - '\\Q': - 'the set q', - '\\infty': 'infinity ', - '\\nabla': 'nabla ', - '\\partial': 'partial derivative of ', - '\\cdots': 'dot dot dot ', - '\\Rightarrow': 'implies ', - '\\lbrace': 'open brace', - '\\{': 'open brace', - '\\rbrace': 'close brace', - '\\}': 'close brace', - '\\langle': - 'left angle bracket', - '\\rangle': - 'right angle bracket', - '\\lfloor': 'open floor', - '\\rfloor': 'close floor', - '\\lceil': 'open ceiling', - '\\rceil': - 'close ceiling', - '\\vert': 'vertical bar', - '\\mvert': 'divides', - '\\lvert': - 'left vertical bar', - '\\rvert': - 'right vertical bar', - '\\lbrack': - ' open square bracket ', - '\\rbrack': - ' close square bracket ', - mm: 'millimeters', - cm: 'centimeters', - km: 'kilometers', - kg: 'kilograms', - }; - function us(t) { - let e = 0; - if (t && Array.isArray(t)) - for (const i of t) 'first' !== i.type && (e += 1); - return 1 === e; - } - function fs(t) { - let e = ''; - if (t && Array.isArray(t)) - for (const i of t) - 'first' !== i.type && - 'string' == typeof i.body && - (e += i.body); - return e; - } - function gs(t, e, i, s) { - e = e.split(' '); - for (const a of e) { - const e = a.match(/(.*):(.*)/); - if (e) { - const a = s || {}; - 'active' === e[2] ? (a.passive = !1) : (a[e[2]] = !0), - t.addEventListener(e[1], i, a); - } else t.addEventListener(a, i, s); - } - } - function ys(t, e, i, s) { - e = e.split(' '); - for (const a of e) { - const e = a.match(/(.*):(.*)/); - if (e) { - const a = s || {}; - 'active' === e[2] ? (a.passive = !1) : (a[e[2]] = !0), - t.removeEventListener(e[1], i, a); - } else t.removeEventListener(a, i, s); - } - } - function bs(t, e) { - let i = document.getElementById(t); - return ( - i - ? i.setAttribute( - 'data-refcount', - parseInt(i.getAttribute('data-refcount')) + 1 - ) - : ((i = document.createElement('div')), - i.setAttribute('aria-hidden', 'true'), - i.setAttribute('data-refcount', '1'), - (i.className = e), - (i.id = t), - document.body.appendChild(i)), - i - ); - } - function xs(t) { - if (!t) return null; - const e = parseInt(t.getAttribute('data-refcount')); - return ( - e && 1 !== e - ? t.setAttribute('data-refcount', e - 1) - : t.remove(), - t - ); - } - function ks(t) { - return t.element && t.element.mathfield === t; - } - (te.toSpeakableFragment = function(t, e) { - function i(t) { - return '' + t + ''; - } - if (!t) return ''; - let s = ''; - if ( - (t.id && - 'math' === e.speechMode && - (s += ''), - Array.isArray(t)) - ) { - let a = !1, - o = !1; - for (let n = 0; n < t.length; n++) - 'text' !== t[n].mode && (o = !1), - n < t.length - 2 && - 'mopen' === t[n].type && - 'mclose' === t[n + 2].type && - 'mord' === t[n + 1].type - ? ((s += ' of '), - (s += i(te.toSpeakableFragment(t[n + 1], e))), - (n += 2)) - : 'text' === t[n].mode - ? o - ? (s += t[n].body ? t[n].body : ' ') - : ((o = !0), - (s += te.toSpeakableFragment(t[n], e))) - : 'mord' === t[n].type && - /[0123456789,.]/.test(t[n].body) - ? a - ? (s += t[n].body) - : ((a = !0), - (s += te.toSpeakableFragment(t[n], e))) - : ((a = !1), - (s += te.toSpeakableFragment(t[n], e))); - } else if ('text' === t.mode) s += t.body; - else { - let a = '', - o = '', - n = '', - r = !1; - switch (t.type) { - case 'group': - case 'root': - s += te.toSpeakableFragment(t.body, e); - break; - case 'genfrac': - if ( - ((a = te.toSpeakableFragment(t.numer, e)), - (o = te.toSpeakableFragment(t.denom, e)), - us(t.numer) && us(t.denom)) - ) { - const e = { - '1/2': ' half ', - '1/3': ' one third ', - '2/3': ' two third', - '1/4': ' one quarter ', - '3/4': ' three quarter ', - '1/5': ' one fifth ', - '2/5': ' two fifths ', - '3/5': ' three fifths ', - '4/5': ' four fifths ', - '1/6': ' one sixth ', - '5/6': ' five sixths ', - '1/8': ' one eight ', - '3/8': ' three eights ', - '5/8': ' five eights ', - '7/8': ' seven eights ', - '1/9': ' one ninth ', - '2/9': ' two ninths ', - '4/9': ' four ninths ', - '5/9': ' five ninths ', - '7/9': ' seven ninths ', - '8/9': ' eight ninths ', - }[fs(t.numer) + '/' + fs(t.denom)]; - e ? (s = e) : (s += a + ' over ' + o); - } else - s += - ' the fraction ' + - a + - ', over ' + - o + - '. End fraction.'; - break; - case 'surd': - if ( - ((n = te.toSpeakableFragment(t.body, e)), t.index) - ) { - let i = te.toSpeakableFragment(t.index, e); - i = i.trim(); - const a = i.replace(//g, ''); - s += - '3' === a - ? ' the cube root of ' + - n + - '. End cube root' - : 'n' === a - ? ' the nth root of ' + - n + - '. End root' - : ' the root with index: ' + - i + - ', of ' + - n + - '. End root'; - } else - us(t.body) - ? (s += ' the square root of ' + n + ' , ') - : (s += - ' the square root of ' + - n + - '. End square root'); - break; - case 'accent': - break; - case 'leftright': - (s += ms[t.leftDelim] || t.leftDelim), - (s += te.toSpeakableFragment(t.body, e)), - (s += ms[t.rightDelim] || t.rightDelim); - break; - case 'line': - case 'rule': - case 'overunder': - case 'overlap': - break; - case 'placeholder': - s += 'placeholder ' + t.body; - break; - case 'delim': - case 'sizeddelim': - case 'mord': - case 'minner': - case 'mbin': - case 'mrel': - case 'mpunct': - case 'mopen': - case 'mclose': - case 'textord': { - const i = t.latex ? t.latex.trim() : ''; - if ( - '\\mathbin' === i || - '\\mathrel' === i || - '\\mathopen' === i || - '\\mathclose' === i || - '\\mathpunct' === i || - '\\mathord' === i || - '\\mathinner' === i - ) { - s = te.toSpeakableFragment(t.body, e); - break; - } - let a = t.body, - o = t.latex; - if ( - (('delim' !== t.type && 'sizeddelim' !== t.type) || - (a = o = t.delim), - 'text' === e.speechMode) - ) - s += a; - else { - if ( - ('mbin' === t.type && - (s += ''), - a) - ) { - const t = ms[a] || (o ? ms[o.trim()] : ''); - if (t) s += ' ' + t; - else { - const t = o - ? (function(t) { - let e = Je.NOTES[t]; - return ( - e || - '\\' !== t.charAt(0) || - (e = - ' ' + - t.replace('\\', '') + - ' '), - Array.isArray(e) && - (e = e[0]), - e - ); - })(o.trim()) - : ''; - s += - t || - (function(t) { - let i = ''; - return ( - e.textToSpeechMarkup - ? /[a-z]/.test(t) - ? (i += - ' ' + - t + - '') - : /[A-Z]/.test(t) - ? (i += - 'capital ' + - t.toLowerCase()) - : (i += t) - : /[a-z]/.test(t) - ? (i += - " '" + - t.toUpperCase() + - "'") - : /[A-Z]/.test(t) - ? (i += - " 'capital " + - t.toUpperCase() + - "'") - : (i += t), - i - ); - })(a); - } - } else s += te.toSpeakableFragment(t.body, e); - 'mbin' === t.type && (s += ''); - } - break; - } - case 'mop': - if ('​' !== t.body) { - const a = t.latex ? t.latex.trim() : ''; - if ('\\sum' === a) - if (t.superscript && t.subscript) { - let i = te.toSpeakableFragment( - t.superscript, - e - ); - i = i.trim(); - let a = te.toSpeakableFragment( - t.subscript, - e - ); - (a = a.trim()), - (s += - ' the summation from ' + - a + - ' to ' + - i + - ' of '), - (r = !0); - } else if (t.subscript) { - let i = te.toSpeakableFragment( - t.subscript, - e - ); - (i = i.trim()), - (s += - ' the summation from ' + - i + - ' of '), - (r = !0); - } else s += ' the summation of'; - else if ('\\prod' === a) - if (t.superscript && t.subscript) { - let i = te.toSpeakableFragment( - t.superscript, - e - ); - i = i.trim(); - let a = te.toSpeakableFragment( - t.subscript, - e - ); - (a = a.trim()), - (s += - ' the product from ' + - a + - ' to ' + - i + - ' of '), - (r = !0); - } else if (t.subscript) { - let i = te.toSpeakableFragment( - t.subscript, - e - ); - (i = i.trim()), - (s += - ' the product from ' + - i + - ' of '), - (r = !0); - } else s += ' the product of '; - else if ('\\int' === a) - if (t.superscript && t.subscript) { - let a = te.toSpeakableFragment( - t.superscript, - e - ); - a = a.trim(); - let o = te.toSpeakableFragment( - t.subscript, - e - ); - (o = o.trim()), - (s += - ' the integral from ' + - i(o) + - ' to ' + - i(a) + - ' of '), - (r = !0); - } else - s += - ' the integral of '; - else if ('string' == typeof t.body) { - s += - ms[t.body] || - ms[t.latex.trim()] || - ' ' + t.body; - } else - t.latex && - t.latex.length > 0 && - ('\\' === t.latex[0] - ? (s += ' ' + t.latex.substr(1)) - : (s += ' ' + t.latex)); - } - break; - case 'enclose': - (n = te.toSpeakableFragment(t.body, e)), - us(t.body) - ? (s += ' crossed out ' + n + ' , ') - : (s += - ' crossed out ' + n + '. End cross out'); - } - if (!r && t.superscript) { - let i = te.toSpeakableFragment(t.superscript, e); - i = i.trim(); - const a = i.replace(/<[^>]*>/g, ''); - if (us(t.superscript)) { - if ('math' === e.speechMode) { - const e = (function(t) { - if (t && Array.isArray(t)) - for (const e of t) - if ('first' !== e.type && e.id) - return e.id.toString(); - return ''; - })(t.superscript); - e && (s += ''); - } - '′' === a - ? (s += ' prime ') - : '2' === a - ? (s += ' squared ') - : '3' === a - ? (s += ' cubed ') - : isNaN(parseInt(a)) - ? (s += ' to the ' + i + '; ') - : (s += - ' to the ' + - a + - ' power; '); - } else - isNaN(parseInt(a)) - ? (s += ' raised to the ' + i + '; ') - : (s += - ' raised to the ' + - a + - ' power; '); - } - if (!r && t.subscript) { - let i = te.toSpeakableFragment(t.subscript, e); - (i = i.trim()), - us(t.subscript) - ? (s += ' sub ' + i) - : (s += ' subscript ' + i + '. End subscript. '); - } - } - return s; - }), - (te.toSpeakableText = function(t, e) { - const i = e - ? JSON.parse(JSON.stringify(e)) - : { textToSpeechMarkup: '', textToSpeechRules: 'mathlive' }; - if ( - ((i.speechMode = 'math'), - window.sre && 'sre' === i.textToSpeechRules) - ) { - i.generateID = !0; - const e = te.toMathML(t, i); - return e - ? (i.textToSpeechMarkup && - ((i.textToSpeechRulesOptions = - i.textToSpeechRulesOptions || {}), - (i.textToSpeechRulesOptions.markup = - i.textToSpeechMarkup), - 'ssml' === i.textToSpeechRulesOptions.markup && - (i.textToSpeechRulesOptions.markup = - 'ssml_step'), - (i.textToSpeechRulesOptions.rate = - i.speechEngineRate)), - i.textToSpeechRulesOptions && - window.sre.System.getInstance().setupEngine( - i.textToSpeechRulesOptions - ), - window.sre.System.getInstance().toSpeech(e)) - : ''; - } - let s = te.toSpeakableFragment(t, i); - if ('ssml' === i.textToSpeechMarkup) { - let t = ''; - i.speechEngineRate && - (t = ''), - (s = - '' + - t + - '

    ' + - s + - '

    ' + - (t ? '
    ' : '') + - ''); - } else - s = - 'mac' === i.textToSpeechMarkup && - 'mac' === - (function(t) { - let e = 'other'; - return ( - navigator && - navigator.platform && - navigator.userAgent && - (/^(mac)/i.test(navigator.platform) - ? (e = 'mac') - : /^(win)/i.test(navigator.platform) - ? (e = 'win') - : /(android)/i.test( - navigator.userAgent - ) - ? (e = 'android') - : /(iphone)/i.test( - navigator.userAgent - ) || - /(ipod)/i.test( - navigator.userAgent - ) || - /(ipad)/i.test( - navigator.userAgent - ) - ? (e = 'ios') - : /\bCrOS\b/i.test( - navigator.userAgent - ) && (e = 'chromeos')), - e === t ? t : '!' + t - ); - })('mac') - ? s - .replace(//g, '') - .replace(//g, '[[emph+]]') - .replace(/<\/emphasis>/g, '') - .replace( - //g, - '[[slc $1]]' - ) - .replace(/]*>/g, '') - .replace(/<\/say-as>/g, '') - : s.replace(/<[^>]*>/g, '').replace(/\s{2,}/g, ' '); - return s; - }); - class vs { - constructor(t, e) { - this.$setConfig(e || {}), - (this.element = t), - (t.mathfield = this), - (this.originalContent = t.innerHTML); - let i = this.element.textContent; - i && (i = i.trim()); - let s = ''; - this.config.substituteTextArea - ? 'string' == typeof this.config.substituteTextArea - ? (s += this.config.substituteTextArea) - : (s += '') - : /android|ipad|ipod|iphone/i.test(navigator.userAgent) - ? (s += - "\n \n \n ") - : (s += - ''), - (s += - ''), - this.config.virtualKeyboardMode || - (this.config.virtualKeyboardMode = - window.matchMedia && - window.matchMedia('(any-pointer: coarse)').matches - ? 'onfocus' - : 'off'), - 'manual' === this.config.virtualKeyboardMode - ? ((s += `')) - : (s += ''), - (s += ''), - (s += - '\n
    \n \n \n
    \n '), - (this.element.innerHTML = s); - let a = 0; - 'function' == typeof this.config.substituteTextArea - ? (this.textarea = this.config.substituteTextArea()) - : (this.textarea = this.element.children[ - a++ - ].firstElementChild), - (this.field = this.element.children[a].children[0]), - this.field.addEventListener( - 'wheel', - t => { - t.preventDefault(), t.stopPropagation(); - let e = void 0 === t.deltaX ? t.detail : -t.deltaX; - isFinite(e) || (e = t.wheelDelta / 10), - this.field.scroll({ - top: 0, - left: this.field.scrollLeft - 5 * e, - }); - }, - { passive: !1 } - ), - (this.virtualKeyboardToggleDOMNode = this.element.children[ - a++ - ].children[1]), - this._attachButtonHandlers( - this.virtualKeyboardToggleDOMNode, - { - default: 'toggleVirtualKeyboard', - alt: 'toggleVirtualKeyboardAlt', - shift: 'toggleVirtualKeyboardShift', - } - ), - (this.ariaLiveText = this.element.children[a].children[0]), - (this.accessibleNode = this.element.children[ - a++ - ].children[1]), - (this.popover = bs( - 'mathlive-popover-panel', - 'ML__popover' - )), - (this.keystrokeCaption = bs( - 'mathlive-keystroke-caption-panel', - 'ML__keystroke-caption' - )), - (this.keystrokeCaptionVisible = !1), - (this.virtualKeyboardVisible = !1), - (this.keystrokeBuffer = ''), - (this.keystrokeBufferStates = []), - (this.keystrokeBufferResetTimer = null), - (this.suggestionIndex = 0), - (this.mode = e.defaultMode || 'math'), - (this.smartModeSuppressed = !1), - (this.style = {}), - (this.blurred = !0), - gs(this.element, 'focus', this), - gs(this.element, 'blur', this), - gs(this.textarea, 'cut', this), - gs(this.textarea, 'copy', this), - gs(this.textarea, 'paste', this), - He.delegateKeyboardEvents(this.textarea, { - container: this.element, - allowDeadKey: () => 'text' === this.mode, - typedText: this._onTypedText.bind(this), - paste: this._onPaste.bind(this), - keystroke: this._onKeystroke.bind(this), - focus: this._onFocus.bind(this), - blur: this._onBlur.bind(this), - }), - window.PointerEvent - ? gs(this.field, 'pointerdown', this) - : gs(this.field, 'touchstart:active mousedown', this), - gs(window, 'resize', this); - const o = { ...e }; - (o.onSelectionDidChange = vs.prototype._onSelectionDidChange.bind( - this - )), - (o.onContentDidChange = vs.prototype._onContentDidChange.bind( - this - )), - (o.onAnnounce = this.config.onAnnounce), - (o.macros = this.config.macros), - (o.removeExtraneousParentheses = this.config.removeExtraneousParentheses), - (this.mathlist = new Oe.EditableMathlist(o, this)), - (this.undoManager = new (class { - constructor(t) { - (this.mathlist = t), - (this.maximumDepth = 1e3), - (this.record = !1), - (this.canCoalesce = !1), - this.reset(); - } - reset() { - (this.stack = []), (this.index = -1); - } - startRecording() { - this.record = !0; - } - canUndo() { - return this.index > 0; - } - canRedo() { - return this.index !== this.stack.length - 1; - } - undo(t) { - this.canUndo() && - (t && - 'function' == - typeof t.onUndoStateWillChange && - t.onUndoStateWillChange( - this.mathlist.target, - 'undo' - ), - this.restore(this.stack[this.index - 1], t), - (this.index -= 1), - t && - 'function' == - typeof t.onUndoStateDidChange && - t.onUndoStateDidChange( - this.mathlist.target, - 'undo' - ), - (this.canCoalesce = !1)); - } - redo(t) { - this.canRedo() && - (t && - 'function' === t.onUndoStateWillChange && - t.onUndoStateWillChange( - this.mathlist.target, - 'redo' - ), - (this.index += 1), - this.restore(this.stack[this.index], t), - t && - 'function' == - typeof t.onUndoStateDidChange && - t.onUndoStateDidChange( - this.mathlist.target, - 'redo' - ), - (this.canCoalesce = !1)); - } - pop() { - this.canUndo() && - ((this.index -= 1), this.stack.pop()); - } - snapshot(t) { - this.record && - (t && - 'function' === t.onUndoStateWillChange && - t.onUndoStateWillChange( - this.mathlist.target, - 'snapshot' - ), - this.stack.splice( - this.index + 1, - this.stack.length - this.index - 1 - ), - this.stack.push({ - latex: this.mathlist.root.toLatex(), - selection: this.mathlist.toString(), - }), - this.index++, - this.stack.length > this.maximumDepth && - this.stack.shift(), - t && - 'function' == - typeof t.onUndoStateDidChange && - t.onUndoStateDidChange( - this.mathlist.target, - 'snapshot' - ), - (this.canCoalesce = !1)); - } - snapshotAndCoalesce(t) { - this.canCoalesce && this.pop(), - this.snapshot(t), - (this.canCoalesce = !0); - } - save() { - return { - latex: this.mathlist.root.toLatex(), - selection: this.mathlist.toString(), - }; - } - restore(t, e) { - const i = this.mathlist.suppressChangeNotifications; - void 0 !== e.suppressChangeNotifications && - (this.mathlist.suppressChangeNotifications = - e.suppressChangeNotifications), - this.mathlist.insert(t ? t.latex : '', { - mode: 'math', - insertionMode: 'replaceAll', - selectionMode: 'after', - format: 'latex', - ...e, - }), - this.mathlist.setPath( - t - ? t.selection - : [{ relation: 'body', offset: 0 }] - ), - (this.mathlist.suppressChangeNotifications = i); - } - })(this.mathlist)), - i.length > 0 && this.$latex(i), - this.undoManager.startRecording(), - this.undoManager.snapshot(this.config); - } - handleEvent(t) { - switch (t.type) { - case 'focus': - this._onFocus(t); - break; - case 'blur': - this._onBlur(t); - break; - case 'touchstart': - case 'mousedown': - case 'pointerdown': - this._onPointerDown(t); - break; - case 'resize': - this._resizeTimer && - window.cancelAnimationFrame(this._resizeTimer), - (this._resizeTimer = window.requestAnimationFrame( - () => ks(this) && this._onResize() - )); - break; - case 'cut': - this._onCut(t); - break; - case 'copy': - this._onCopy(t); - break; - case 'paste': - this._onPaste(t); - } - } - $revertToOriginalContent() { - (this.element.innerHTML = this.originalContent), - (this.element.mathfield = null), - delete this.accessibleNode, - delete this.ariaLiveText, - delete this.field, - ys(this.textarea, 'cut', this), - ys(this.textarea, 'copy', this), - ys(this.textarea, 'paste', this), - this.textarea.remove(), - delete this.textarea, - this.virtualKeyboardToggleDOMNode.remove(), - delete this.virtualKeyboardToggleDOMNode, - xs(this.popover), - xs(this.keystrokeCaption), - xs(this.virtualKeyboard), - xs( - document.getElementById('mathlive-alternate-keys-panel') - ), - ys(this.element, 'pointerdown', this), - ys(this.element, 'touchstart:active mousedown', this), - ys(this.element, 'focus', this), - ys(this.element, 'blur', this), - ys(window, 'resize', this), - delete this.element; - } - _resetKeystrokeBuffer() { - (this.keystrokeBuffer = ''), - (this.keystrokeBufferStates = []), - clearTimeout(this.keystrokeBufferResetTimer); - } - _getCaretPosition() { - const t = (function t(e) { - if ( - e.classList.contains('ML__caret') || - e.classList.contains('ML__text-caret') || - e.classList.contains('ML__command-caret') - ) - return e; - let i; - return ( - Array.from(e.children).forEach(function(e) { - i = i || t(e); - }), - i - ); - })(this.field); - if (t) { - const e = t.getBoundingClientRect(); - return { x: e.right, y: e.bottom, height: e.height }; - } - return null; - } - _getSelectionBounds() { - const t = this.field.querySelectorAll('.ML__selected'); - if (t && t.length > 0) { - const e = { - top: 1 / 0, - bottom: -1 / 0, - left: 1 / 0, - right: -1 / 0, - }; - t.forEach(t => { - const i = t.getBoundingClientRect(); - i.left < e.left && (e.left = i.left), - i.right > e.right && (e.right = i.right), - i.bottom > e.bottom && (e.bottom = i.bottom), - i.top < e.top && (e.top = i.top); - }); - const i = this.field.getBoundingClientRect(), - s = e.right - e.left, - a = e.bottom - e.top; - return ( - (e.left = Math.ceil( - e.left - i.left + this.field.scrollLeft - )), - (e.right = e.left + s), - (e.top = Math.ceil(e.top - i.top)), - (e.bottom = e.top + a), - e - ); - } - return null; - } - _pathFromPoint(t, e, i) { - let s; - (i = i || {}).bias = i.bias || 0; - const a = (function t(e, i, s) { - let a = { - element: null, - distance: Number.POSITIVE_INFINITY, - }, - o = !0; - if (e.getAttribute('data-atom-id')) { - a.element = e; - const t = e.getBoundingClientRect(), - n = i - (t.left + t.right) / 2, - r = s - (t.top + t.bottom) / 2; - (a.distance = n * n + r * r), - (o = i >= t.left && i <= t.right); - } - return ( - o && - e.children && - Array.from(e.children).forEach(function(e) { - const o = t(e, i, s); - o.element && - o.distance <= a.distance && - (a = o); - }), - a - ); - })(this.field, t, e).element, - o = a ? a.getAttribute('data-atom-id') : null; - if (o) { - const e = this.mathlist.filter(function(t, e) { - return e.captureSelection - ? e.filter(t => t.id === o).length > 0 - : e.id === o; - }); - if (e && e.length > 0) - if ( - ((s = me.pathFromString(e[0]).path), 0 === i.bias) - ) { - const e = a.getBoundingClientRect(); - t < e.left + e.width / 2 && - !a.classList.contains('ML__placeholder') && - (s[s.length - 1].offset = Math.max( - 0, - s[s.length - 1].offset - 1 - )); - } else - i.bias < 0 && - (s[s.length - 1].offset = Math.min( - this.mathlist.siblings().length - 1, - Math.max(0, s[s.length - 1].offset + i.bias) - )); - } - return s; - } - _onPointerDown(t) { - const e = this; - let i, - s = !1, - a = !1, - o = !1; - if (1 !== t.buttons) return; - function n(t) { - window.PointerEvent - ? (ys(e.field, 'pointermove', h), - ys( - e.field, - 'pointerend pointerleave pointercancel', - n - ), - e.field.releasePointerCapture(t.pointerId)) - : (ys(e.field, 'touchmove', h), - ys(e.field, 'touchend touchleave', n), - ys(window, 'mousemove', h), - ys(window, 'mouseup blur', n)), - (s = !1), - clearInterval(c), - e.element - .querySelectorAll('.ML__scroller') - .forEach(t => t.parentNode.removeChild(t)), - t.preventDefault(), - t.stopPropagation(); - } - let r = !1, - l = !1; - const c = setInterval(() => { - r - ? e.field.scroll({ - top: 0, - left: e.field.scrollLeft - 16, - }) - : l && - e.field.scroll({ - top: 0, - left: e.field.scrollLeft + 16, - }); - }, 32); - function h(t) { - const s = t.touches ? t.touches[0].clientX : t.clientX, - o = t.touches ? t.touches[0].clientY : t.clientY, - n = 'touch' === t.pointerType ? 20 : 5; - if ( - Date.now() < m + 500 && - Math.abs(d - s) < n && - Math.abs(p - o) < n - ) - return t.preventDefault(), void t.stopPropagation(); - const c = e.field.getBoundingClientRect(); - (l = s > c.right), (r = s < c.left); - let h = i; - window.PointerEvent - ? t.isPrimary || - (h = e._pathFromPoint(t.clientX, t.clientY, { - bias: 0, - })) - : t.touches && - 2 === t.touches.length && - (h = e._pathFromPoint( - t.touches[1].clientX, - t.touches[1].clientY, - { bias: 0 } - )); - const u = e._pathFromPoint(s, o, { - bias: s <= d ? (s === d ? 0 : -1) : 1, - }); - u && - e.mathlist.setRange(h, u, { - extendToWordBoundary: a, - }) && - e._requestUpdate(), - t.preventDefault(), - t.stopPropagation(); - } - const d = t.touches ? t.touches[0].clientX : t.clientX, - p = t.touches ? t.touches[0].clientY : t.clientY, - m = Date.now(); - ws && - Math.abs(ws.x - d) < 5 && - Math.abs(ws.y - p) < 5 && - Date.now() < ws.time + 500 - ? ((Ss += 1), (ws.time = m)) - : ((ws = { x: d, y: p, time: m }), (Ss = 1)); - const u = this.field.getBoundingClientRect(); - if ( - d >= u.left && - d <= u.right && - p >= u.top && - p <= u.bottom - ) { - if ( - (this.$hasFocus() || - ((o = !0), - this.textarea.focus && this.textarea.focus()), - this._resetKeystrokeBuffer(), - (this.smartModeSuppressed = !1), - (i = this._pathFromPoint(d, p, { bias: 0 })), - i) - ) { - let r = document.createElement('div'); - (r.className = 'ML__scroller'), - this.element.appendChild(r), - (r.style.left = u.left - 200 + 'px'), - (r = document.createElement('div')), - (r.className = 'ML__scroller'), - this.element.appendChild(r), - (r.style.left = u.right + 'px'), - t.shiftKey - ? (this.mathlist.setRange( - this.mathlist.path, - i - ), - (i = me.clone(this.mathlist.path)), - (i[i.length - 1].offset -= 1)) - : this.mathlist.setPath(i, 0), - (o = !0), - (this.style = {}), - 3 === t.detail || Ss > 2 - ? (n(t), - (3 !== t.detail && 3 !== Ss) || - this.mathlist.selectAll_()) - : s || - ((s = !0), - window.PointerEvent - ? (gs(e.field, 'pointermove', h), - gs( - e.field, - 'pointerend pointercancel pointerup', - n - ), - e.field.setPointerCapture(t.pointerId)) - : (gs(window, 'blur', n), - t.touches - ? (gs(t.target, 'touchmove', h), - gs(t.target, 'touchend', n)) - : (gs(window, 'mousemove', h), - gs(window, 'mouseup', n))), - (2 !== t.detail && 2 !== Ss) || - ((a = !0), this.mathlist.selectGroup_())); - } - } else ws = null; - o && this._requestUpdate(), t.preventDefault(); - } - _onSelectionDidChange() { - this.mathlist.commitCommandStringBeforeInsertionPoint(); - let t = ''; - this.mathlist.forEachSelected(e => { - t += e.toLatex(); - }), - t - ? ((this.textarea.value = t), - this.$hasFocus() && - this.textarea.select && - this.textarea.select()) - : ((this.textarea.value = ''), - this.textarea.setAttribute('aria-label', '')); - { - const t = this.mode; - (this.mode = - this.mathlist.anchorMode() || this.config.defaultMode), - this.mode !== t && - 'function' == typeof this.config.onModeChange && - this.config.onModeChange(this, this.mode), - 'command' === t && - 'command' !== this.mode && - (Je.hidePopover(this), - this.mathlist.removeCommandString()); - } - Je.updatePopoverPosition(this, { deferred: !0 }), - 'function' == typeof this.config.onSelectionDidChange && - this.config.onSelectionDidChange(this); - } - _onContentDidChange() { - this.undoManager.canRedo() - ? this.element.classList.add('can-redo') - : this.element.classList.remove('can-redo'), - this.undoManager.canUndo() - ? this.element.classList.add('can-undo') - : this.element.classList.remove('can-undo'), - 'function' == typeof this.config.onContentDidChange && - this.config.onContentDidChange(this); - } - _nextAtomSpeechText(t) { - function e(t, e) { - return 'body' === e.relation - ? { - enclose: 'cross out', - leftright: 'fence', - surd: 'square root', - root: 'math field', - }[t.type] - : { - numer: 'numerator', - denom: 'denominator', - index: 'index', - body: 'parent', - subscript: 'subscript', - superscript: 'superscript', - }[e.relation]; - } - const i = t ? t.path : [], - s = this.mathlist.path, - a = s[s.length - 1]; - let o = ''; - for (; i.length > s.length; ) - (o += 'out of ' + e(t.parent(), i[i.length - 1]) + '; '), - i.pop(); - if (!this.mathlist.isCollapsed()) - return As(this, '', this.mathlist.getSelectedAtoms()); - const n = e(this.mathlist.parent(), a); - 0 === a.offset && - (o += (n ? 'start of ' + n : 'unknown') + ': '); - const r = this.mathlist.sibling( - Math.max(1, this.mathlist.extent) - ); - return ( - r - ? (o += As(this, '', r)) - : 0 !== a.offset && - (o += n ? 'end of ' + n : 'unknown'), - o - ); - } - _announce(t, e, i) { - 'function' == typeof this.config.onAnnounce && - this.config.onAnnounce(this, t, e, i); - } - _onFocus() { - this.blurred && - ((this.blurred = !1), - this.textarea.focus && this.textarea.focus(), - 'onfocus' === this.config.virtualKeyboardMode && - this.showVirtualKeyboard_(), - Je.updatePopoverPosition(this), - this.config.onFocus && this.config.onFocus(this), - this._requestUpdate()); - } - _onBlur() { - this.blurred || - ((this.blurred = !0), - (this.ariaLiveText.textContent = ''), - 'onfocus' === this.config.virtualKeyboardMode && - this.hideVirtualKeyboard_(), - this.complete_({ discard: !0 }), - this._requestUpdate(), - this.config.onBlur && this.config.onBlur(this)); - } - _onResize() { - this.element.classList.remove( - 'ML__isNarrowWidth', - 'ML__isWideWidth', - 'ML__isExtendedWidth' - ), - window.innerWidth >= 1024 - ? this.element.classList.add('ML__isExtendedWidth') - : window.innerWidth >= 768 - ? this.element.classList.add('ML__isWideWidth') - : this.element.classList.add('ML__isNarrowWidth'), - Je.updatePopoverPosition(this); - } - toggleKeystrokeCaption_() { - (this.keystrokeCaptionVisible = !this.keystrokeCaptionVisible), - (this.keystrokeCaption.innerHTML = ''), - this.keystrokeCaptionVisible || - (this.keystrokeCaption.style.visibility = 'hidden'); - } - _showKeystroke(t) { - const e = this.keystrokeCaption; - if (e && this.keystrokeCaptionVisible) { - const i = this.element.getBoundingClientRect(); - (e.style.left = i.left + 'px'), - (e.style.top = i.top - 64 + 'px'), - (e.innerHTML = - '' + - (ve.stringify(t) || t) + - '' + - e.innerHTML), - (e.style.visibility = 'visible'), - setTimeout(function() { - e.childNodes.length > 0 && - e.removeChild( - e.childNodes[e.childNodes.length - 1] - ), - 0 === e.childNodes.length && - (e.style.visibility = 'hidden'); - }, 3e3); - } - } - $perform(t) { - if (!t) return !1; - let e, - i = !1, - s = [], - a = !1; - if ( - (Array.isArray(t) - ? ((e = t[0]), (s = t.slice(1))) - : (e = t), - (e = e.replace(/-\w/g, t => t[1].toUpperCase())), - (e += '_'), - 'function' == typeof this.mathlist[e]) - ) { - if ( - (/^(delete|transpose|add)/.test(e) && - this._resetKeystrokeBuffer(), - /^(delete|transpose|add)/.test(e) && - 'command' !== this.mode && - (this.undoManager.pop(), - this.undoManager.snapshot(this.config)), - this.mathlist[e](...s), - /^(delete|transpose|add)/.test(e) && - 'command' !== this.mode && - this.undoManager.snapshot(this.config), - /^(delete)/.test(e) && 'command' === this.mode) - ) { - const t = this.mathlist.extractCommandStringAroundInsertionPoint(), - e = At.suggest(t); - 0 === e.length - ? Je.hidePopover(this) - : Je.showPopoverWithLatex( - this, - e[0].match, - e.length > 1 - ); - } - (a = !0), (i = !0); - } else - 'function' == typeof this[e] && - ((a = this[e](...s)), (i = !0)); - return ( - (this.mathlist.isCollapsed() && - !/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test( - e - )) || - (this._resetKeystrokeBuffer(), (this.style = {})), - a && this._requestUpdate(), - i - ); - } - performWithFeedback_(t) { - return ( - this.$focus(), - this.config.keypressVibration && - navigator.vibrate && - navigator.vibrate(3), - 'moveToNextPlaceholder' === - (t = t.replace(/-\w/g, t => t[1].toUpperCase())) || - 'moveToPreviousPlaceholder' === t || - 'complete' === t - ? this.returnKeypressSound - ? (this.returnKeypressSound.load(), - this.returnKeypressSound.play().catch(t => {})) - : this.keypressSound && - (this.keypressSound.load(), - this.keypressSound.play().catch(t => {})) - : ('deletePreviousChar' !== t && - 'deleteNextChar' !== t && - 'deletePreviousWord' !== t && - 'deleteNextWord' !== t && - 'deleteToGroupStart' !== t && - 'deleteToGroupEnd' !== t && - 'deleteToMathFieldStart' !== t && - 'deleteToMathFieldEnd' !== t) || - !this.deleteKeypressSound - ? this.keypressSound && - (this.keypressSound.load(), - this.keypressSound.play().catch(t => {})) - : (this.deleteKeypressSound.load(), - this.deleteKeypressSound.play().catch(t => {})), - this.$perform(t) - ); - } - convertLastAtomsToText_(t, e) { - 'function' == typeof t && ((e = t), (t = 1 / 0)), - void 0 === t && (t = 1 / 0); - let i = 0, - s = !1; - for (this.mathlist.contentWillChange(); !s; ) { - const a = this.mathlist.sibling(i); - (s = - 0 === t || - !a || - 'math' !== a.mode || - !( - /mord|textord|mpunct/.test(a.type) || - ('mop' === a.type && /[a-zA-Z]+/.test(a.body)) - ) || - a.superscript || - a.subscript || - (e && !e(a))), - s || - (a.applyStyle({ mode: 'text' }), - (a.latex = a.body)), - (i -= 1), - (t -= 1); - } - this.mathlist.contentDidChange(); - } - convertLastAtomsToMath_(t, e) { - 'function' == typeof t && ((e = t), (t = 1 / 0)), - void 0 === t && (t = 1 / 0), - this.mathlist.contentWillChange(); - let i = 0, - s = !1; - for (; !s; ) { - const a = this.mathlist.sibling(i); - (s = - 0 === t || - !a || - 'text' !== a.mode || - ' ' === a.body || - (e && !e(a))), - s || a.applyStyle({ mode: 'math', type: 'mord' }), - (i -= 1), - (t -= 1); - } - this.removeIsolatedSpace_(), this.mathlist.contentDidChange(); - } - removeIsolatedSpace_() { - let t = 0; - for ( - ; - this.mathlist.sibling(t) && - 'math' === this.mathlist.sibling(t).mode; - - ) - t -= 1; - if ( - this.mathlist.sibling(t) && - 'text' === this.mathlist.sibling(t).mode && - ' ' === this.mathlist.sibling(t).body && - (!this.mathlist.sibling(t - 1) || - 'math' === this.mathlist.sibling(t - 1).mode) - ) { - this.mathlist.contentWillChange(), - this.mathlist.siblings().splice(t - 1, 1), - this.mathlist.contentDidChange(); - const e = this.mathlist.suppressChangeNotifications; - (this.mathlist.suppressChangeNotifications = !0), - this.mathlist.setSelection( - this.mathlist.anchorOffset() - 1 - ), - (this.mathlist.suppressChangeNotifications = e); - } - } - getTextBeforeAnchor_() { - let t = '', - e = 0, - i = !1; - for (; !i; ) { - const s = this.mathlist.sibling(e); - (i = !( - s && - (('text' === s.mode && !s.type) || - ('math' === s.mode && - /mord|textord|mpunct/.test(s.type))) - )), - i || (t = s.body + t), - (e -= 1); - } - return t; - } - smartMode_(t, e) { - if (this.smartModeSuppressed) return !1; - if ( - this.mathlist.endOffset() < - this.mathlist.siblings().length - 1 - ) - return !1; - if (!e || e.ctrlKey || e.metaKey) return !1; - const i = He.eventToChar(e); - if (i.length > 1) return !1; - if (!this.mathlist.isCollapsed()) - return !('text' !== this.mode || !/[/_^]/.test(i)); - const s = this.getTextBeforeAnchor_() + i; - if ('text' === this.mode) { - if ('Esc' === t || /[/\\]/.test(i)) return !0; - if (/[\^_]/.test(i)) - return ( - /(^|\s)[a-zA-Z][^_]$/.test(s) && - this.convertLastAtomsToMath_(1), - !0 - ); - const e = { ')': '(', '}': '{', ']': '[' }[i]; - if ( - e && - this.mathlist.parent() && - 'leftright' === this.mathlist.parent().type && - this.mathlist.parent().leftDelim === e - ) - return !0; - if (/(^|[^a-zA-Z])(a|I)[ ]$/.test(s)) return !1; - if (/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i)) return !0; - if (/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s)) - return this.convertLastAtomsToMath_(1), !1; - if (/[^0-9]\.[^0-9\s]$/.test(s)) { - this.convertLastAtomsToMath_(1); - const t = this.mathlist.sibling(0); - return ( - (t.body = '⋅'), - (t.autoFontFamily = 'cmr'), - (t.latex = '\\cdot'), - !0 - ); - } - if (/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s)) - return this.convertLastAtomsToMath_(1), !0; - if (/\.[0-9]$/.test(s)) - return this.convertLastAtomsToMath_(1), !0; - if (/[(][0-9+\-.]$/.test(s)) - return this.convertLastAtomsToMath_(1), !0; - if (/[(][a-z][,;]$/.test(s)) - return this.convertLastAtomsToMath_(2), !0; - if (/[0-9+\-=><*|]$/.test(i)) - return this.removeIsolatedSpace_(), !0; - } else { - if ('Spacebar' === t) - return ( - this.convertLastAtomsToText_(t => - /[a-z][:,;.]$/.test(t.body) - ), - !0 - ); - if ( - /[a-zA-Z]{3,}$/.test(s) && - !/(dxd|abc|xyz|uvw)$/.test(s) - ) - return ( - this.convertLastAtomsToText_(t => - /[a-zA-Z:,;.]/.test(t.body) - ), - !0 - ); - if (/(^|\W)(if|If)$/i.test(s)) - return this.convertLastAtomsToText_(1), !0; - if ( - /(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test( - s - ) && - !/(αβγ)$/.test(s) - ) - return ( - this.convertLastAtomsToText_(t => - /(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test( - t.body - ) - ), - !0 - ); - if (/\?|\./.test(i)) return !0; - } - return !1; - } - _onKeystroke(t, e) { - if ( - (this._showKeystroke(t), - clearTimeout(this.keystrokeBufferResetTimer), - this.config.onKeystroke && - !this.config.onKeystroke(this, t, e)) - ) - return ( - e && - e.preventDefault && - (e.preventDefault(), e.stopPropagation()), - !1 - ); - let i, - s, - a, - o = !1; - if ( - 'command' !== this.mode && - (!e || (!e.ctrlKey && !e.metaKey)) - ) { - const t = He.eventToChar(e); - if ('Backspace' !== t) - if (!t || t.length > 1) this._resetKeystrokeBuffer(); - else { - const e = this.keystrokeBuffer + t; - let a = 0; - for (; !i && a < e.length; ) { - let t; - if (this.keystrokeBufferStates[a]) { - const e = new Oe.EditableMathlist(); - (e.root = te.makeRoot( - 'math', - he.parseTokens( - n( - this.keystrokeBufferStates[a] - .latex - ), - this.config.default, - null, - this.config.macros - ) - )), - e.setPath( - this.keystrokeBufferStates[a] - .selection - ), - (t = e.siblings()); - } else t = this.mathlist.siblings(); - (i = ve.forString( - this.mode, - t, - e.slice(a), - this.config - )), - (a += 1); - } - (s = a - 1), - (this.keystrokeBuffer += t), - this.keystrokeBufferStates.push( - this.undoManager.save() - ), - ve.startsWithString(e, this.config).length <= 1 - ? (o = !0) - : this.config.inlineShortcutTimeout && - (this.keystrokeBufferResetTimer = setTimeout( - () => { - this._resetKeystrokeBuffer(); - }, - this.config.inlineShortcutTimeout - )); - } - } - if (this.config.smartMode) { - const s = this.mode; - i - ? (this.mode = 'math') - : this.smartMode_(t, e) && - ((this.mode = { math: 'text', text: 'math' }[ - this.mode - ]), - (a = '')), - this.mode !== s && - 'function' == typeof this.config.onModeChange && - this.config.onModeChange(this, this.mode); - } - if ( - (i || a || (a = ve.selectorForKeystroke(this.mode, t)), - !i && !a) - ) - return !0; - this.mathlist.decorateCommandStringAroundInsertionPoint(!1); - const r = this.mathlist.parent(); - if ( - ('moveAfterParent' === a && - r && - 'leftright' === r.type && - this.mathlist.endOffset() === - this.mathlist.siblings().length - 1 && - this.config.smartFence && - this.mathlist._insertSmartFence('.') && - ((a = ''), this._requestUpdate()), - 'math' === this.mode && 'Spacebar' === t && !i) - ) { - const t = this.mathlist.sibling(1), - e = this.mathlist.sibling(-1); - ((t && 'text' === t.mode) || (e && 'text' === e.mode)) && - this.mathlist.insert(' ', { mode: 'text' }); - } - if (((a && !this.$perform(a)) || i) && i) { - if ( - !/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test( - i - ) - ) { - const t = { - ...this.mathlist.anchorStyle(), - ...this.style, - }; - this.mathlist.insert(He.eventToChar(e), { - suppressChangeNotifications: !0, - mode: this.mode, - style: t, - }); - const i = this.mode; - this.undoManager.snapshotAndCoalesce(this.config), - this.undoManager.restore( - this.keystrokeBufferStates[s], - { - ...this.config, - suppressChangeNotifications: !0, - } - ), - (this.mode = i); - } - this.mathlist.contentWillChange(); - const t = this.mathlist.suppressChangeNotifications; - this.mathlist.suppressChangeNotifications = !0; - const a = { ...this.mathlist.anchorStyle(), ...this.style }; - this.mathlist.insert(i, { - format: 'latex', - mode: this.mode, - style: a, - smartFence: !0, - }), - this.removeIsolatedSpace_(), - i.endsWith(' ') && - ((this.mode = 'text'), - this.mathlist.insert(' ', { - mode: 'text', - style: a, - })), - (this.mathlist.suppressChangeNotifications = t), - this.mathlist.contentDidChange(), - this.undoManager.snapshot(this.config), - this._requestUpdate(), - this._announce('replacement'), - o && this._resetKeystrokeBuffer(); - } - return ( - this.scrollIntoView(), - e && - e.preventDefault && - (e.preventDefault(), e.stopPropagation()), - !1 - ); - } - _onTypedText(t, e) { - if ( - ((e = e || {}).focus && this.$focus(), - e.feedback && - (this.config.keypressVibration && - navigator.vibrate && - navigator.vibrate(3), - this.keypressSound && - (this.keypressSound.load(), - this.keypressSound.play().catch(t => {}))), - e.commandMode && - 'command' !== this.mode && - this.switchMode_('command'), - this.mathlist.decorateCommandStringAroundInsertionPoint(!1), - e.simulateKeystroke) - ) { - const e = t.charAt(0), - i = He.charToEvent(e); - if (!this.$keystroke(He.keyboardEventToString(i), i)) - return; - } - let i = '', - a = !1; - if (this.pasteInProgress) - (this.pasteInProgress = !1), - this.mathlist.insert(t, { - smartFence: this.config.smartFence, - mode: 'math', - }); - else { - const e = { ...this.mathlist.anchorStyle(), ...this.style }, - o = s(t); - for (const t of o) - if ('command' === this.mode) { - this.mathlist.removeSuggestion(), - (this.suggestionIndex = 0); - const e = this.mathlist.extractCommandStringAroundInsertionPoint(), - s = At.suggest(e + t); - (a = s.length > 1), - 0 === s.length - ? (this.mathlist.insert(t, { - mode: 'command', - }), - /^\\[a-zA-Z\\*]+$/.test(e + t) && - this.mathlist.decorateCommandStringAroundInsertionPoint( - !0 - ), - Je.hidePopover(this)) - : (this.mathlist.insert(t, { - mode: 'command', - }), - s[0].match !== e + t && - this.mathlist.insertSuggestion( - s[0].match, - -s[0].match.length + e.length + 1 - ), - (i = s[0].match)); - } else if ('math' === this.mode) { - const i = { - '^': 'moveToSuperscript', - _: 'moveToSubscript', - ' ': 'moveAfterParent', - }[t]; - if (i) { - if ('moveToSuperscript' === i) { - if ( - this._superscriptDepth() >= - this.config.scriptDepth[1] - ) - return void this._announce('plonk'); - } else if ( - 'moveToSubscript' === i && - this._subscriptDepth() >= - this.config.scriptDepth[0] - ) - return void this._announce('plonk'); - this.$perform(i); - } else - this.config.smartSuperscript && - 'superscript' === this.mathlist.relation() && - /[0-9]/.test(t) && - 0 === - this.mathlist - .siblings() - .filter(t => 'first' !== t.type).length - ? (this.mathlist.insert(t, { - mode: 'math', - style: e, - }), - this.mathlist.moveAfterParent_()) - : this.mathlist.insert(t, { - mode: 'math', - style: e, - smartFence: this.config.smartFence, - }); - } else - 'text' === this.mode && - this.mathlist.insert(t, { - mode: 'text', - style: e, - }); - } - 'command' !== this.mode && - this.undoManager.snapshotAndCoalesce(this.config), - this._requestUpdate(), - this.scrollIntoView(), - Je.showPopoverWithLatex(this, i, a); - } - _hash() { - let t = 0; - const e = this.mathlist.root.toLatex(!1); - for (let i = 0; i < e.length; i++) - (t = 31 * t + e.charCodeAt(i)), (t |= 0); - return Math.abs(t); - } - _requestUpdate() { - this.dirty || - ((this.dirty = !0), - requestAnimationFrame(t => ks(this) && this._render())); - } - _render(t) { - (t = t || {}), - (this.dirty = !1), - window.mathlive || (window.mathlive = {}), - this.mathlist.anchor() || - (this.mathlist.path = [ - { relation: 'body', offset: 0 }, - ]), - this.mathlist.forEach(t => { - (t.caret = ''), (t.isSelected = !1); - }); - const e = this.$hasFocus(); - this.mathlist.isCollapsed() - ? (this.mathlist.anchor().caret = e ? this.mode : '') - : this.mathlist.forEachSelected(t => { - t.isSelected = !0; - }); - const i = te.decompose( - { - mathstyle: 'displaystyle', - generateID: { - seed: this._hash(), - groupNumbers: t.forHighlighting, - }, - macros: this.config.macros, - }, - this.mathlist.root - ), - s = $.makeSpan(i, 'ML__base'); - s.attributes = { translate: 'no', 'aria-hidden': 'true' }; - const a = $.makeSpan('', 'ML__strut'); - a.setStyle('height', s.height, 'em'); - const o = [a]; - if (0 !== s.depth) { - const t = $.makeSpan('', 'ML__strut--bottom'); - t.setStyle('height', s.height + s.depth, 'em'), - t.setStyle('vertical-align', -s.depth, 'em'), - o.push(t); - } - o.push(s); - const n = $.makeSpan(o, 'ML__mathlive'); - (this.field.innerHTML = n.toMarkup( - 0, - this.config.horizontalSpacingScale - )), - this.field.classList.toggle('ML__focused', e), - (this.accessibleNode.innerHTML = - "" + - te.toMathML(this.mathlist.root, this.config) + - ''); - const r = this._getSelectionBounds(); - if (r) { - const t = document.createElement('div'); - t.classList.add('ML__selection'), - (t.style.position = 'absolute'), - (t.style.left = r.left + 'px'), - (t.style.top = r.top + 'px'), - (t.style.width = Math.ceil(r.right - r.left) + 'px'), - (t.style.height = - Math.ceil(r.bottom - r.top - 1) + 'px'), - this.field.insertBefore(t, this.field.childNodes[0]); - } - } - _onPaste() { - return (this.pasteInProgress = !0), !0; - } - _onCut() { - return ( - setTimeout( - function() { - this.$clearSelection(), this._requestUpdate(); - }.bind(this), - 0 - ), - !0 - ); - } - _onCopy(t) { - this.mathlist.isCollapsed() - ? (t.clipboardData.setData( - 'text/plain', - '$$' + this.$text('latex-expanded') + '$$' - ), - t.clipboardData.setData( - 'application/json', - this.$text('json') - ), - t.clipboardData.setData( - 'application/xml', - this.$text('mathML') - )) - : (t.clipboardData.setData( - 'text/plain', - '$$' + this.$selectedText('latex-expanded') + '$$' - ), - t.clipboardData.setData( - 'application/json', - this.$selectedText('json') - ), - t.clipboardData.setData( - 'application/xml', - this.$selectedText('mathML') - )), - t.preventDefault(); - } - formatMathlist(t, e) { - let i = ''; - if ('latex' === (e = e || 'latex') || 'latex-expanded' === e) - i = t.toLatex('latex-expanded' === e); - else if ('mathML' === e) i = t.toMathML(this.config); - else if ('spoken' === e) i = te.toSpeakableText(t, this.config); - else if ('spoken-text' === e) { - const e = this.config.textToSpeechMarkup; - (this.config.textToSpeechMarkup = ''), - (i = te.toSpeakableText(t, this.config)), - (this.config.textToSpeechMarkup = e); - } else if ( - 'spoken-ssml' === e || - 'spoken-ssml-withHighlighting' === e - ) { - const s = this.config.textToSpeechMarkup, - a = this.config.generateID; - (this.config.textToSpeechMarkup = 'ssml'), - 'spoken-ssml-withHighlighting' === e && - (this.config.generateID = !0), - (i = te.toSpeakableText(t, this.config)), - (this.config.textToSpeechMarkup = s), - (this.config.generateID = a); - } else if ('json' === e) { - const e = te.toAST(t, this.config); - i = JSON.stringify(e); - } else - 'ASCIIMath' === e && - (i = (function t(e, i) { - if (!e) return ''; - if (Array.isArray(e)) { - let i = ''; - if (0 === e.length) return ''; - if ( - ('first' === e[0].type && e.shift(), - 'text' === e[0].mode) - ) { - let s = 0; - for ( - i = '"'; - e[s] && 'text' === e[s].mode; - - ) - (i += e[s].body), s++; - i += '"' + t(e.slice(s)); - } else { - let s = 0; - for (; e[s] && 'math' === e[s].mode; ) - (i += t(e[s])), s++; - i += t(e.slice(s)); - } - return i.trim(); - } - if ('text' === e.mode) return '"' + e.body + '"'; - let s = ''; - const a = e.latex ? e.latex.trim() : null; - let o; - switch (e.type) { - case 'group': - case 'root': - s = t(e.body); - break; - case 'array': - break; - case 'genfrac': - (e.leftDelim || e.rightDelim) && - (s += - '.' !== e.leftDelim && e.leftDelim - ? e.leftDelim - : '{:'), - e.hasBarLine - ? ((s += '('), - (s += t(e.numer)), - (s += ')/('), - (s += t(e.denom)), - (s += ')')) - : ((s += '(' + t(e.numer) + '),'), - (s += '(' + t(e.denom) + ')')), - (e.leftDelim || e.rightDelim) && - (s += - '.' !== e.rightDelim && - e.rightDelim - ? e.rightDelim - : '{:'); - break; - case 'surd': - e.index - ? (s += - 'root(' + - t(e.index) + - ')(' + - t(e.body) + - ')') - : (s += 'sqrt(' + t(e.body) + ')'); - break; - case 'leftright': - (s += - '.' !== e.leftDelim && e.leftDelim - ? e.leftDelim - : '{:'), - (s += t(e.body)), - (s += - '.' !== e.rightDelim && e.rightDelim - ? e.rightDelim - : '{:'); - break; - case 'sizeddelim': - case 'delim': - case 'accent': - break; - case 'line': - case 'overlap': - case 'overunder': - break; - case 'mord': - (s = - hi[a] || - a || - ('string' == typeof e.body - ? e.body - : '')), - '\\' === s[0] && (s += ''), - (o = a - ? a.match( - /[{]?\\char"([0-9abcdefABCDEF]*)[}]?/ - ) - : null), - o - ? (s = String.fromCharCode( - parseInt('0x' + o[1]) - )) - : s.length > 0 && - '\\' === s.charAt(0) && - (s = - 'string' == typeof e.body - ? e.body.charAt(0) - : e.latex); - break; - case 'mbin': - case 'mrel': - case 'textord': - case 'minner': - s = - a && hi[a] - ? hi[a] - : a && di[a] - ? di[a] - : e.body; - break; - case 'mopen': - case 'mclose': - s += e.body; - break; - case 'mpunct': - s = di[a] || a; - break; - case 'mop': - '​' !== e.body && - ((s = ''), - (s += - '\\operatorname' === a - ? t(e.body) - : e.body || a), - (s += ' ')); - break; - case 'mathstyle': - case 'box': - case 'spacing': - case 'enclose': - break; - case 'space': - s = ' '; - } - if (e.subscript) { - s += '_'; - const i = t(e.subscript); - i.length > 1 && !/^(-)?\d+(\.\d*)?$/.test(i) - ? (s += '(' + i + ')') - : (s += i); - } - if (e.superscript) { - s += '^'; - const i = t(e.superscript); - i.length > 1 && !/^(-)?\d+(\.\d*)?$/.test(i) - ? (s += '(' + i + ')') - : (s += i); - } - return s; - })(t, this.config)); - return i; - } - $text(t) { - return this.formatMathlist(this.mathlist.root, t); - } - $selectedText(t) { - const e = this.mathlist.getSelectedAtoms(); - if (!e) return ''; - const i = te.makeRoot('math', e); - return this.formatMathlist(i, t); - } - $selectionIsCollapsed() { - return this.mathlist.isCollapsed(); - } - $selectionDepth() { - return this.mathlist.path.length; - } - _superscriptDepth() { - let t = 0, - e = 0, - i = this.mathlist.ancestor(e), - s = !1; - for (; i; ) - (i.superscript || i.subscript) && (t += 1), - i.superscript ? (s = !0) : i.subscript && (s = !1), - (e += 1), - (i = this.mathlist.ancestor(e)); - return s ? t : 0; - } - _subscriptDepth() { - let t = 0, - e = 0, - i = this.mathlist.ancestor(e), - s = !1; - for (; i; ) - (i.superscript || i.subscript) && (t += 1), - i.superscript ? (s = !1) : i.subscript && (s = !0), - (e += 1), - (i = this.mathlist.ancestor(e)); - return s ? t : 0; - } - $selectionAtStart() { - return 0 === this.mathlist.startOffset(); - } - $selectionAtEnd() { - return ( - this.mathlist.endOffset() >= - this.mathlist.siblings().length - 1 - ); - } - groupIsSelected() { - return ( - 0 === this.mathlist.startOffset() && - this.mathlist.endOffset() >= - this.mathlist.siblings().length - 1 - ); - } - $latex(t, e) { - return t - ? (t !== this.mathlist.root.toLatex() && - ((e = e || {}), - this.mathlist.insert( - t, - Object.assign({}, this.config, { - insertionMode: 'replaceAll', - selectionMode: 'after', - format: 'latex', - mode: 'math', - suppressChangeNotifications: - e.suppressChangeNotifications, - }) - ), - this.undoManager.snapshot(this.config), - this._requestUpdate()), - t) - : this.mathlist.root.toLatex(); - } - $el() { - return this.element; - } - undo() { - return this.complete_(), this.undoManager.undo(this.config), !0; - } - redo() { - return this.complete_(), this.undoManager.redo(this.config), !0; - } - scrollIntoView() { - this.dirty && this._render(); - let t = this._getCaretPosition(); - const e = this.field.getBoundingClientRect(); - if (!t) { - const i = this._getSelectionBounds(); - i && - (t = { - x: i.right + e.left - this.field.scrollLeft, - y: i.top + e.top - this.field.scrollTop, - }); - } - if (t) { - const i = t.x - window.scrollX; - i < e.left - ? this.field.scroll({ - top: 0, - left: i - e.left + this.field.scrollLeft - 20, - behavior: 'smooth', - }) - : i > e.right && - this.field.scroll({ - top: 0, - left: i - e.right + this.field.scrollLeft + 20, - behavior: 'smooth', - }); - } - } - scrollToStart() { - this.field.scroll(0, 0); - } - scrollToEnd() { - const t = this.field.getBoundingClientRect(); - this.field.scroll(t.left - window.scrollX, 0); - } - enterCommandMode_() { - this.switchMode_('command'); - } - copyToClipboard_() { - return ( - this.$focus(), - this.mathlist.isCollapsed() && this.$select(), - document.execCommand('copy'), - !1 - ); - } - cutToClipboard_() { - return this.$focus(), document.execCommand('cut'), !0; - } - pasteFromClipboard_() { - return this.$focus(), document.execCommand('paste'), !0; - } - $insert(t, e) { - if ('string' == typeof t && t.length > 0) { - if ( - ((e = e || {}).focus && this.$focus(), - e.feedback && - (this.config.keypressVibration && - navigator.vibrate && - navigator.vibrate(3), - this.keypressSound && - (this.keypressSound.load(), - this.keypressSound.play())), - '\\\\' === t) - ) - this.mathlist.addRowAfter_(); - else if ('&' === t) this.mathlist.addColumnAfter_(); - else { - const i = this.style; - this.mathlist.insert(t, { - mode: this.mode, - style: this.mathlist.anchorStyle(), - ...e, - }), - e.resetStyle && (this.style = i); - } - return ( - this.undoManager.snapshot(this.config), - this._requestUpdate(), - !0 - ); - } - return !1; - } - switchMode_(t, e, i) { - this._resetKeystrokeBuffer(), - (this.smartModeSuppressed = - /text|math/.test(this.mode) && /text|math/.test(t)), - e && - this.$insert(e, { - format: 'latex', - mode: { math: 'text', text: 'math' }[t], - }), - this.mathlist.decorateCommandStringAroundInsertionPoint(!1), - 'command' === t - ? (this.mathlist.removeSuggestion(), - Je.hidePopover(this), - (this.suggestionIndex = 0), - this.virtualKeyboardVisible && - this.switchKeyboardLayer_('lower-command'), - this.mathlist.insert('', { mode: 'math' })) - : (this.mode = t), - i && this.$insert(i, { format: 'latex', mode: t }), - 'function' == typeof this.config.onModeChange && - this.config.onModeChange(this, this.mode), - this._requestUpdate(); - } - complete_(t) { - if (((t = t || {}), Je.hidePopover(this), t.discard)) - return ( - this.mathlist.spliceCommandStringAroundInsertionPoint( - null - ), - this.switchMode_('math'), - !0 - ); - const e = this.mathlist.extractCommandStringAroundInsertionPoint( - !t.acceptSuggestion - ); - if (e) { - if ('\\(' === e || '\\)' === e) - this.mathlist.spliceCommandStringAroundInsertionPoint( - [] - ), - this.mathlist.insert(e.slice(1), { - mode: this.mode, - }); - else { - const t = 'math'; - if (At.commandAllowed(t, e)) { - const i = he.parseTokens( - n(e), - t, - null, - this.config.macros - ); - this.mathlist.spliceCommandStringAroundInsertionPoint( - i - ); - } else { - const i = he.parseTokens( - n(e), - t, - null, - this.config.macros - ); - i - ? this.mathlist.spliceCommandStringAroundInsertionPoint( - i - ) - : this.mathlist.decorateCommandStringAroundInsertionPoint( - !0 - ); - } - } - return ( - this.undoManager.snapshot(this.config), - this._announce('replacement'), - !0 - ); - } - return !1; - } - _updateSuggestion() { - this.mathlist.positionInsertionPointAfterCommitedCommand(), - this.mathlist.removeSuggestion(); - const t = this.mathlist.extractCommandStringAroundInsertionPoint(), - e = At.suggest(t); - if (0 === e.length) - Je.hidePopover(this), - this.mathlist.decorateCommandStringAroundInsertionPoint( - !0 - ); - else { - const i = this.suggestionIndex % e.length, - s = t.length - e[i].match.length; - 0 !== s && this.mathlist.insertSuggestion(e[i].match, s), - Je.showPopoverWithLatex(this, e[i].match, e.length > 1); - } - this._requestUpdate(); - } - nextSuggestion_() { - return ( - (this.suggestionIndex += 1), this._updateSuggestion(), !1 - ); - } - previousSuggestion_() { - if (((this.suggestionIndex -= 1), this.suggestionIndex < 0)) { - this.mathlist.removeSuggestion(); - const t = this.mathlist.extractCommandStringAroundInsertionPoint(), - e = At.suggest(t); - this.suggestionIndex = e.length - 1; - } - return this._updateSuggestion(), !1; - } - _attachButtonHandlers(t, e) { - const i = this; - let s, a, o, n, r; - 'object' == typeof e && (e.default || e.pressed) - ? (e.default && - t.setAttribute( - 'data-' + this.config.namespace + 'command', - JSON.stringify(e.default) - ), - e.alt && - t.setAttribute( - 'data-' + this.config.namespace + 'command-alt', - JSON.stringify(e.alt) - ), - e.altshift && - t.setAttribute( - 'data-' + - this.config.namespace + - 'command-altshift', - JSON.stringify(e.altshift) - ), - e.shift && - t.setAttribute( - 'data-' + this.config.namespace + 'command-shift', - JSON.stringify(e.shift) - ), - e.pressed && - t.setAttribute( - 'data-' + - this.config.namespace + - 'command-pressed', - JSON.stringify(e.pressed) - ), - e.pressAndHoldStart && - t.setAttribute( - 'data-' + - this.config.namespace + - 'command-pressAndHoldStart', - JSON.stringify(e.pressAndHoldStart) - ), - e.pressAndHoldEnd && - t.setAttribute( - 'data-' + - this.config.namespace + - 'command-pressAndHoldEnd', - JSON.stringify(e.pressAndHoldEnd) - )) - : t.setAttribute( - 'data-' + this.config.namespace + 'command', - JSON.stringify(e) - ), - gs(t, 'mousedown touchstart:passive', function(e) { - if ('mousedown' !== e.type || 1 === e.buttons) { - e.stopPropagation(), - e.preventDefault(), - t.classList.add('pressed'), - (s = Date.now()), - 'touchstart' === e.type && - (o = e.changedTouches[0].identifier); - const n = t.getAttribute( - 'data-' + i.config.namespace + 'command-pressed' - ); - n && i.$perform(JSON.parse(n)); - const l = t.getAttribute( - 'data-' + - i.config.namespace + - 'command-pressAndHoldStart' - ); - l && - ((a = t), - r && clearTimeout(r), - (r = window.setTimeout(function() { - t.classList.contains('pressed') && - i.$perform(JSON.parse(l)); - }, 300))); - } - }), - gs(t, 'mouseleave touchcancel', function() { - t.classList.remove('pressed'); - }), - gs(t, 'touchmove:passive', function(t) { - t.preventDefault(); - for (let e = 0; e < t.changedTouches.length; e++) - if (t.changedTouches[e].identifier === o) { - const i = document.elementFromPoint( - t.changedTouches[e].clientX, - t.changedTouches[e].clientY - ); - i !== n && - n && - (n.dispatchEvent( - new MouseEvent('mouseleave'), - { bubbles: !0 } - ), - (n = null)), - i && - ((n = i), - i.dispatchEvent( - new MouseEvent('mouseenter', { - bubbles: !0, - buttons: 1, - }) - )); - } - }), - gs(t, 'mouseenter', function(e) { - 1 === e.buttons && t.classList.add('pressed'); - }), - gs(t, 'mouseup touchend click', function(e) { - if (n) { - e.stopPropagation(), e.preventDefault(); - const t = n; - return ( - (n = null), - void t.dispatchEvent( - new MouseEvent('mouseup', { bubbles: !0 }) - ) - ); - } - if ( - (t.classList.remove('pressed'), - t.classList.add('active'), - 'click' === e.type && 0 !== e.detail) - ) - return e.stopPropagation(), void e.preventDefault(); - window.setTimeout(function() { - t.classList.remove('active'); - }, 150); - let o = t.getAttribute( - 'data-' + - i.config.namespace + - 'command-pressAndHoldEnd' - ); - const r = Date.now(); - (t !== a || r < s + 300) && (o = void 0), - !o && - e.altKey && - e.shiftKey && - (o = t.getAttribute( - 'data-' + - i.config.namespace + - 'command-altshift' - )), - !o && - e.altKey && - (o = t.getAttribute( - 'data-' + i.config.namespace + 'command-alt' - )), - !o && - e.shiftKey && - (o = t.getAttribute( - 'data-' + - i.config.namespace + - 'command-shift' - )), - o || - (o = t.getAttribute( - 'data-' + i.config.namespace + 'command' - )), - o && i.$perform(JSON.parse(o)), - e.stopPropagation(), - e.preventDefault(); - }); - } - _makeButton(t, e, i, s) { - const a = document.createElement('span'); - return ( - (a.innerHTML = t), - e && a.classList.add([].slice.call(e.split(' '))), - i && a.setAttribute('aria-label', i), - this._attachButtonHandlers(a, s), - a - ); - } - showAlternateKeys_(t, e) { - const i = bs( - 'mathlive-alternate-keys-panel', - 'ML__keyboard alternate-keys' - ); - this.virtualKeyboard.classList.contains('material') && - i.classList.add('material'), - e.length >= 7 - ? (i.style.width = '286px') - : 4 === e.length || 2 === e.length - ? (i.style.width = '146px') - : 1 === e.length - ? (i.style.width = '86px') - : (i.style.width = '146px'), - (i.style.height = 'auto'); - let s = ''; - for (const t of e) - (s += ''), - (i.innerHTML = s), - ci.makeKeycap( - this, - i.getElementsByTagName('li'), - 'performAlternateKeys' - ); - const a = this.virtualKeyboard - .querySelector( - 'div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="' + - t + - '"]' - ) - .getBoundingClientRect(); - if (a) { - a.top - i.clientHeight < 0 && - ((i.style.width = 'auto'), - e.length <= 6 - ? (i.style.height = '56px') - : e.length <= 12 - ? (i.style.height = '108px') - : (i.style.height = '205px')); - const t = (a.top - i.clientHeight + 5).toString() + 'px', - s = - Math.max( - 0, - Math.min( - window.innerWidth - i.offsetWidth, - (a.left + a.right - i.offsetWidth) / 2 - ) - ) + 'px'; - (i.style.transform = 'translate(' + s + ',' + t + ')'), - i.classList.add('is-visible'); - } - return !1; - } - hideAlternateKeys_() { - const t = document.getElementById( - 'mathlive-alternate-keys-panel' - ); - return ( - t && - (t.classList.remove('is-visible'), - (t.innerHTML = ''), - xs(t)), - !1 - ); - } - performAlternateKeys_(t) { - return this.hideAlternateKeys_(), this.$perform(t); - } - switchKeyboardLayer_(t) { - if ('off' !== this.config.virtualKeyboardMode) { - 'lower-command' !== t && - 'upper-command' !== t && - 'symbols-command' !== t && - this.complete_(), - this.showVirtualKeyboard_(), - this.hideAlternateKeys_(), - this.unshiftKeyboardLayer_(); - const e = this.virtualKeyboard.getElementsByClassName( - 'keyboard-layer' - ); - let i = !1; - for (let s = 0; s < e.length; s++) - if (e[s].dataset.layer === t) { - i = !0; - break; - } - if (i) - for (let i = 0; i < e.length; i++) - e[i].dataset.layer === t - ? e[i].classList.add('is-visible') - : e[i].classList.remove('is-visible'); - this.$focus(); - } - return !0; - } - shiftKeyboardLayer_() { - const t = this.virtualKeyboard.querySelectorAll( - 'div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action' - ); - if (t) - for (let e = 0; e < t.length; e++) { - const i = t[e]; - let s = i.getAttribute('data-shifted'); - if (s || /^[a-z]$/.test(i.innerHTML)) { - i.setAttribute( - 'data-unshifted-content', - i.innerHTML - ), - s || (s = i.innerHTML.toUpperCase()), - (i.innerHTML = s); - const t = i.getAttribute( - 'data-' + this.config.namespace + 'command' - ); - if (t) { - i.setAttribute('data-unshifted-command', t); - const e = i.getAttribute( - 'data-shifted-command' - ); - if (e) - i.setAttribute( - 'data-' + - this.config.namespace + - 'command', - e - ); - else { - const e = JSON.parse(t); - Array.isArray(e) && - (e[1] = e[1].toUpperCase()), - i.setAttribute( - 'data-' + - this.config.namespace + - 'command', - JSON.stringify(e) - ); - } - } - } - } - return !1; - } - unshiftKeyboardLayer_() { - const t = this.virtualKeyboard.querySelectorAll( - 'div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action' - ); - if (t) - for (let e = 0; e < t.length; e++) { - const i = t[e], - s = i.getAttribute('data-unshifted-content'); - s && (i.innerHTML = s); - const a = i.getAttribute('data-unshifted-command'); - a && - i.setAttribute( - 'data-' + this.config.namespace + 'command', - a - ); - } - return !1; - } - insertAndUnshiftKeyboardLayer_(t) { - return this.$insert(t), this.unshiftKeyboardLayer_(), !0; - } - toggleVirtualKeyboardAlt_() { - let t = !1; - return ( - this.virtualKeyboard && - ((t = this.virtualKeyboard.classList.contains( - 'material' - )), - this.virtualKeyboard.remove(), - delete this.virtualKeyboard, - (this.virtualKeyboard = null)), - this.showVirtualKeyboard_(t ? '' : 'material'), - !1 - ); - } - toggleVirtualKeyboardShift_() { - this.config.virtualKeyboardLayout = { - qwerty: 'azerty', - azerty: 'qwertz', - qwertz: 'dvorak', - dvorak: 'colemak', - colemak: 'qwerty', - }[this.config.virtualKeyboardLayout]; - let t = this.virtualKeyboard - ? this.virtualKeyboard.querySelector( - 'div.keyboard-layer.is-visible' - ) - : null; - return ( - (t = t ? t.id : ''), - this.virtualKeyboard && - (this.virtualKeyboard.remove(), - delete this.virtualKeyboard, - (this.virtualKeyboard = null)), - this.showVirtualKeyboard_(), - t && this.switchKeyboardLayer_(t), - !1 - ); - } - showVirtualKeyboard_(t) { - return ( - (this.virtualKeyboardVisible = !1), - this.toggleVirtualKeyboard_(t), - !1 - ); - } - hideVirtualKeyboard_() { - return ( - (this.virtualKeyboardVisible = !0), - this.toggleVirtualKeyboard_(), - !1 - ); - } - toggleVirtualKeyboard_(t) { - if ( - ((this.virtualKeyboardVisible = !this - .virtualKeyboardVisible), - this.virtualKeyboardVisible) - ) { - this.virtualKeyboard - ? this.virtualKeyboard.classList.add('is-visible') - : ((this.virtualKeyboard = ci.make(this, t)), - gs( - this.virtualKeyboard, - 'touchstart:passive mousedown', - function() { - e.$focus(); - } - ), - document.body.appendChild(this.virtualKeyboard)); - const e = this; - window.setTimeout(function() { - e.virtualKeyboard.classList.add('is-visible'); - }, 1); - } else - this.virtualKeyboard && - this.virtualKeyboard.classList.remove('is-visible'); - return ( - 'function' == typeof this.config.onVirtualKeyboardToggle && - this.config.onVirtualKeyboardToggle( - this, - this.virtualKeyboardVisible, - this.virtualKeyboard - ), - !1 - ); - } - $applyStyle(t) { - if ( - (this._resetKeystrokeBuffer(), - (t = (function(t) { - const e = {}; - return ( - 'string' == typeof t.mode && - (e.mode = t.mode.toLowerCase()), - 'string' == typeof t.color && (e.color = t.color), - 'string' == typeof t.backgroundColor && - (e.backgroundColor = t.backgroundColor), - 'string' == typeof t.fontFamily && - (e.fontFamily = t.fontFamily), - 'string' == typeof t.series && - (e.fontSeries = t.series), - 'string' == typeof t.fontSeries && - (e.fontSeries = t.fontSeries.toLowerCase()), - e.fontSeries && - (e.fontSeries = - { bold: 'b', medium: 'm', normal: 'mn' }[ - e.fontSeries - ] || e.fontSeries), - 'string' == typeof t.shape && - (e.fontShape = t.shape), - 'string' == typeof t.fontShape && - (e.fontShape = t.fontShape.toLowerCase()), - e.fontShape && - (e.fontShape = - { - italic: 'it', - up: 'n', - upright: 'n', - normal: 'n', - }[e.fontShape] || e.fontShape), - 'string' == typeof t.size - ? (e.fontSize = t.size) - : 'number' == typeof t.size && - (e.fontSize = - 'size' + - Math.min(0, Math.max(10, t.size))), - 'string' == typeof t.fontSize && - (e.fontSize = t.fontSize.toLowerCase()), - e.fontSize && - (e.fontSize = - { - tiny: 'size1', - scriptsize: 'size2', - footnotesize: 'size3', - small: 'size4', - normal: 'size5', - normalsize: 'size5', - large: 'size6', - Large: 'size7', - LARGE: 'size8', - huge: 'size9', - Huge: 'size10', - }[e.fontSize] || e.fontSize), - e - ); - })(t)).mode) - ) { - if (this.mathlist.isCollapsed()) this.switchMode_(t.mode); - else { - const t = this.mode, - e = - 'math' === - (this.mathlist.anchorMode() || - this.config.default) - ? 'text' - : 'math'; - let i = this.$selectedText('ASCIIMath'); - if ( - ('math' === e && - /^"[^"]+"$/.test(i) && - (i = i.slice(1, -1)), - this.$insert(i, { - mode: e, - selectionMode: 'item', - format: 'text' === e ? 'text' : 'ASCIIMath', - }), - (this.mode = e), - this.groupIsSelected()) - ) { - const t = this.mathlist.parent(); - !t || - ('group' !== t.type && 'root' !== t.type) || - (t.mode = e); - } - this.mode !== t && - 'function' == typeof this.config.onModeChange && - this.config.onModeChange(this, this.mode); - } - delete t.mode; - } - return ( - this.mathlist.isCollapsed() - ? (this.style.fontSeries && - t.fontSeries === this.style.fontSeries && - (t.fontSeries = 'auto'), - t.fontShape && - t.fontShape === this.style.fontShape && - (t.fontShape = 'auto'), - t.color && - t.color === this.style.color && - (t.color = 'none'), - t.backgroundColor && - t.backgroundColor === - this.style.backgroundColor && - (t.backgroundColor = 'none'), - t.fontSize && - t.fontSize === this.style.fontSize && - (t.fontSize = 'auto'), - (this.style = { ...this.style, ...t })) - : (this.mathlist._applyStyle(t), - this.undoManager.snapshot(this.config)), - !0 - ); - } - $hasFocus() { - return ( - document.hasFocus() && - document.activeElement === this.textarea - ); - } - $focus() { - this.$hasFocus() || - (this.textarea.focus && this.textarea.focus(), - this._announce('line')); - } - $blur() { - this.$hasFocus() && this.textarea.blur && this.textarea.blur(); - } - $select() { - this.mathlist.selectAll_(); - } - $clearSelection() { - this.mathlist.delete_(); - } - $keystroke(t, e) { - return this._onKeystroke(t, e); - } - $typedText(t) { - this._onTypedText(t); - } - typedText_(t, e) { - return this._onTypedText(t, e); - } - $setConfig(t) { - if ( - (this.config || - (this.config = { - smartFence: !0, - smartSuperscript: !0, - scriptDepth: [1 / 0, 1 / 0], - removeExtraneousParentheses: !0, - overrideDefaultInlineShortcuts: !1, - virtualKeyboard: '', - virtualKeyboardLayout: 'qwerty', - namespace: '', - }), - (this.config = { ...this.config, ...t }), - void 0 !== this.config.scriptDepth && - !Array.isArray(this.config.scriptDepth)) - ) { - const t = parseInt(this.config.scriptDepth); - this.config.scriptDepth = [t, t]; - } - if ( - (void 0 === this.config.removeExtraneousParentheses && - (this.config.removeExtraneousParentheses = !0), - (this.config.onAnnounce = t.onAnnounce || Ms), - (this.config.macros = Object.assign( - {}, - At.MACROS, - this.config.macros - )), - !/^[a-z]*[-]?$/.test(this.config.namespace)) - ) - throw Error( - 'options.namespace must be a string of lowercase characters only' - ); - /-$/.test(this.config.namespace) || - (this.config.namespace += '-'), - (Qe.locale = this.config.locale || Qe.locale), - Qe.merge(this.config.strings), - (this.config.virtualKeyboardLayout = - t.virtualKeyboardLayout || - { - fr: 'azerty', - be: 'azerty', - al: 'qwertz', - ba: 'qwertz', - cz: 'qwertz', - de: 'qwertz', - hu: 'qwertz', - sk: 'qwertz', - ch: 'qwertz', - }[Qe.locale.substring(0, 2)] || - 'qwerty'), - (this.keypressSound = void 0), - (this.spacebarKeypressSound = void 0), - (this.returnKeypressSound = void 0), - (this.deleteKeypressSound = void 0), - this.config.keypressSound && - ('string' == typeof this.config.keypressSound - ? ((this.keypressSound = new Audio()), - (this.keypressSound.preload = 'none'), - (this.keypressSound.src = this.config.keypressSound), - (this.keypressSound.volume = 0.5), - (this.spacebarKeypressSound = this.keypressSound), - (this.returnKeypressSound = this.keypressSound), - (this.deleteKeypressSound = this.keypressSound)) - : ((this.keypressSound = new Audio()), - (this.keypressSound.preload = 'none'), - (this.keypressSound.src = this.config.keypressSound.default), - (this.keypressSound.volume = 0.5), - (this.spacebarKeypressSound = this.keypressSound), - (this.returnKeypressSound = this.keypressSound), - (this.deleteKeypressSound = this.keypressSound), - this.config.keypressSound.spacebar && - ((this.spacebarKeypressSound = new Audio()), - (this.spacebarKeypressSound.preload = 'none'), - (this.spacebarKeypressSound.src = this.config.keypressSound.spacebar), - (this.spacebarKeypressSound.volume = 0.5)), - this.config.keypressSound.return && - ((this.returnKeypressSound = new Audio()), - (this.returnKeypressSound.preload = 'none'), - (this.returnKeypressSound.src = this.config.keypressSound.return), - (this.returnKeypressSound.volume = 0.5)), - this.config.keypressSound.delete && - ((this.deleteKeypressSound = new Audio()), - (this.deleteKeypressSound.preload = 'none'), - (this.deleteKeypressSound.src = this.config.keypressSound.delete), - (this.deleteKeypressSound.volume = 0.5)))), - this.config.plonkSound && - ((this.plonkSound = new Audio()), - (this.plonkSound.preload = 'none'), - (this.plonkSound.src = this.config.plonkSound), - (this.plonkSound.volume = 0.5)); - } - speak_(t, e) { - e = e || { withHighlighting: !1 }; - const i = (function(t, e) { - let i = null; - switch (e) { - case 'all': - i = t.mathlist.root; - break; - case 'selection': - t.mathlist.isCollapsed() || - (i = t.mathlist.getSelectedAtoms()); - break; - case 'left': { - const e = t.mathlist.siblings(), - s = t.mathlist.startOffset(); - if (s >= 1) { - i = []; - for (let t = 1; t <= s; t++) i.push(e[t]); - } - break; - } - case 'right': { - const e = t.mathlist.siblings(), - s = t.mathlist.endOffset() + 1; - if (s <= e.length - 1) { - i = []; - for (let t = s; t <= e.length - 1; t++) - i.push(e[t]); - } - break; - } - case 'start': - case 'end': - break; - case 'group': - i = t.mathlist.siblings(); - break; - case 'parent': { - const e = t.mathlist.parent(); - e && 'root' !== e.type && (i = t.mathlist.parent()); - break; - } - } - return i; - })(this, t); - if (null === i) - return ( - this.config.handleSpeak( - (function(t) { - let e = ''; - switch (t) { - case 'all': - break; - case 'selection': - e = 'no selection'; - break; - case 'left': - e = 'at start'; - break; - case 'right': - e = 'at end'; - break; - case 'group': - break; - case 'parent': - e = 'no parent'; - } - return e; - })(t) - ), - !1 - ); - const s = { ...this.config }; - (e.withHighlighting || 'amazon' === s.speechEngine) && - ((s.textToSpeechMarkup = - window.sre && 'sre' === s.textToSpeechRules - ? 'ssml_step' - : 'ssml'), - e.withHighlighting && (s.generateID = !0)); - const a = te.toSpeakableText(i, s); - return ( - e.withHighlighting - ? ((window.mathlive.readAloudMathField = this), - this._render({ forHighlighting: !0 }), - this.config.handleReadAloud && - this.config.handleReadAloud( - this.field, - a, - this.config - )) - : this.config.handleSpeak && - this.config.handleSpeak(a, s), - !1 - ); - } - } - let ws, - Ss = 0; - function As(t, e, i) { - const s = Object.assign({}, t.config); - return ( - (s.textToSpeechMarkup = ''), - (s.textToSpeechRulesOptions = s.textToSpeechRulesOptions || {}), - (s.textToSpeechRulesOptions.markup = 'none'), - e + te.toSpeakableText(i, s) - ); - } - function Ms(t, e, i, s) { - let a = ''; - 'plonk' === e - ? (t.plonkSound && - (t.plonkSound.load(), t.plonkSound.play().catch(t => {})), - t._resetKeystrokeBuffer()) - : 'delete' === e - ? (a = As(t, 'deleted: ', s)) - : 'focus' === e || /move/.test(e) - ? (a = - (t.mathlist.isCollapsed() ? '' : 'selected: ') + - t._nextAtomSpeechText(i)) - : 'replacement' === e - ? (a = As(t, '', t.mathlist.sibling(0))) - : 'line' === e - ? ((a = As(t, '', t.mathlist.root)), - (t.accessibleNode.innerHTML = - '' + - te.toMathML(t.mathlist.root, t.config) + - ''), - t.textarea.setAttribute('aria-label', 'after: ' + a)) - : (a = s ? As(t, e + ' ', s) : e); - const o = /\u00a0/.test(t.ariaLiveText.textContent) ? '   ' : '   '; - t.ariaLiveText.textContent = a + o; - } - (vs.prototype.undo_ = vs.prototype.undo), - (vs.prototype.redo_ = vs.prototype.redo), - (vs.prototype.scrollIntoView_ = vs.prototype.scrollIntoView), - (vs.prototype.scrollToStart_ = vs.prototype.scrollToStart), - (vs.prototype.scrollToEnd_ = vs.prototype.scrollToEnd), - (vs.prototype.insert_ = vs.prototype.$insert); - var Cs = { isValidMathfield: ks, MathField: vs }; - function _s(t, e, i) { - let s = i, - a = 0; - const o = t.length; - for (; s < e.length; ) { - const i = e[s]; - if (a <= 0 && e.slice(s, s + o) === t) return s; - '\\' === i ? s++ : '{' === i ? a++ : '}' === i && a--, s++; - } - return -1; - } - function Ts(t, e, i, s) { - const a = []; - for (let o = 0; o < t.length; o++) - if ('text' === t[o].type) { - const n = t[o].data; - let r, - l = !0, - c = 0; - (r = n.indexOf(e)), - -1 !== r && - ((c = r), - c > 0 && - a.push({ type: 'text', data: n.slice(0, c) }), - (l = !1)); - let h = !1; - for (; !h; ) { - if (l) { - if (((r = n.indexOf(e, c)), -1 === r)) { - h = !0; - break; - } - c !== r && - a.push({ type: 'text', data: n.slice(c, r) }), - (c = r); - } else { - if (((r = _s(i, n, c + e.length)), -1 === r)) { - h = !0; - break; - } - a.push({ - type: 'math', - data: n.slice(c + e.length, r), - rawData: n.slice(c, r + i.length), - mathstyle: s, - }), - (c = r + i.length); - } - l = !l; - } - c < n.length && a.push({ type: 'text', data: n.slice(c) }); - } else a.push(t[o]); - return a; - } - function Ls(t, e) { - let i = [{ type: 'text', data: t }]; - for (let t = 0; t < e.inline.length; t++) { - const s = e.inline[t]; - i = Ts(i, s[0], s[1], 'textstyle'); - } - for (let t = 0; t < e.display.length; t++) { - const s = e.display[t]; - i = Ts(i, s[0], s[1], 'displaystyle'); - } - return i; - } - function Fs(t, e, i, s) { - const a = (function(t, e, i, s) { - let a = document.createElement('span'); - a.setAttribute('aria-hidden', 'true'), - e.preserveOriginalContent && - (a.setAttribute( - 'data-' + e.namespace + 'original-content', - t - ), - i && - a.setAttribute( - 'data-' + e.namespace + 'original-mathstyle', - i - )); - try { - a.innerHTML = e.renderToMarkup( - t, - i || 'displaystyle', - 'html', - e.macros - ); - } catch (e) { - if (!s) return null; - a = document.createTextNode(t); - } - return a; - })(t, i, e, s); - if ( - a && - /\b(mathml|speakable-text)\b/i.test(i.renderAccessibleContent) - ) { - const e = document.createDocumentFragment(); - if ( - (/\bmathml\b/i.test(i.renderAccessibleContent) && - i.renderToMathML && - e.appendChild( - (function(t, e) { - const i = document.createElement('span'); - try { - i.innerHTML = - "" + - e.renderToMathML(t, e) + - ''; - } catch (e) { - i.textContent = t; - } - return (i.className = 'sr-only'), i; - })(t, i) - ), - /\bspeakable-text\b/i.test(i.renderAccessibleContent) && - i.renderToSpeakableText) - ) { - const s = document.createElement('span'); - (s.innerHTML = i.renderToSpeakableText(t, i)), - (s.className = 'sr-only'), - e.appendChild(s); - } - return e.appendChild(a), e; - } - return a; - } - function Ds(t, e) { - let i = null; - if (e.TeX.processEnvironments && /^\s*\\begin/.test(t)) - (i = document.createDocumentFragment()), - i.appendChild(Fs(t, void 0, e, !0)); - else { - const s = Ls(t, e.TeX.delimiters); - if (1 === s.length && 'text' === s[0].type) return null; - i = document.createDocumentFragment(); - for (let t = 0; t < s.length; t++) - 'text' === s[t].type - ? i.appendChild(document.createTextNode(s[t].data)) - : i.appendChild(Fs(s[t].data, s[t].mathstyle, e, !0)); - } - return i; - } - const zs = { - namespace: '', - skipTags: [ - 'noscript', - 'style', - 'textarea', - 'pre', - 'code', - 'annotation', - 'annotation-xml', - ], - processScriptType: 'math/tex', - ignoreClass: 'tex2jax_ignore', - processClass: 'tex2jax_process', - preserveOriginalContent: !0, - renderAccessibleContent: 'mathml', - TeX: { - disabled: !1, - processEnvironments: !0, - delimiters: { - inline: [['\\(', '\\)']], - display: [ - ['$$', '$$'], - ['\\[', '\\]'], - ], - }, - }, - }; - var Es = { - renderMathInElement: function(t, e) { - try { - if ( - (((e = Object.assign( - {}, - zs, - e - )).ignoreClassPattern = new RegExp(e.ignoreClass)), - (e.processClassPattern = new RegExp(e.processClass)), - (e.processScriptTypePattern = new RegExp( - e.processScriptType - )), - (e.macros = At.MACROS), - e.namespace) - ) { - if (!/^[a-z]+[-]?$/.test(e.namespace)) - throw Error( - 'options.namespace must be a string of lowercase characters only' - ); - /-$/.test(e.namespace) || (e.namespace += '-'); - } - !(function t(e, i) { - const s = e.getAttribute( - 'data-' + i.namespace + 'original-content' - ); - if (s) { - const t = Fs( - s, - e.getAttribute( - 'data-' + i.namespace + 'mathstyle' - ), - i, - !1 - ); - null != t && - ((e.textContent = ''), e.appendChild(t)); - } else { - if ( - 1 === e.childNodes.length && - 3 === e.childNodes[0].nodeType - ) { - const t = e.childNodes[0].textContent; - if ( - i.TeX.processEnvironments && - /^\s*\\begin/.test(t) - ) - return ( - (e.textContent = ''), - void e.appendChild(Fs(t, void 0, i, !0)) - ); - const s = Ls(t, i.TeX.delimiters); - if (1 === s.length && 'math' === s[0].type) - return ( - (e.textContent = ''), - void e.appendChild( - Fs(s[0].data, s[0].mathstyle, i, !0) - ) - ); - if (1 === s.length && 'text' === s[0].type) - return; - } - for (let s = 0; s < e.childNodes.length; s++) { - const a = e.childNodes[s]; - if (3 === a.nodeType) { - const t = Ds(a.textContent, i); - t && - ((s += t.childNodes.length - 1), - e.replaceChild(t, a)); - } else if (1 === a.nodeType) { - const e = a.nodeName.toLowerCase(); - if ( - 'script' === e && - i.processScriptTypePattern.test(a.type) - ) { - let t = 'displaystyle'; - for (const e of a.type.split(';')) { - const i = e.split('='); - 'mode' === i[0].toLowerCase() && - (t = - 'display' === - i[1].toLoweCase() - ? 'displaystyle' - : 'textstyle'); - } - const e = Fs(a.textContent, t, i, !0); - a.parentNode.replaceChild(e, a); - } else - (i.processClassPattern.test( - a.className - ) || - (!i.skipTags.includes(e) && - !i.ignoreClassPattern.test( - a.className - ))) && - t(a, i); - } - } - } - })(t, e); - } catch (t) { - Error; - } - }, - }; - function qs(t, e, i, s) { - e = e || 'displaystyle'; - const a = n(t), - o = he.parseTokens(a, 'math', null, s); - if ('mathlist' === i) return o; - let r = te.decompose({ mathstyle: e }, o); - if (((r = $.coalesce(r)), 'span' === i)) return r; - const l = $.makeSpan(r, 'ML__base'), - c = $.makeSpan('', 'ML__strut'); - c.setStyle('height', l.height, 'em'); - const h = [c]; - if (0 !== l.depth) { - const t = $.makeSpan('', 'ML__strut--bottom'); - t.setStyle('height', l.height + l.depth, 'em'), - t.setStyle('vertical-align', -l.depth, 'em'), - h.push(t); - } - return h.push(l), $.makeSpan(h, 'ML__mathlive').toMarkup(); - } - function Ps(t, e) { - if (!te.toMathML) return ''; - ((e = e || {}).macros = e.macros || {}), - Object.assign(e.macros, At.MACROS); - const i = he.parseTokens(n(t), 'math', null, e.macros); - return te.toMathML(i, e); - } - function Is(t, e) { - if (!te.toSpeakableText) return ''; - ((e = e || {}).macros = e.macros || {}), - Object.assign(e.macros, At.MACROS); - const i = he.parseTokens(n(t), 'math', null, e.macros); - return te.toSpeakableText(i, e); - } - function Bs(t, e) { - if ( - (!e && - window && - window.mathlive && - (e = window.mathlive.config), - (e = e || {}).speechEngine && 'local' !== e.speechEngine) - ) - if ('amazon' === e.speechEngine) { - if (window && window.AWS) { - const i = new window.AWS.Polly({ - apiVersion: '2016-06-10', - }), - s = { - OutputFormat: 'mp3', - VoiceId: e.speechEngineVoice || 'Joanna', - Text: t, - TextType: 'ssml', - }; - i.synthesizeSpeech(s, function(t, e) { - if (t); - else if (e && e.AudioStream) { - const t = new Uint8Array(e.AudioStream), - i = new Blob([t.buffer], { - type: 'audio/mpeg', - }), - s = URL.createObjectURL(i); - new Audio(s).play().catch(t => {}); - } - }); - } - } else e.speechEngine; - else { - const e = new SpeechSynthesisUtterance(t); - window && window.speechSynthesis.speak(e); - } - } - function Os(t, e, i) { - if (!window) return; - if ( - (!i && window.mathlive && (i = window.mathlive.config), - 'amazon' !== (i = i || {}).speechEngine) - ) - return void (i.handleSpeak && i.handleSpeak(e)); - if (!window.AWS) return; - const s = new window.AWS.Polly({ apiVersion: '2016-06-10' }), - a = { - OutputFormat: 'json', - VoiceId: i.speechEngineVoice || 'Joanna', - Text: e, - TextType: 'ssml', - SpeechMarkTypes: ['ssml'], - }; - (window.mathlive = window.mathlive || {}), - (window.mathlive.readAloudElement = t); - const o = i.onReadAloudStatus || window.mathlive.onReadAloudStatus; - s.synthesizeSpeech(a, function(t, e) { - if (t); - else if (e && e.AudioStream) { - const t = new TextDecoder('utf-8').decode( - new Uint8Array(e.AudioStream) - ); - (window.mathlive.readAloudMarks = t - .split('\n') - .map(t => (t ? JSON.parse(t) : {}))), - (window.mathlive.readAloudTokens = []); - for (const t of window.mathlive.readAloudMarks) - t.value && - window.mathlive.readAloudTokens.push(t.value); - (window.mathlive.readAloudCurrentMark = ''), - (a.OutputFormat = 'mp3'), - (a.SpeechMarkTypes = []), - s.synthesizeSpeech(a, function(t, e) { - if (t); - else if (e && e.AudioStream) { - const t = new Uint8Array(e.AudioStream), - i = new Blob([t.buffer], { - type: 'audio/mpeg', - }), - s = URL.createObjectURL(i); - window.mathlive.readAloudAudio - ? window.mathlive.readAloudAudio.pause() - : ((window.mathlive.readAloudAudio = new Audio()), - window.mathlive.readAloudAudio.addEventListener( - 'ended', - () => { - o && - o( - window.mathlive - .readAloudMathField, - 'ended' - ), - window.mathlive - .readAloudMathField - ? (window.mathlive.readAloudMathField._render(), - (window.mathlive.readAloudElement = null), - (window.mathlive.readAloudMathField = null), - (window.mathlive.readAloudTokens = []), - (window.mathlive.readAloudMarks = []), - (window.mathlive.readAloudCurrentMark = - '')) - : (function t(e) { - e.classList.remove( - 'highlight' - ), - e.children && - Array.from( - e.children - ).forEach( - e => { - t( - e - ); - } - ); - })( - window.mathlive - .readAloudElement - ); - } - ), - window.mathlive.readAloudAudio.addEventListener( - 'timeupdate', - () => { - let t = ''; - const e = - 1e3 * - window.mathlive - .readAloudAudio - .currentTime + - 100; - for (const i of window.mathlive - .readAloudMarks) - i.time < e && (t = i.value); - window.mathlive - .readAloudCurrentMark !== t && - ((window.mathlive.readAloudCurrentToken = t), - t && - t === - window.mathlive - .readAloudFinalToken - ? window.mathlive.readAloudAudio.pause() - : ((window.mathlive.readAloudCurrentMark = t), - (function t(e, i) { - i && - e.dataset.atomId !== - i - ? (e.classList.remove( - 'highlight' - ), - e.children && - e.children - .length > - 0 && - Array.from( - e.children - ).forEach( - e => { - t( - e, - i - ); - } - )) - : (e.classList.add( - 'highlight' - ), - e.children && - e.children - .length > - 0 && - Array.from( - e.children - ).forEach( - e => { - t( - e - ); - } - )); - })( - window.mathlive - .readAloudElement, - window.mathlive - .readAloudCurrentMark - ))); - } - )), - (window.mathlive.readAloudAudio.src = s), - o && - o( - window.mathlive.readAloudMathField, - 'playing' - ), - window.mathlive.readAloudAudio.play(); - } - }); - } - }); - } - function Rs(t) { - let e = t; - if ('string' == typeof t && ((e = document.getElementById(t)), !e)) - throw Error(`The element with ID "${t}" could not be found.`); - return e; - } - function Ks(t, e) { - Es && - (((e = e || {}).renderToMarkup = e.renderToMarkup || qs), - (e.renderToMathML = e.renderToMathML || Ps), - (e.renderToSpeakableText = e.renderToSpeakableText || Is), - (e.macros = e.macros || At.MACROS), - Es.renderMathInElement(Rs(t), e)); - } - function Ns(t) { - if (t.namespace) { - if (!/^[a-z]+[-]?$/.test(t.namespace)) - throw Error( - 'options.namespace must be a string of lowercase characters only' - ); - /-$/.test(t.namespace) || (t.namespace += '-'); - } - } - return { - latexToMarkup: qs, - latexToMathML: Ps, - latexToSpeakableText: Is, - latexToAST: function(t, e) { - if (!te.toAST) return {}; - ((e = e || {}).macros = e.macros || {}), - Object.assign(e.macros, At.MACROS); - const i = he.parseTokens(n(t), 'math', null, e.macros); - return te.toAST(i, e); - }, - astToLatex: function(t, e) { - return ps(t, e); - }, - makeMathField: function(t, e) { - if (!Cs) throw Error('The MathField module is not loaded.'); - return ( - ((e = e || {}).handleSpeak = e.handleSpeak || Bs), - (e.handleReadAloud = e.handleReadAloud || Os), - new Cs.MathField(Rs(t), e) - ); - }, - renderMathInDocument: function(t) { - Ks(document.body, t); - }, - renderMathInElement: Ks, - revertToOriginalContent: function(t, e) { - (t = (t = Rs(t)).children[1]) instanceof Cs.MathField - ? t.revertToOriginalContent() - : (Ns((e = e || {})), - (t.innerHTML = t.getAttribute( - 'data-' + (e.namespace || '') + 'original-content' - ))); - }, - getOriginalContent: function(t, e) { - return (t = (t = Rs(t)).children[1]) instanceof Cs.MathField - ? t.originalContent - : (Ns((e = e || {})), - t.getAttribute( - 'data-' + (e.namespace || '') + 'original-content' - )); - }, - readAloud: Os, - readAloudStatus: function() { - return window - ? ((window.mathlive = window.mathlive || {}), - window.mathlive.readAloudAudio - ? window.mathlive.readAloudAudio.paused - ? 'paused' - : window.mathlive.readAloudAudio.ended - ? 'ready' - : 'playing' - : 'ready') - : 'unavailable'; - }, - pauseReadAloud: function() { - window && - ((window.mathlive = window.mathlive || {}), - window.mathlive.readAloudAudio && - (window.mathlive.onReadAloudStatus && - window.mathlive.onReadAloudStatus( - window.mathlive.readAloudMathField, - 'paused' - ), - window.mathlive.readAloudAudio.pause())); - }, - resumeReadAloud: function() { - window && - ((window.mathlive = window.mathlive || {}), - window.mathlive.readAloudAudio && - (window.mathlive.onReadAloudStatus && - window.mathlive.onReadAloudStatus( - window.mathlive.readAloudMathField, - 'playing' - ), - window.mathlive.readAloudAudio.play())); - }, - playReadAloud: function(t, e) { - if ( - window && - ((window.mathlive = window.mathlive || {}), - window.mathlive.readAloudAudio) - ) { - let i = 0; - if (((window.mathlive.readAloudFinalToken = null), t)) { - window.mathlive.readAloudMarks = - window.mathlive.readAloudMarks || []; - for (const e of window.mathlive.readAloudMarks) - e.value === t && (i = e.time / 1e3); - let s = window.mathlive.readAloudTokens.indexOf(t); - s >= 0 && - ((s += e), - s < window.mathlive.readAloudTokens.length && - (window.mathlive.readAloudFinalToken = s)); - } - (window.mathlive.readAloudAudio.currentTime = i), - window.mathlive.onReadAloudStatus && - window.mathlive.onReadAloudStatus( - window.mathlive.readAloudMathField, - 'playing' - ), - window.mathlive.readAloudAudio.play(); - } - }, - }; - }), - 'object' == typeof exports && 'undefined' != typeof module - ? (module.exports = factory()) - : 'function' == typeof define && define.amd - ? define(factory) - : ((global = global || self).MathLive = factory()); +var global,factory;global=this,factory=function(){function t(t,e){e=e||0;const i=t.charCodeAt(e);if(55296<=i&&i<=56319&&e=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const o of i){s+=a,a=" ";const t=o.match(/((?:\\%)|[^%])*/);t&&(s+=t[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const Rs in c)if(Object.prototype.hasOwnProperty.call(c,Rs))for(f=0;f<3;f++)u[f][Rs]=c[Rs][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let o=0;oMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return B(i[0],e)}return new L(t,e)}function O(t,e,i){const s=B(e,i);return s.type=t,s}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const h of e)if("number"==typeof h)o+=h;else{const t=B([r,h]);t.setTop(-h.depth-o),l.push(t),o+=h.height+h.depth}const c=B(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=$(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const s of e)H[s]&&(H[s].frequency=i),V[s]&&(V[s]=Object.assign({},V[s]),V[s].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const a in H)if(Object.prototype.hasOwnProperty.call(H,a)&&H[a].value===i){s=a;break}}else for(const a in vt)if(Object.prototype.hasOwnProperty.call(vt,a)&&vt[a]===i){s=a;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const i in it)if(Object.prototype.hasOwnProperty.call(it,i)&&it[i]===e){e=i;break}for(let i=0;i=st[i].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const n of t)U[n]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const o of t)V[o]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const n of i)s=Math.max(s,n.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const a of i)s.notation[a]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"};var wt={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let a=0;a=st[a].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/,LETTER_AND_DIGITS:/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/};const St=N.makeSymbol,At=N.makeSpan,Mt=N.makeVlist;function Ct(t,e,i,s,a,o){const n=St("Size"+i+"-Regular",wt.getValue("math",e)),r=N.makeStyleWrap(t,At(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function _t(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),At(St(e,wt.getValue("math",t)),"delimsizinginner"+i)}function Tt(t,e,i,s,a,o){let n,r,l,c;n=l=c=wt.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(wt.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(wt.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(wt.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(wt.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(_t(c,h)),null===r)for(let m=0;m","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],zt=[0,1.2,1.8,2.4,3],Et=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],qt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Pt(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return Bt(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Dt.includes(e)?Et:Lt.includes(e)?It:qt;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(wt.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=St("AMS-Regular",wt.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Ct(t,e,r.size,s,a,o):Tt(t,e,i,s,a,o)}function Bt(t,e,i){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Ot={makeSizedDelim:function(t,e,i,s,a){return"."===e?Bt(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Lt.includes(e)||Dt.includes(e)?Ct(t,e,i,!1,s,a):Ft.includes(e)?Tt(t,e,zt[i],!1,s,a):null)},makeCustomSizedDelim:Pt,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return Bt(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Pt(t,e,h,!0,a,o)}};const $t=N.makeSpan,Rt=N.makeOrd,Kt=N.makeInner,Nt=N.makeHlist,Wt=N.makeVlist,Ht=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,Vt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Ut={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class jt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Ut[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",Vt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ht.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=Rt(Jt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const h of e)h.align&&s++;for(const h of this.array){let t=0;for(;t0&&(m+=r,a0&&u.push(Wt(t,e,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const S of e){if(S.align&&b>=u.length)break;if(S.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(i)+N.depth(i)+o&&(o=(o+l-(N.height(i)+N.depth(i)))/2),r.setTop(r.height-N.height(i)-(o+s));const c=$t(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Wt(t,[i,o,c,s]);if(!this.index)return this.bind(t,Rt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=$t(Jt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Wt(t,[m],"shift",-.6*(u-f));return this.bind(t,Rt([$t(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Jt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,Rt(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=N.skew(i));const a=Math.min(N.height(i),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=$t($t(o),"accent-body"+n);return r=Wt(t,[i,-a,r]),r.children[1].setLeft(2*s),Rt(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Jt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=$t(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Wt(t,[i,3*s,a,s]);else{const e=$t(i);o=Wt(t,[s,a,3*s,e],"top",N.height(e))}return Rt(o,this.position)}decomposeOverunder(t){const e=Jt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?$t(Jt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?$t(Jt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Xt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=$t(Jt(t,this.body),"inner");return Rt([e,$t(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=Rt("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=N.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=N.makeOp(Jt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=Rt(Jt(t,this.body)),i=$t();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=$t([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=Rt(Jt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=$t("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),this.containsCaret&&(Array.isArray(i)?(i[0].classes=(i[0].classes||"")+" ML__contains-caret",i[i.length-1].classes=(i[i.length-1].classes||"")+" ML__contains-caret"):i.classes=(i.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Jt(t.sup(),this.superscript);a=$t(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Jt(t.sub(),this.subscript);o=$t(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-s.metrics.supDrop,l=N.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*i){l=4*i-(r-a.depth)+N.height(o);const t=.8*s.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Wt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,N.height(o)-.8*s.metrics.xHeight),p=Wt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Wt(t,[a],"shift",-r),p.children[0].setRight(d));const m=$t(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?$t(Jt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?$t(Jt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Xt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=N.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Gt(t){const e=$t("​","arraycolsep");return e.setWidth(t,"em"),e}function Zt(t,e,i,s){const a=[];for(const o of e){const e=$t(Jt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Wt(t,a,"individualShift")}function Xt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=$t(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+i;c=Wt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=N.height(e)-i;c=Wt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=N.depth(e)+i;c=Wt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return N.makeSpanOfType(n,c,"op-limits")}function Jt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Ut[t.size]/Ut[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var Yt={MathAtom:jt,decompose:Jt,makeRoot:function(t,e){const i=new jt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new jt("","first")),i},GREEK_REGEX:Ht};const Qt={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},te={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ee=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let h=0;h=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),h+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ie=function(t){let e=t.toUpperCase();for(const i in te)if(te[i]===e){e=i;break}for(const i in Qt)if(Qt[i]===e){e=i;break}return e},se=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ae=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const oe=Yt.MathAtom;class ne{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ee(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new oe("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new oe("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=wt.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const p of e.params)if(p.optional){const t=this.scanOptionalArg(p.type);i.push(t)}else i.push(this.scanArg(p.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new oe(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new oe("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=wt.getInfo("\\"+i.value,"math",this.macros);o=e?[new oe(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new oe(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new oe(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new oe(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=wt.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new oe(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new oe(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ee(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new oe("text",""," ",this.style));else if("placeholder"===t.type)e=new oe(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new oe(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new oe(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=wt.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new oe(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new oe(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new oe(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new oe(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=wt.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new oe(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=wt.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else"#"===t.type&&("?"===t.value?e=this.placeholder():this.args&&(e=this.args[t.value]||this.placeholder()));return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let n=1;n<=s;n++)e[n]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new oe(this.parseMode,"group",re(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let n=1;n<=s;n++){if(o+="{",Array.isArray(e[n]))for(let t=0;t1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const a of s){const t=a.match(/([^:]*):(.*)/);t&&e.path.push({relation:t[1],offset:parseInt(t[2])})}return e}var de={pathFromString:he,pathToString:ce,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return he(ce(t)).path}};const pe={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},me={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ue={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function fe(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&wt.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function ge(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function ye(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function be(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===ge("mac")||o===ge("win")||o===ge("ios")||o===ge("android")||o===ge("chromeos")||o===ge("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===ge("mac")||"ios"===ge("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var xe={KEYBOARD_SHORTCUTS:pe,INLINE_SHORTCUTS:ue,stringify:be,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ue).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=fe(t,e,ue[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=fe(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[ge("mac")+":"+t+":"+e,ge("win")+":"+t+":"+e,ge("ios")+":"+t+":"+e,ge("android")+":"+t+":"+e,ge("chromeos")+":"+t+":"+e,ge("other")+":"+t+":"+e,ge("mac")+":"+e,ge("win")+":"+e,ge("ios")+":"+e,ge("android")+":"+e,ge("chromeos")+":"+e,t+":"+e,e])if(pe[i])return pe[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=me[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=ye(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(pe).forEach(t=>{if(i.test(ye(pe[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),be(e)}};function ke(t,e){this.root=Yt.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function ve(t){const e=Object.assign(new ke(t.config,t.target),t);return e.path=de.clone(t.path),e}function we(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ae(t,e){let i;return"object"!=typeof e&&(e=Se(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Ie()),i}function Me(t){let e=0,i=0,s=1;for(const a of t)i+=1,a.length>s&&(s=a.length);return e=i*s,e}function Ce(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new Yt.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function _e(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ae(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Te(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function Le(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(Le(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||Le(t[i],e)})))return!0;if(t.array)for(let i=Me(t.array);i>=0;i--)if(Le(Ae(t.array,i),e))return!0}return!1}function Fe(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function De(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return ze(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function ze(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Ee(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=ze(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Ee(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=ze(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Ee(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=ze(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Ee(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=ze(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=ze(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=qe(i[1],e),t+=ze(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Ee(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=ze(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=qe(i[1],e),t+=ze(i[2],e),s=!0)),!s)if(i=Ee(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Ee(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+ze(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+ze(i.rest,e):i.match+ze(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+ze(i[2],e),s=!0)),t}function Ee(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=ze(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+ze(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=xe.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function qe(t,e){let i=xe.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Ie(){return new Yt.MathAtom("","first")}ke.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},ke.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new ke;s.path=de.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},ke.prototype.forEach=function(t){this.root.forEach(t)},ke.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let o=s;o0?0:1)},ke.prototype.setRange=function(t,e,i){i=i||{};const s=de.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(de.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(de.clone(t),s)}let a=de.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=de.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},ke.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},ke.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},ke.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},ke.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},ke.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},ke.prototype.insertFirstAtom=function(){this.siblings()},ke.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ae(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Ie()),t},ke.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},ke.prototype.isCollapsed=function(){return 0===this.extent},ke.prototype.setExtent=function(t){this.extent=t},ke.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},ke.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},ke.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&wt.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&wt.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Te(t[e]);)e-=1;for(;Te(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},ke.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},ke.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},ke.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},ke.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},ke.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=Me(e.array);i>=0;i--)t(Ae(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},ke.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},ke.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},ke.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=Me(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ae(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=Me(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},ke.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Se(this.parent().array,i);e=_e(this.parent().array,e,-1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},ke.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Se(this.parent().array,i);e=_e(this.parent().array,e,1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},ke.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=ve(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},ke.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=ve(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},ke.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},ke.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=ve(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},ke.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},ke.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},ke.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=Fe(t.numer),t.denom=Fe(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=Fe(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=Fe(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=Fe(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=Fe(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=Fe(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=Fe(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=Me(t.array);e>=0;e--)this.simplifyParen(Ae(t.array,e))})}},ke.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=De(t,{...this.config,format:"ASCIIMath"}),o=le.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)wt.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new Yt.MathAtom("command","command",e))}else""===t?o=[new Yt.MathAtom("command","command","\\")]:(t=De(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=le.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=le.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=le.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},ke.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=wt.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(wt.RIGHT_DELIM).forEach(e=>{t===wt.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},ke.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},ke.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const a of s){const t=new Yt.MathAtom("command","command",a);t.suggestion=!0,i.push(t)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},ke.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},ke.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},ke.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},ke.prototype.moveToNextPlaceholder_=function(){this.leap(1)},ke.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},ke.prototype.moveToNextChar_=function(){this.move(1)},ke.prototype.moveToPreviousChar_=function(){this.move(-1)},ke.prototype.moveUp_=function(){this.up()},ke.prototype.moveDown_=function(){this.down()},ke.prototype.moveToNextWord_=function(){this.skip(1)},ke.prototype.moveToPreviousWord_=function(){this.skip(-1)},ke.prototype.moveToGroupStart_=function(){this.setSelection(0)},ke.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},ke.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},ke.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},ke.prototype.deleteNextChar_=function(){this.delete_(1)},ke.prototype.deletePreviousChar_=function(){this.delete_(-1)},ke.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},ke.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},ke.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},ke.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},ke.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},ke.prototype.transpose_=function(){},ke.prototype.extendToNextChar_=function(){this.extend(1)},ke.prototype.extendToPreviousChar_=function(){this.extend(-1)},ke.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendUp_=function(){this.up({extend:!0})},ke.prototype.extendDown_=function(){this.down({extend:!0})},ke.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},ke.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},ke.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},ke.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},ke.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Ie()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Ie()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},ke.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Ie()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Ie()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},ke.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Ie()]),this.setSelection(0,"end",t)},ke.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},ke.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=ve(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},ke.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Se(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=we(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},ke.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=wt.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},ke.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},ke.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},ke.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},ke.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},ke.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Pe={EditableMathlist:ke,parseMathString:De};const Be={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Oe={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},$e={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Re(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=$e[t.target.value]||t.target.value),e||(Be[t.key]?(e=Be[t.key],i=!1):e=Oe[t.key],e||(e=$e[t.key.toLowerCase()])),!e&&t.code&&(e=Oe[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function Ke(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke(Re(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke(Re(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var Ne={delegateKeyboardEvents:Ke,select:Ke.select,keyboardEventToString:Re,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const We={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},He={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function Ve(t){let e=He[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ue(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&je(t,i),t.popover.classList.add("is-visible")}function je(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Ge(t){t.popover.classList.remove("is-visible")}var Ze={getNote:Ve,SAMPLES:We,NOTES:He,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Ge(t);const s=e,a=function(t,e){const i=le.parseTokens(n(t),"math",null,e.config.macros),s=Yt.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=N.makeSpan(s,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(We[s]||e,t),o=Ve(s),r=xe.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ue(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ue,hidePopover:Ge,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&je(e,t)}else Ge(e)}};function Xe(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else if("mode"===e)for(;t[s]&&t[s][e]===i;)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Xe(this,this.array[s][e],t);s1&&(i+=" "),i+=Xe(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Xe(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Xe(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Xe(this,this.shift,t)}em]`),i+=`{${Xe(this,this.width,t)}em}{${Xe(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Xe(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Xe(this,this.overscript||this.underscript,t)}}{${Xe(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Xe(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Xe(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Xe(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ie(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Xe(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Xe(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ie(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ie(this.backgroundcolor)}}`),i+=`{${Xe(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const s in this.notation)Object.prototype.hasOwnProperty.call(this.notation,s)&&this.notation[s]&&(i+=t+s,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ie(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ie(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Xe(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Xe(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Xe(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Je.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Je.locale.substring(0,2),a="ordinal"===i.type?Je.ordinal:Je.cardinal;let o,n="ordinal"===i.type?Je._ordinalPluralCategories.indexOf(a.select(t)):Je._cardinalPluralCategories.indexOf(a.select(t));return Je.strings[Je.locale]&&(o=Je.strings[Je.locale][e]),!o&&Je.strings[s]&&(o=Je.strings[s][e]),o||(o=Je.strings.en[e],o||(o=e),n="ordinal"===i.type?Je._ordinalPluralCategories.indexOf(Je._ordinalEnglish.select(t)):Je._cardinalPluralCategories.indexOf(Je._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Je.merge=function(t,e){if(t&&e){const i=Je._locale;Je.locale=t,Je.strings[t]={...Je.strings[t],...e},Je.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Je.merge(t,e[t])))},Object.defineProperty(Je,"locale",{set(t){Je._locale=t,Je._ordinal=null,Je._cardinal=null},get:()=>(Je._locale||(Je._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Je._locale)}),Object.defineProperty(Je,"ordinal",{get:()=>(Je._ordinal||(Je._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Je._ordinalEnglishPluralCategories=Je._ordinalEnglish.resolvedOptions().pluralCategories,Je._ordinal=new Intl.PluralRules(Je.locale,{type:"ordinal"}),Je._ordinalPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._ordinal)}),Object.defineProperty(Je,"cardinal",{get:()=>(Je._cardinal||(Je._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Je._cardinalEnglishPluralCategories=Je._cardinalEnglish.resolvedOptions().pluralCategories,Je._cardinal=new Intl.PluralRules(Je.locale,{type:"cardinal"}),Je._cardinaPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._cardinal)}),Je.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const Ye={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},Qe={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ti={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let ei={};const ii={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function si(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=le.parseTokens(n(t),"math",e,i.config.macros),a=Yt.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ai(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},Ye,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function oi(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&Qe[n]&&(a.setAttribute("data-shifted",Qe[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",Qe[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=ei[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function ni(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const i of r){let t=e.class||"";t&&(t=" "+t),"~"===i?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===i?a+="
  • ":"^"===i?a+="
  • ":"/"===i?a+="
  • ÷
  • ":"*"===i?a+="
  • ×
  • ":"-"===i?a+="
  • ":/tt/.test(t)?a+="
  • '+i+"
  • ":a+="
  • "+i+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ri={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ti["foreground-color"]=[];for(const d of ae)ti["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+d+'"}]'});ti["background-color"]=[];for(const d of se)ti["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+d+'"}]'});ei={...ti},Object.keys(ei).forEach(t=>{ei[t]=ei[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let d=0;d<26;d++){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[d];ei[t]||(ei[t]=[]),ei[t].unshift({latex:"\\mathbb{"+t+"}",aside:"blackboard",insert:"\\mathbb{"+t+"}"}),ei[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),ei[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),ei[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),ei[t].unshift({latex:"\\mathcal{"+t+"}",aside:"script",insert:"\\mathcal{"+t+"}"}),ei[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"}),ei[t].unshift({latex:"\\mathbb{"+s[d]+"}",aside:"blackboard",insert:"\\mathbb{"+s[d]+"}"}),ei[t].unshift({latex:"\\mathbf{"+s[d]+"}",aside:"bold",insert:"\\mathbf{"+s[d]+"}"}),ei[t].unshift({latex:"\\mathsf{"+s[d]+"}",aside:"sans",insert:"\\mathsf{"+s[d]+"}"}),ei[t].unshift({latex:"\\mathcal{"+s[d]+"}",aside:"script",insert:"\\mathcal{"+s[d]+"}"}),ei[t].unshift({latex:"\\mathfrak{"+s[d]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[d]+"}"})}for(let d=0;d<=26;d++){const t=s[d];ei[t]||(ei[t]=[]),ei[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathbb{"+t+"}"}),ei[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),ei[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),ei[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}for(let d=0;d<10;d++){const t="0123456789"[d];ei[t]||(ei[t]=[]),ei[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),ei[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),ei[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),ei[t].unshift({latex:"\\mathcal{"+t+"}",aside:"script",insert:"\\mathcal{"+t+"}"}),ei[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ii,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},Ye,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const d of r){if(!n[d])break;let e=n[d].layers||[];n[d].layer&&e.push(n[d].layer),e=Array.from(new Set(e));for(const s of e){if(!o[s])break;if("object"==typeof o[s]){let t="";if(o[s].styles&&(t+=``),o[s].backdrop&&(t+=`
    `),o[s].container&&(t+=`
    `),o[s].rows){t+="
    ";for(const e of o[s].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[s].container&&(t+=""),o[s].backdrop&&(t+="")}o[s]=t}i+="
    ",i+=ai(t,a,d);const e="function"==typeof o[s]?o[s]():o[s];i+=ni(t,e),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,oi(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let d=0;d{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:oi};const li={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},ci={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},hi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function di(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function pi(t,e){return t&&e.generateID?' extid="'+t+'"':""}function mi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,ui(t)&&(n=t.index,t.index+=1),fi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=vi(t.atoms[r].subscript,0,0,i).mathML,a+=vi(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,ui(t)){const e=vi(t.atoms[n].superscript,0,0,i).mathML,s=vi(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=vi(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=vi(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function ui(t){return t.index"+t,a+=vi(o.subscript,0,0,i).mathML,a+=vi(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=vi(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=vi(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function yi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function bi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&ui(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=vi(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function xi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=wi(t.atoms[l],i),a+=vi(t.atoms,l+1,c,i).mathML,a+=wi(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,gi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=vi(n.subscript,0,0,i).mathML,a+=vi(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=vi(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=vi(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Si(e.body)+"":wi(e,i);a+=r,t.index+=1,gi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function vi(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function wi(t,e){let i="";const s=Si(t.body);return s&&(i=""+s+""),i}function Si(t){if(!t)return"";if("string"==typeof t)return di(t);if(!Array.isArray(t)&&"string"==typeof t.body)return di(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return di(e)}Yt.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=vi(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(hi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+vi(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(hi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=vi(this.numer,0,0,t).mathML||" ",c+=vi(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+vi(this.numer,0,0,t).mathML+"",c+=""+vi(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=vi(this.body,0,0,t).mathML,c+=vi(this.index,0,0,t).mathML,c+=""):(c+="",c+=vi(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=vi(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(hi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=vi(this.body,0,0,t).mathML,c+=""+(hi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+vi(l,0,0,t).mathML,c+=vi(n,0,0,t).mathML,c+=vi(r,0,0,t).mathML,c+=""):r?(c+=""+vi(l,0,0,t).mathML,c+=vi(r,0,0,t).mathML,c+=""):n&&(c+=""+vi(l,0,0,t).mathML,c+=vi(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+pi(this.id,t)+">"+di(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&hi[p]?""+hi[p]+"":wi(this,t);break;case"mpunct":c='"+(hi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+vi(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+vi(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},Yt.toMathML=function(t,e){return vi(t,0,0,e).mathML};const Ai={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},Mi={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ci={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},_i={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Ti(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Li(t){return t&&_i[t]||-1}function Fi(t){return/=|=>/.test(t)?"right":"left"}function Di(t){if("f"===t||"g"===t)return!0;const e=Ci[t];return!!e&&!!/%[^01_^]?/.test(e)}function zi(t){t=(t||"").trim();let e=Ai[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=wt.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Ei(t){if(!t)return null;const e=zi($i(t)),i=[Li(e),Fi(e)];return i[0]<=0?null:i}function qi(t){return null!==Ei(t)}const Ii={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Pi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Bi={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Oi={",":"list",";":"list2"};function $i(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const i of t)e+=$i(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=$i(i);return e}return""}function Ri(t){return"string"==typeof t.sym?function(t){let e=Ci[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=wt.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=wt.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Ki(t){return parseFloat(t.num)}function Ni(t){return"object"==typeof t&&void 0!==t.num}function Wi(t){let e=0;return Ni(t)&&(e="object"==typeof t.num?void 0!==t.num.re?ls(t.num.re):0:parseFloat(t.num)),e}function Hi(t){let e=0;return Ni(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?ls(t.num.im):0),e}function Vi(t){return t&&void 0!==t.sup}function Ui(t){return t&&void 0!==t.sub}function ji(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||$i(a)===i),s}function Gi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Zi(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Xi(t){if(Ni(t)){const e=Wi(t),i=Hi(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Gi("negate",t)}function Ji(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function Yi(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=os(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test($i(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test($i(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test($i(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=os(i.superscript,e)):t.ast.sup=os(i.superscript,e))):t.index+=1,t}function Qi(t,e){const i=t.ast;if(es(t,"!!"))return t.index+=1,t.ast=Gi("factorial2",i),Qi(t=Yi(t,e),e);if(es(t,"++"))return t.index+=1,t.ast=Gi("increment",i),Qi(t=Yi(t,e),e);if(es(t,"--"))return t.index+=1,t.ast=Gi("decrement",i),Qi(t=Yi(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Pi[s.latex.trim()]&&(t.ast=Gi(Pi[s.latex.trim()],i),t=Qi(t=Yi(t,e),e)),t}function ts(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&$i(o)===e)t.index+=1,o=(t=ss(t,s)).atoms[t.index],o&&"mclose"===o.type&&$i(o)===i&&(Ji(t)&&(t.ast={group:t.ast}),t=Qi(t=Yi(t,s),s));else if("textord"===o.type&&$i(o)===e)t.index+=1,o=(t=ss(t,s)).atoms[t.index],o&&"textord"===o.type&&$i(o)===i&&(t.index+=1,t=Qi(t=Yi(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=ss(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=Qi(t=Yi(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=ss(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=Qi(t=Yi(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=os(o.body,s),Ji(t)&&(t.ast={group:t.ast}),t=Qi(t=Yi(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=wt.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=wt.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=wt.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=wt.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=ts(t,e,i))return s&&(t.index+=1),t.ast={fn:Ii[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function es(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===$i(t.atoms[t.index])+$i(t.atoms[t.index+1])}function is(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!ji(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,ji(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):ji(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function ss(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=zi($i(s));if(is(e))e.ast=Gi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Xi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Gi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>as(t)))),e=[t])}return e}function os(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=ss(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Gi("text",...i):i[0]||void 0}({atoms:as(t)},e)}function ns(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function rs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let s=0;s1&&(i+o.repeat(n+1)).startsWith(t))return"0"===o?i.replace(/(\d{3})/g,"$1"+e.groupSeparator):i.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function ls(t){return parseFloat(parseFloat(t).toPrecision(15))}function cs(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=rs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=rs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=rs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=ls(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=rs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=rs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}Yt.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=le.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=le.parseTokens(n(s),"math",null,t.macros),o=Gi("divide",os(i,t),os(s,t))):o.fn="divide"):o.group=os(this.body,t);break;case"genfrac":o=Gi("divide",os(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Zi(1):os(this.denom,t));break;case"surd":o=this.index?Gi("pow",os(this.body,t),Gi("divide",Zi(1),os(this.index,t))):Gi("sqrt",os(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=zi($i(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=wt.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=os(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Gi("card",os(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>os(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(os(e[0],t));let s=os(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},Yt.toAST=function(t,e){return os(t,e)};var hs=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Ni(e)){const i=Ki(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":cs(e.num,s);else{const t=Wi(e),i=Hi(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=cs(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?cs(i,s):"")+"\\imaginaryI "))}Vi(e)&&(a+="^{"+t(e.sup,s)+"}"),Ui(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),Ni(e.group)||Ri(e.group)?0!==Hi(e.group)&&(a=ns(e.fence||"(),",a)):a=ns(e.fence||"(),",a),Vi(e)&&(a+="^{"+t(e.sup,s)+"}"),Ui(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Ti(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Ti(e,1));else{let i="";for(let s=1;s=2)a=t(Ti(e,0),s),Ni(Ti(e,0))||Ri(Ti(e,0))||(a=ns(e.fence||"(),",a)),a+="^{"+t(Ti(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ci[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ns(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Ti(e,0),s),r=t(Ti(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ns(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ns(e.fence||"(),","");a=Vi(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Ui(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ns("() ",t(a,s))):0!==Wi(o=a)&&0!==Hi(o)?i.push(ns("() ",t(a,s))):Vi(e)&&0!==Hi(a)&&1!==Hi(a)?i.push(ns("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Ni(e.arg[0])&&"divide"!==e.arg[0].fn||Ni(e.arg[1])&&(0!==Wi(e.arg[1])||1!==Hi(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Ni(e.arg[0])&&Ki(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function ps(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function ms(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function us(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function fs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function gs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function ys(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function bs(t){return t.element&&t.element.mathfield===t}Yt.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=Yt.toSpeakableFragment(t.body,e),t.index){let i=Yt.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else ps(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ds[t.leftDelim]||t.leftDelim,s+=Yt.toSpeakableFragment(t.body,e),s+=ds[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=Yt.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ds[a]||(o?ds[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Ze.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=Yt.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=Yt.toSpeakableFragment(t.superscript,e);i=i.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=Yt.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=Yt.toSpeakableFragment(t.superscript,e);i=i.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=Yt.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=Yt.toSpeakableFragment(t.superscript,e);a=a.trim();let o=Yt.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ds[t.body]||ds[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=Yt.toSpeakableFragment(t.body,e),ps(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=Yt.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(ps(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=Yt.toSpeakableFragment(t.subscript,e);i=i.trim(),ps(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},Yt.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=Yt.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=Yt.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class xs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=gs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=gs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,us(this.element,"focus",this),us(this.element,"blur",this),us(this.textarea,"cut",this),us(this.textarea,"copy",this),us(this.textarea,"paste",this),Ne.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?us(this.field,"pointerdown",this):us(this.field,"touchstart:active mousedown",this),us(window,"resize",this);const o={...e};o.onSelectionDidChange=xs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=xs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Pe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>bs(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,fs(this.textarea,"cut",this),fs(this.textarea,"copy",this),fs(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,ys(this.popover),ys(this.keystrokeCaption),ys(this.virtualKeyboard),ys(document.getElementById("mathlive-alternate-keys-panel")),fs(this.element,"pointerdown",this),fs(this.element,"touchstart:active mousedown",this),fs(this.element,"focus",this),fs(this.element,"blur",this),fs(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=de.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1;const r=this.field.querySelector(".ML__mathlive").getBoundingClientRect();if(i=d>r.right?[{relation:"body",offset:this.mathlist.root.body.length-1}]:this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=de.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||vs>2?(n(t),3!==t.detail&&3!==vs||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(us(e.field,"pointermove",h),us(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(us(window,"blur",n),t.touches?(us(t.target,"touchmove",h),us(t.target,"touchend",n)):(us(window,"mousemove",h),us(window,"mouseup",n))),2!==t.detail&&2!==vs||(a=!0,this.mathlist.selectGroup_()))}}else ks=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Ze.hidePopover(this),this.mathlist.removeCommandString())}Ze.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return ws(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=ws(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Ze.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Ze.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(xe.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);0===e.length?Ze.hidePopover(this):Ze.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=Ne.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=xe.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(Ne.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=Ne.charToEvent(e);if(!this.$keystroke(Ne.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=wt.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Ze.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Ze.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;ibs(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,i=!1;for(;t&&!i;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,i=!0),e+=1,t=this.mathlist.ancestor(e)}const i=Yt.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=N.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+Yt.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=Yt.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=Yt.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=li[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&li[a]?li[a]:a&&ci[a]?ci[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=ci[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=Yt.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Ze.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Ze.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(wt.commandAllowed(t,e)){const i=le.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=le.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);if(0===e.length)Ze.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Ze.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),us(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),us(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),us(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const o of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ri.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",ys(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=Yt.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ks,vs=0;function ws(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+Yt.toSpeakableText(i,s)}function Ss(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=ws(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=ws(t,"",t.mathlist.sibling(0)):"line"===e?(a=ws(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+Yt.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?ws(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}xs.prototype.undo_=xs.prototype.undo,xs.prototype.redo_=xs.prototype.redo,xs.prototype.scrollIntoView_=xs.prototype.scrollIntoView,xs.prototype.scrollToStart_=xs.prototype.scrollToStart,xs.prototype.scrollToEnd_=xs.prototype.scrollToEnd,xs.prototype.insert_=xs.prototype.$insert;var As={isValidMathfield:bs,MathField:xs};function Ms(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=Ms(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(s){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ls(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Ts(t,void 0,e,!0));else{const s=_s(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Ps(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const e of window.mathlive.readAloudMarks)e.value&&window.mathlive.readAloudTokens.push(e.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function Bs(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Os(t,e){Ds&&((e=e||{}).renderToMarkup=e.renderToMarkup||zs,e.renderToMathML=e.renderToMathML||Es,e.renderToSpeakableText=e.renderToSpeakableText||qs,e.macros=e.macros||wt.MACROS,Ds.renderMathInElement(Bs(t),e))}function $s(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}return{latexToMarkup:zs,latexToMathML:Es,latexToSpeakableText:qs,latexToAST:function(t,e){if(!Yt.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,wt.MACROS);const i=le.parseTokens(n(t),"math",null,e.macros);return Yt.toAST(i,e)},astToLatex:function(t,e){return hs(t,e)},makeMathField:function(t,e){if(!As)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Is,e.handleReadAloud=e.handleReadAloud||Ps,new As.MathField(Bs(t),e)},renderMathInDocument:function(t){Os(document.body,t)},renderMathInElement:Os,revertToOriginalContent:function(t,e){(t=(t=Bs(t)).children[1])instanceof As.MathField?t.revertToOriginalContent():($s(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Bs(t)).children[1])instanceof As.MathField?t.originalContent:($s(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Ps,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s=1){const s=t.charCodeAt(e-1),a=i;return 55296<=s&&s<=56319?1024*(s-55296)+(a-56320)+65536:a}return i}function e(e,s){if((s=s||0)<0)return 0;if(s>=e.length-1)return e.length;let a=i(t(e,s));for(let r=s+1;r=this.s.length}get(){return this.pos="0"&&i<="9"?parseInt(i):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],i=t.toString().split(/\r?\n/);let s="",a="";for(const t of i){s+=a,a=" ";const e=t.match(/((?:\\%)|[^%])*/);e&&(s+=e[0])}const n=new o(s);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,i){if("string"==typeof t){const i=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);i?(t=parseFloat(i[1]),e=i[2].toLowerCase()):t=parseFloat(t)}const s={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(i)){const e=Math.pow(10,i);return Math.round(t/h.ptPerEm*s*e)/e}return t/h.ptPerEm*s}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const i={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let s=t.charCodeAt(0);t[0]in d?s=d[t[0]].charCodeAt(0):l.test(t[0])&&(s=77);const a=r[i][s];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const t in c)if(Object.prototype.hasOwnProperty.call(c,t))for(f=0;f<3;f++)u[f][t]=c[t][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,i,s){this.id=t,this.size=e,this.cramped=s,this.sizeMultiplier=i,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const i of t)e+=T(i);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,i=1;this.children&&this.children.forEach(s=>{s.height>t&&(t=s.height),s.depth>e&&(e=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=i}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let i="Main-Regular";if(e&&(i=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return K[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return K[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(N[e]?this.classes+=" "+N[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&i){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=i)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let i="",s=this.body||"";if(this.children){let t="none";for(const i of this.children){let a=0;if(t){let s=i.type;s&&("textord"===s&&(s="mord"),"first"===s&&(s="none"),a=i.isTight?E[t+"+"+s]||0:F[t+"+"+s]||0,a=Math.floor(e*a))}s+=i.toMarkup(a,e),t=q(i)}}if("​"!==s&&s||this.classes&&"ML__selected"!==this.classes){if(i="1?e.filter((function(t,e,i){return t.length>0&&i.indexOf(t)===e})).join(" "):e[0],a.length>0&&(i+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?s=z[-t]+s:D[t]?s=D[t]+s:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const i in this.style)Object.prototype.hasOwnProperty.call(this.style,i)&&("background-color"===i&&e||(t+=i+":"+this.style[i]+";"));t.length>0&&(i+=' style="'+t+'"')}i+=">",this.svgOverlay?(i+='",i+=""):i+=s,i+=""}else i="";return this.caret&&"command"!==this.type&&("text"===this.caret?i+='':i+=''),i}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,i=t.children&&t.children.length>0;if(e||i)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const s=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(s.length!==a.length)return!1;s.sort(),a.sort();for(let t=0;tMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const i=[];for(const e of t)e&&i.push(e);if(1===i.length)return B(i[0],e)}return new L(t,e)}function O(t,e,i){const s=B(e,i);return s.type=t,s}function R(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const i=new L(t,e);let s=1;return s=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),i.height*=s,i.depth*=s,i}const K={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},N={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var $={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const i=[e[0]];for(let s=1;s0?"em":""),s.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(s,"fontsize-ensurer reset-"+t.size+" size5"):0!==i?s:null}(t,n),l=[];o=a;for(const t of e)if("number"==typeof t)o+=t;else{const e=B([r,t]);e.setTop(-t.depth-o),l.push(e),o+=t.height+t.depth}const c=B(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:R,makeStyleWrap:function(t,e,i,s,a){a=a||"";const o=R(e,(a+=" style-wrap ")+i.adjustTo(s));o.type=t;const n=s.sizeMultiplier/i.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=s.sizeMultiplier,o},makeSVG:function(t,e,i){return t.svgOverlay=e,t.svgStyle=i,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const i of t)e+=i.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const i="string"==typeof t?X[t]:t;for(const t of e)H[t]&&(H[t].frequency=i),V[t]&&(V[t]=Object.assign({},V[t]),V[t].frequency=i)}function Y(t,e,i,s,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:i===rt?lt:i,baseFontFamily:e,value:s,category:W,frequency:a}}function Q(t,e){for(let i=t;i<=e;i++){const t=String.fromCodePoint(i);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const i=String.fromCodePoint(e);if("math"===t&&tt[i])return tt[i];if(e>32&&e<127)return i;let s="";if("math"===t){for(const t in H)if(Object.prototype.hasOwnProperty.call(H,t)&&H[t].value===i){s=t;break}}else for(const t in vt)if(Object.prototype.hasOwnProperty.call(vt,t)&&vt[t]===i){s=t;break}return s||i}const it={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},st=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const t in it)if(Object.prototype.hasOwnProperty.call(it,t)&&it[t]===e){e=t;break}for(let t=0;t=st[t].start&&et.body).join("")}function yt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a=ft(e),o={category:W,params:a,parser:s,mathstyle:"displaystyle",tabular:i.tabular||!0,colFormat:i.colFormat||[]};for(const e of t)U[e]=o}function bt(t,e,i,s){"string"==typeof t&&(t=[t]),i||(i={});const a={category:W,baseFontFamily:i.fontFamily,params:ft(e),allowedInText:!!i.allowedInText,infix:!!i.infix,parse:s};for(const e of t)V[e]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,i){let s=0;for(const t of i)s=Math.max(s,t.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let i=e[0]||[];const s={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)s.strokeWidth=m.toPx(t[1],"px"),isFinite(s.strokeWidth)||(s.strokeWidth=1),s.strokeStyle=t[2],s.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?s.backgroundcolor=t[2]:"mathcolor"===t[1]?s.strokeColor=t[2]:"padding"===t[1]?s.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(s.shadow=t[2]))}}"dashed"===s.strokeStyle?s.svgStrokeStyle="5,5":"dotted"===s.strokeStyle&&(s.svgStrokeStyle="1,5")}s.borderStyle=s.strokeWidth+"px "+s.strokeStyle+" "+s.strokeColor,i=i.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),s.notation={};for(const t of i)s.notation[t]=!0;return s.notation.updiagonalarrow&&(s.notation.updiagonalstrike=!1),s.notation.box&&(s.notation.left=!1,s.notation.right=!1,s.notation.bottom=!1,s.notation.top=!1),s})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const i={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":i.hasBarLine=!0;break;case"\\\\atopfrac":i.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i.hasBarLine=!1,i.leftDelim="(",i.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":i.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":i.mathstyle="textstyle"}return"\\cfrac"===t&&(i.continuousFraction=!0),i})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const i=e[0],s=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:i,denom:s,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let i=parseInt(e[0]);return isFinite(i)||(i=10067),{type:"mord",body:String.fromCodePoint(i)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",i=!0;for(const s of t)"string"==typeof s.body?e+=s.body:i=!1;return i?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const i={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(i.limits="nolimits",i.isFunction=!0),i})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const i={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return i.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?i.limits="nolimits":"\\operatorname*"===t&&(i.limits="limits"),i})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"};var wt={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,i){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!i)return t;const s=t.codePointAt(0);for(let t=0;t=st[t].offset&&s=1;)s.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?s=H[t]:vt[t]&&(s={value:vt[t]});return!s||"mord"!==s.type||"f"!==s.value&&"g"!==s.value&&"h"!==s.value||(s.isFunction=!0),s},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const i in V)Object.prototype.hasOwnProperty.call(V,i)&&i.startsWith(t)&&!V[i].infix&&e.push({match:i,frequency:V[i].frequency});for(const i in H)Object.prototype.hasOwnProperty.call(H,i)&&i.startsWith(t)&&e.push({match:i,frequency:H[i].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/,LETTER_AND_DIGITS:/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/};const St=$.makeSymbol,At=$.makeSpan,Mt=$.makeVlist;function Ct(t,e,i,s,a,o){const n=St("Size"+i+"-Regular",wt.getValue("math",e)),r=$.makeStyleWrap(t,At(n,"delimsizing size"+i),a.mathstyle,M.TEXT,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function _t(t,e){let i="";return"Size1-Regular"===e?i=" delim-size1":"Size4-Regular"===e&&(i=" delim-size4"),At(St(e,wt.getValue("math",t)),"delimsizinginner"+i)}function Tt(t,e,i,s,a,o){let n,r,l,c;n=l=c=wt.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(wt.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(wt.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(wt.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(wt.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((i-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;s&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(_t(c,h)),null===r)for(let t=0;t","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],zt=[0,1.2,1.8,2.4,3],Et=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],qt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Pt(t,e,i,s,a,o){if(!e||0===e.length||"."===e)return Bt(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Dt.includes(e)?Et:Lt.includes(e)?It:qt;const r=function(t,e,i,s){for(let o=Math.min(2,3-s.mathstyle.size);oe)return i[o]}var a;return i[i.length-1]}(wt.getValue("math",e),i,n,a);return"small"===r.type?function(t,e,i,s,a,o){const n=St("AMS-Regular",wt.getValue("math",e)),r=$.makeStyleWrap(t,n,a.mathstyle,i,o);return s&&r.setTop((1-a.mathstyle.sizeMultiplier/i.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,s,a,o):"large"===r.type?Ct(t,e,r.size,s,a,o):Tt(t,e,i,s,a,o)}function Bt(t,e,i){return $.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(i||""))}var Ot={makeSizedDelim:function(t,e,i,s,a){return"."===e?Bt(t,s,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Lt.includes(e)||Dt.includes(e)?Ct(t,e,i,!1,s,a):Ft.includes(e)?Tt(t,e,zt[i],!1,s,a):null)},makeCustomSizedDelim:Pt,makeLeftRightDelim:function(t,e,i,s,a,o){if("."===e)return Bt(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=s+n,c=i-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Pt(t,e,h,!0,a,o)}};const Rt=$.makeSpan,Kt=$.makeOrd,Nt=$.makeInner,$t=$.makeHlist,Wt=$.makeVlist,Ht=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,Vt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Ut={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class jt{constructor(t,e,i,s){this.mode=t,this.type=e,this.body=i,this.applyStyle(s)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Ut[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",Vt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ht.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const i of e)for(const e of i)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const i of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[i]))for(const s of this[i])s&&(e=e.concat(s.filter(t)));if(Array.isArray(this.array))for(const i of this.array)for(const s of i)s&&(e=e.concat(s.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),i=Kt(Jt(e,this.body));return this.cssId&&(i.cssId=this.cssId),i.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),i}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const i=[];let s=0;for(const t of e)t.align&&s++;for(const t of this.array){let e=0;for(;e0&&(m+=r,o0&&u.push(Wt(t,i,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const i of e){if(i.align&&b>=u.length)break;if(i.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);t$.height(i)+$.depth(i)+o&&(o=(o+l-($.height(i)+$.depth(i)))/2),r.setTop(r.height-$.height(i)-(o+s));const c=Rt(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=s;const d=Wt(t,[i,o,c,s]);if(!this.index)return this.bind(t,Kt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=Rt(Jt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Wt(t,[m],"shift",-.6*(u-f));return this.bind(t,Kt([Rt(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let i=Jt(t.cramp(),this.body);(this.superscript||this.subscript)&&(i=this.attachSupsub(t,Kt(i),"mord"));let s=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(s=$.skew(i));const a=Math.min($.height(i),e.metrics.xHeight),o=$.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=Rt(Rt(o),"accent-body"+n);return r=Wt(t,[i,-a,r]),r.children[1].setLeft(2*s),Kt(r,"accent")}decomposeLine(t){const e=t.mathstyle,i=Jt(t.cramp(),this.body),s=h.defaultRuleThickness/e.sizeMultiplier,a=Rt(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=s,a.maxFontSize=1,"overline"===this.position)o=Wt(t,[i,3*s,a,s]);else{const e=Rt(i);o=Wt(t,[s,a,3*s,e],"top",$.height(e))}return Kt(o,this.position)}decomposeOverunder(t){const e=Jt(t,this.body),i=t.clone({mathstyle:"scriptstyle"}),s=this.overscript?Rt(Jt(i,this.overscript),t.mathstyle.adjustTo(i.mathstyle)):null,a=this.underscript?Rt(Jt(i,this.underscript),t.mathstyle.adjustTo(i.mathstyle)):null;return Xt(t,e,0,0,s,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=Rt(Jt(t,this.body),"inner");return Kt([e,Rt(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,i=Kt("","rule");let s=this.shift&&!isNaN(this.shift)?this.shift:0;s/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return i.setStyle("border-right-width",a,"em"),i.setStyle("border-top-width",o,"em"),i.setStyle("margin-top",-(o-s),"em"),i.setStyle("border-color",t.color),i.width=a,i.height=o+s,i.depth=-s,i}decomposeOp(t){const e=t.mathstyle;let i,s=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(s=!0);let a=0,o=0;if(this.symbol){const n=s?"Size2-Regular":"Size1-Regular";i=$.makeSymbol(n,this.body,"op-symbol "+(s?"large-op":"small-op")),i.type="mop",a=(i.height-i.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=i.italic,this.bind(t,i)}else Array.isArray(this.body)?(i=$.makeOp(Jt(t,this.body)),this.bind(t,i)):i=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const s=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===s||"auto"===s&&e.size===M.DISPLAY.size?this.attachLimits(t,i,a,o):this.attachSupsub(t,i,"mop")}return this.symbol&&i.setTop(a),i}decomposeBox(t){const e=Kt(Jt(t,this.body)),i=Rt();i.setStyle("position","absolute");const s="number"==typeof this.padding?this.padding:h.fboxsep;i.setStyle("height",e.height+e.depth+2*s,"em"),0!==s?i.setStyle("width","calc(100% + "+2*s+"em)"):i.setStyle("width","100%"),i.setStyle("top",-s,"em"),i.setStyle("left",-s,"em"),i.setStyle("z-index","-1"),this.backgroundcolor&&i.setStyle("background-color",this.backgroundcolor),this.framecolor&&i.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&i.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+s,"em");const a=Rt([i,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-s+e.depth,"em"),a.height=e.height+s,a.depth=e.depth+s,a.setLeft(s),a.setRight(s),a}decomposeEnclose(t){const e=Kt(Jt(t,this.body)),i="auto"===this.padding?.2:this.padding;e.setStyle("padding",i,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-i,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let s="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",($.height(e)+$.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(s+='0?i.setWidth(this.width):i.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";i=Rt("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?i=this.decomposeBox(t):"enclose"===this.type?i=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(i=this.makeSpan(t,this.body),i.classes="",this.error&&(i.classes+=" ML__error"),this.suggestion&&(i.classes+=" ML__suggestion")):"placeholder"===this.type?i=this.makeSpan(t,"⬚"):"first"===this.type&&(i=this.makeSpan(t,"​"));if(!i)return i;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(i)?i[i.length-1].caret=this.caret:i.caret=this.caret),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(i)){const e=i[i.length-1];i[i.length-1]=this.attachSupsub(t,e,e.type)}else i=[this.attachSupsub(t,i,i.type)];return Array.isArray(i)?i:[i]}attachSupsub(t,e,i){if(!this.superscript&&!this.subscript)return e;const s=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Jt(t.sup(),this.superscript);a=Rt(e,s.adjustTo(s.sup()))}if(this.subscript){const e=Jt(t.sub(),this.subscript);o=Rt(e,s.adjustTo(s.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=$.height(e)-s.metrics.supDrop,l=$.depth(e)+s.metrics.subDrop),n=s===M.DISPLAY?s.metrics.sup1:s.cramped?s.metrics.sup3:s.metrics.sup2;const c=M.TEXT.sizeMultiplier*s.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),l=Math.max(l,s.metrics.sub2);const i=h.defaultRuleThickness;if(r-$.depth(a)-($.height(o)-l)<4*i){l=4*i-(r-a.depth)+$.height(o);const t=.8*s.metrics.xHeight-(r-$.depth(a));t>0&&(r+=t,l-=t)}p=Wt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-$.italic(e))}else o&&!a?(l=Math.max(l,s.metrics.sub1,$.height(o)-.8*s.metrics.xHeight),p=Wt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-$.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*s.metrics.xHeight),p=Wt(t,[a],"shift",-r),p.children[0].setRight(d));const m=Rt(p,"msubsup");return this.caret&&(m.caret=this.caret),$.makeSpanOfType(i,[e,m])}attachLimits(t,e,i,s){const a=this.superscript?Rt(Jt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?Rt(Jt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Xt(t,e,i,s,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const i="textord"===this.type?"mord":this.type,s=$.makeSpanOfType(i,e),a=this.getStyle();s.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+o):t.parentSize!==t.size&&(s.classes+=" sizing reset-"+t.parentSize,s.classes+=" "+t.size),s.maxFontSize=Math.max(s.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(s.classes+=" ML__text"),t.mathstyle.isTight()&&(s.isTight=!0),"math"!==this.mode&&(s.italic=0),s.setRight(s.italic),"number"==typeof t.opacity&&s.setStyle("opacity",t.opacity),this.bind(t,s),this.caret&&(this.superscript||this.subscript||(s.caret=this.caret,t.mathstyle.isTight()&&(s.isTight=!0))),s}}function Gt(t){const e=Rt("​","arraycolsep");return e.setWidth(t,"em"),e}function Zt(t,e,i,s){const a=[];for(const o of e){const e=Rt(Jt(t,s));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-i)}return Wt(t,a,"individualShift")}function Xt(t,e,i,s,a,o,n){if(!a&&!o)return e;e=Rt(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+$.height(o)+$.depth(o)+l+$.depth(e)+i;c=Wt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-s),c.children[2].setLeft(s)}else if(o&&!a){const a=$.height(e)-i;c=Wt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-s)}else if(!o&&a){const o=$.depth(e)+i;c=Wt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(s)}return $.makeSpanOfType(n,c,"op-limits")}function Jt(t,e){function i(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function s(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Ut[t.size]/Ut[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var Yt={MathAtom:jt,decompose:Jt,makeRoot:function(t,e){const i=new jt(t=t||"math","root",e||[]);return 0!==i.body.length&&"first"===i.body[0].type||i.body.unshift(new jt("","first")),i},GREEK_REGEX:Ht};const Qt={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},te={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ee=function(t){const e=t.toLowerCase().split("!");let i,s,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let t=0;t=0&&(o=(1-l)*o+l*i,n=(1-l)*n+l*s,r=(1-l)*r+l*a,l=-1),t+1=0&&(o=l*o+(1-l)*i,n=l*n+(1-l)*s,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},ie=function(t){let e=t.toUpperCase();for(const t in te)if(te[t]===e){e=t;break}for(const t in Qt)if(Qt[t]===e){e=t;break}return e},se=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ae=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const oe=Yt.MathAtom;class ne{constructor(t,e,i){this.tokens=t,this.index=0,this.args=e,this.macros=i,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===s.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ee(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let i=10,s=/[0-9]/;this.parseLiteral("'")?(i=8,s=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(i=16,s=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(s);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(s);)a+=this.get().value;const o=t?parseInt(a,i):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),i=new oe("math","group");return i.mathstyle=")"===t?"textstyle":"displaystyle",i.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),i.body&&0!==i.body.length?i:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new oe("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const i=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(i),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=wt.getEnvironmentInfo(t),i=[];if(e&&e.params)for(const t of e.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else i.push(this.scanArg(t.type));const s=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=s,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new oe(this.parseMode,"array",h,e.parser?e.parser(t,i,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let i=null,s=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new oe("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!i?(i=this.get(),s=this.swapMathList([])):this.parseAtom();let o;if(i){const t=this.swapMathList(a),e=wt.getInfo("\\"+i.value,"math",this.macros);o=e?[new oe(this.parseMode,e.type,e.value||i.value,e.parse?e.parse("\\"+i.value,[s,t]):null)]:[new oe(this.parseMode,"mop",i.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new oe(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new oe(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let i=1;for(;!this.end()&&0!==i;)this.hasLiteral("(")&&(i+=1),this.hasLiteral(")")&&(i-=1),0!==i&&this.parseAtom();return 0===i&&this.parseLiteral(")"),t.rightDelim=0===i?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const i=wt.getInfo(e,"math",this.macros);return i?"mopen"===i.type||"mclose"===i.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const i=this.scanDelim();if(!i)return null;const s=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new oe(this.parseMode,"leftright");return o.leftDelim=i,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(s),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const i=this.scanArg();if(i){const s=this.lastMathAtom();s[e]=s[e]||[],s[e]=s[e].concat(i),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new oe(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const i=this.swapMathList();let s;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)s=this.scanString();else if("number"===t)s=this.scanNumber();else if("dimen"===t)s=this.scanDimen();else if("skip"===t)s=this.scanSkip();else if("colspec"===t)s=this.scanColspec();else if("color"===t)s=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ee(e);if(t)s=s||{},s.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)s=s||{},s.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(s=s||{},s.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(i);return s||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const i=this.scanToken();return this.parseMode=e,Array.isArray(i)?i:i?[i]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const i=this.parseMode;this.parseMode=t;const s=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=i;const a=this.swapMathList(s);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new oe("text",""," ",this.style));else if("placeholder"===t.type)e=new oe(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new oe(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const i=this.scanSkip();isFinite(i)&&(e=new oe(this.parseMode,"spacing",null,this.style),e.width=i),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const i=wt.getInfo("\\"+t.value,this.parseMode,this.macros),s=[];let a="",o="";if(i&&i.params)for(const t of i.params)if(t.optional){const e=this.scanOptionalArg(t.type);s.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)s.push(e);else if(t.placeholder){const e=new oe(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,s.push([e])}else s.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(i&&!i.infix){if(i.parse){const a=i.parse("\\"+t.value,s);if(a.type)e=new oe(this.parseMode,i.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new oe(this.parseMode,i.type||"mop",i.value||t.value,s),i.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}i||(e=new oe(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const i=wt.getInfo(t.value,this.parseMode,this.macros);if(i){const s={...this.style};i.baseFontFamily&&(s.baseFontFamily=i.baseFontFamily),e=new oe(this.parseMode,i.type,i.value||t.value,s),i.isFunction&&(e.isFunction=!0)}else e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=wt.matchCodepoint(this.parseMode,t.value.codePointAt(0)),i&&i.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else if("#"===t.type)if("?"===t.value)e=this.placeholder();else if(this.args)if(e=this.args[t.value]||null,Array.isArray(e)&&1===e.length)e=e[0];else if(Array.isArray(e)){const t=new oe(this.parseMode,"group");t.body=e,e=t}else e=this.placeholder();return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let i,s=0;"string"==typeof this.macros[t]?(i=this.macros[t],/(^|[^\\])#1/.test(i)&&(s=1),/(^|[^\\])#2/.test(i)&&(s=2),/(^|[^\\])#3/.test(i)&&(s=3),/(^|[^\\])#4/.test(i)&&(s=4),/(^|[^\\])#5/.test(i)&&(s=5),/(^|[^\\])#6/.test(i)&&(s=6),/(^|[^\\])#7/.test(i)&&(s=7),/(^|[^\\])#8/.test(i)&&(s=8),/(^|[^\\])#9/.test(i)&&(s=9)):(i=this.macros[t].def,s=this.macros[t].args||0);for(let t=1;t<=s;t++)e[t]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new oe(this.parseMode,"group",re(n(i),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let t=1;t<=s;t++){if(o+="{",Array.isArray(e[t]))for(let i=0;i1&&(e.extent=parseInt(i[1]));const s=i[0].split("/");for(const t of s){const i=t.match(/([^:]*):(.*)/);i&&e.path.push({relation:i[1],offset:parseInt(i[2])})}return e}var de={pathFromString:he,pathToString:ce,pathDistance:function(t,e){let i=0,s=-1,a=!1;for(;!a;)s+=1,a=s>=t.length||s>=e.length,a=a||!(t[s].relation===e[s].relation&&t[s].offset===e[s].offset);return i=s===t.length&&s===e.length?0:s+1===t.length&&s+1===e.length&&t[s].relation===e[s].relation?1:2,i},pathCommonAncestor:function(t,e){const i=[],s=Math.min(t.length-1,e.length-1);let a=0;for(;a<=s&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)i.push(t[a]),a+=1;return i},clone:function(t){return he(ce(t)).path}};const pe={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},me={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ue={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function fe(t,e,i){if(!i)return i;if("string"==typeof i)return i;if("string"==typeof i.mode&&i.mode!==t)return null;if(!e)return i?i.value:void 0;let s=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return s=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&wt.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==i.after?/nothing/.test(i.after)&&s||/letter/.test(i.after)&&a||/digit/.test(i.after)&&o||/function/.test(i.after)&&n||/frac/.test(i.after)&&r||/surd/.test(i.after)&&l||/binop/.test(i.after)&&c||/relop/.test(i.after)&&h||/punct/.test(i.after)&&d||/array/.test(i.after)&&p||/openfence/.test(i.after)&&m||/closefence/.test(i.after)&&u||/text/.test(i.after)&&f||/space/.test(i.after)&&g?i.value:null:i.value}function ge(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function ye(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function be(t,e){let i="";Array.isArray(t)||(t=[t]);for(const s of t){let t;const a=s.match(/(^[^:]*):/),o=a?a[1]:"";if(o===ge("mac")||o===ge("win")||o===ge("ios")||o===ge("android")||o===ge("chromeos")||o===ge("other")){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=s.match(/:([^:]*)$/);t=e?e[1]:s}if(t){const s="mac"===ge("mac")||"ios"===ge("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!s&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:s?"⌘":"command",Shift:s?"⇧":"shift",Alt:s?"⌥":"alt",Ctrl:s?"⌃":"control","\n":s?"⏎":"return",Return:s?"⏎":"return",Enter:s?"⌤":"enter",Tab:s?"⇥":"tab",Esc:"esc",Backspace:s?"⌫":"backspace",Del:s?"⌦":"del",PageUp:s?"⇞":"page up",PageDown:s?"⇟":"page down",Home:s?"⤒":"home",End:s?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;i.length>0&&(i+=e||" or "),i+=o}}return i}var xe={KEYBOARD_SHORTCUTS:pe,INLINE_SHORTCUTS:ue,stringify:be,startsWithString:function(t,e){const i=[];for(let s=0;s<=t.length-1;s++){const a=t.substring(s);e&&e.overrideDefaultInlineShortcuts||Object.keys(ue).forEach(t=>{t.startsWith(a)&&!i.includes(t)&&i.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&i.push(t)})}return i},forString:function(t,e,i,s){let a="";s&&s.overrideDefaultInlineShortcuts||(a=fe(t,e,ue[i]));const o=s&&s.inlineShortcuts?s.inlineShortcuts:null;let n;return o&&(n=fe(t,e,o[i])),n||a},selectorForKeystroke:function(t,e){for(const i of[ge("mac")+":"+t+":"+e,ge("win")+":"+t+":"+e,ge("ios")+":"+t+":"+e,ge("android")+":"+t+":"+e,ge("chromeos")+":"+t+":"+e,ge("other")+":"+t+":"+e,ge("mac")+":"+e,ge("win")+":"+e,ge("ios")+":"+e,ge("android")+":"+e,ge("chromeos")+":"+e,t+":"+e,e])if(pe[i])return pe[i];return""},forCommand:function(t){let e=[];if("string"==typeof t){const i=me[t];Array.isArray(i)?e=i.slice():i&&e.push(i)}t=ye(t);const i=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(pe).forEach(t=>{if(i.test(ye(pe[t]))){const i=t.match(/:([^:]*)$/);i&&e.push(i[1])}}),be(e)}};function ke(t,e){this.root=Yt.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function ve(t){const e=Object.assign(new ke(t.config,t.target),t);return e.path=de.clone(t.path),e}function we(t,e){let i=0;for(let s=0;s0;)i.col+=1,(!t[i.row]||i.col>=t[i.row].length)&&(i.col=0,i.row+=1),e-=1;return i}function Ae(t,e){let i;return"object"!=typeof e&&(e=Se(t,e)),Array.isArray(t[e.row])&&(i=t[e.row][e.col]||null),!i||0!==i.length&&"first"===i[0].type||i.unshift(Ie()),i}function Me(t){let e=0,i=0,s=1;for(const e of t)i+=1,e.length>s&&(s=e.length);return e=i*s,e}function Ce(t,e,i){if(!t)return[];e||(e=",");let s,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(s?a.push(s):s=new Yt.MathAtom("math","mpunct",e,i),a=a.concat(o));return a}function _e(t,e,i){const s={...e};if(s.row+=i,s.row<0){if(s.col+=i,s.row=t.length-1,s.col<0)return null;for(;s.row>=0&&!Ae(t,s);)s.row-=1;if(s.row<0)return null}else if(s.row>=t.length){for(s.col+=i,s.row=0;s.rowt.length-1)return null}return s}function Te(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function Le(t,e){if(!t)return!1;if(Array.isArray(t)){for(const i of t)if(Le(i,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(i){return i===e||Le(t[i],e)})))return!0;if(t.array)for(let i=Me(t.array);i>=0;i--)if(Le(Ae(t.array,i),e))return!0}return!1}function Fe(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function De(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return ze(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function ze(t,e){if(!t)return"";let i,s=!1;if(s||"^"!==t[0]&&"_"!==t[0]||(i=Ee(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+i.match+"}",t+=ze(i.rest,e),s=!0),s||(i=t.match(/^(sqrt|\u221a)(.*)/),i&&(i=Ee(i[2],{...e,noWrap:!0}),t="\\sqrt{"+i.match+"}",t+=ze(i.rest,e),s=!0)),s||(i=t.match(/^(\\cbrt|\u221b)(.*)/),i&&(i=Ee(i[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+i.match+"}",t+=ze(i.rest,e),s=!0)),s||(i=t.match(/^abs(.*)/),i&&(i=Ee(i[1],{...e,noWrap:!0}),t="\\left|"+i.match+"\\right|",t+=ze(i.rest,e),s=!0)),s||(i=t.match(/^["”“](.*?)["”“](.*)/),i&&(t="\\text{"+i[1]+"}",t+=ze(i[2],e),s=!0)),s||(i=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),i&&(t=qe(i[1],e),t+=ze(i[2],e),s=!0)),!s&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(i=Ee(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+i.match+"\\mright)":t[0]+i.match,t+=ze(i.rest,e),s=!0),s||(i=t.match(/^([a-zA-Z]+)(.*)/),i&&(t=qe(i[1],e),t+=ze(i[2],e),s=!0)),!s)if(i=Ee(t,{...e,noWrap:!0}),i.match&&"/"===i.rest[0]){const a=Ee(i.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+i.match+"}{"+a.match+"}"+ze(a.rest,e)),s=!0}else i.match&&(t="("===t[0]?"\\left("+i.match+"\\right)"+ze(i.rest,e):i.match+ze(i.rest,e),s=!0);return s||(i=t.match(/^(\s+)(.*)$/),i&&(t=" "+ze(i[2],e),s=!0)),t}function Ee(t,e){let i="",s=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?i=ze(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),i="\\left"+a+ze(t.substring(1,r-1),e)+"\\right"+o),s=t.substring(r)):(i=t.substring(1,r),s="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let i=xe.forString("math",null,t,e);if(i)return i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),{match:i,rest:t.substring(i.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(s=t.substring(a[1].length),i=a[1]))}return{match:i,rest:s}}function qe(t,e){let i=xe.forString("math",null,t,e);return i?(i=i.replace("_{#?}",""),i=i.replace("^{#?}",""),i+=" "):i=t,i}function Ie(){return new Yt.MathAtom("","first")}ke.prototype._announce=function(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,i)},ke.prototype.filter=function(t,e){e=e<0?-1:1;const i=[],s=new ke;s.path=de.clone(this.path),s.extent=this.extent,s.root=this.root,e>=0?s.collapseForward():(s.collapseBackward(),s.move(1));const a=s.anchor();do{t.bind(s)(s.path,s.anchor())&&i.push(s.toString()),e>=0?s.next({iterateAll:!0}):s.previous({iterateAll:!0})}while(a!==s.anchor());return i},ke.prototype.forEach=function(t){this.root.forEach(t)},ke.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const i=this.siblings(),s=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let e=s;e0?0:1)},ke.prototype.setRange=function(t,e,i){i=i||{};const s=de.pathDistance(t,e);if(0===s)return i.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(de.clone(t),0);if(1===s){const s=e[e.length-1].offset-t[t.length-1].offset;return i.extendToWordBoundary?(t=this.wordBoundary(t,s<0?1:-1),e=this.wordBoundary(e,s<0?-1:1),this.setRange(t,e)):this.setPath(de.clone(t),s)}let a=de.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=de.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},ke.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let i=0;i0?this.path[this.path.length-1].relation:""},ke.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},ke.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},ke.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},ke.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},ke.prototype.insertFirstAtom=function(){this.siblings()},ke.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ae(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Ie()),t},ke.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},ke.prototype.isCollapsed=function(){return 0===this.extent},ke.prototype.setExtent=function(t){this.extent=t},ke.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},ke.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},ke.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),i=this.endOffset();for(;t[e]&&"text"===t[e].mode&&wt.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[i]&&"text"===t[i].mode&&wt.LETTER_AND_DIGITS.test(t[i].body);)i+=1;if(i-=1,e>=i)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,i-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),i=this.endOffset();for(;Te(t[e]);)e-=1;for(;Te(t[i]);)i+=1;i-=1,this.setSelection(e,i-e)}else this.setSelection(0,"end")},ke.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},ke.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},ke.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),i=this.startOffset(),s=this.endOffset();for(let a=i;a0&&"command"===t[e].type;)e-=1;let i=this.startOffset()+1;for(;i<=t.length-1&&"command"===t[i].type;)i+=1;return i>e?{start:e+1,end:i}:null},ke.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const i=this.commandOffsets();if(i){const s=t?this.anchorOffset()+1:i.end,a=this.siblings();for(let t=i.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==i.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},ke.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let i=e.length-1;i>=0;i--)"command"===e[i].type?e.splice(i,1):t(e[i]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let i=Me(e.array);i>=0;i--)t(Ae(e.array,i))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},ke.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let i=this.startOffset();if("text"===t[i].mode)for(;i>=1&&"text"===t[i].mode;)e.unshift(t[i]),i--;else for(;i>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[i].type);)e.unshift(t[i]),i--;return e},ke.prototype.setSelection=function(t,e,i){t=t||0,e=e||0;const s=this.path[this.path.length-1].relation;i||(i=s);const a=this.parent();if(!a&&"body"!==i)return!1;const o=i.startsWith("cell");if(!o&&!a[i]||o&&!a.array)return!1;const n=i!==s;this.path[this.path.length-1].relation=i;const r=this.siblings().length;this.path[this.path.length-1].relation=s;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=i,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},ke.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let i=e[this.relation()];const s=this.parent();for(;i&&!s[i];)i=e[i];if(i)return void this.setSelection(0,0,i);if(this.parent().array){const t=Me(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ae(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const i=this.anchor();if(!i.captureSelection){let t;if(i.array){t="";const e=Me(i.array);let s=e-1;for(;!t&&s0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},ke.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const i=this.relation();if("denom"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Se(this.parent().array,i);e=_e(this.parent().array,e,-1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},ke.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const i=this.relation();if("numer"===i)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Se(this.parent().array,i);e=_e(this.parent().array,e,1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},ke.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,i=0;const s=ve(this);i=this.extent+t;const a=e+i;if(a<0&&0!==i){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",s);e=this.path[this.path.length-1].offset,i=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",s);this.isCollapsed()&&(e-=1),i-=1}this.setSelection(e,i),this._announce("move",s)},ke.prototype.skip=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=ve(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(i&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!i)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let i="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(i){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",s)}},ke.prototype.jump=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const s=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,s.length-1));const o=t<0?0:s.length-1;i?this.extend(o-a):this.move(o-a)},ke.prototype.jumpToMathFieldBoundary=function(t,e){const i=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const s=ve(this),a=[{relation:"body",offset:this.path[0].offset}];let o;i?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(s,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',i=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let s=i.indexOf(document.activeElement)+t;s<0&&(s=i.length-1),s>=i.length&&(s=0),i[s].focus()}return this.suppressChangeNotifications=i,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",s),this.selectionDidChange(),this.suppressChangeNotifications=i,!0},ke.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e=s.mode),i+=1,s=this.ancestor(i);return e},ke.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let i=1,s=this.ancestor(i);for(;!e&&s;)s&&(e={color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontShape:s.fontShape,fontSeries:s.fontSeries,fontSize:s.fontSize}),i+=1,s=this.ancestor(i);return e},ke.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let i=0,s=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(i++,s=o),"first"!==t[e].body[o].type&&a++;0===a&&1===i&&(t[e]=t[e].body[s])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=Fe(t.numer),t.denom=Fe(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=Fe(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=Fe(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=Fe(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=Fe(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=Fe(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=Fe(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=Me(t.array);e>=0;e--)this.simplifyParen(Ae(t.array,e))})}},ke.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const i=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const s=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=De(t,{...this.config,format:"ASCIIMath"}),o=le.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)wt.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new Yt.MathAtom("command","command",e))}else""===t?o=[new Yt.MathAtom("command","command","\\")]:(t=De(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=le.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=le.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=le.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,i){e&&i&&(Array.isArray(e)?e.forEach(e=>t(e,i)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(i),t(e.body,i),t(e.numer,i),t(e.denom,i),t(e.index,i),t(e.overscript,i),t(e.underscript,i),t(e.subscript,i),t(e.superscript,i))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=s,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=i},ke.prototype._insertSmartFence=function(t,e){const i=this.parent();if("leftright"===i.type&&"|"!==i.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const s=wt.RIGHT_DELIM[t];if(s&&("leftright"!==i.type||"|"!==i.leftDelim)){let i="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;i=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",i+=a?"?":s;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(i,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(wt.RIGHT_DELIM).forEach(e=>{t===wt.RIGHT_DELIM[e]&&(a=e)}),a){if(i&&"leftright"===i.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),i.rightDelim=t,this.move(1),this.contentDidChange(),!0;const s=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==s[a].type||"?"!==s[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),s[a].rightDelim=t,s[a].body=s[a].body.concat(s.slice(a+1,this.endOffset()+1)),s.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(i&&"leftright"===i.type&&"?"===i.rightDelim){this.contentWillChange(),i.rightDelim=t;const e=s.slice(this.endOffset()+1);return s.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===s.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},ke.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let i=e.start;for(;i=0;e--)t[e].suggestion&&t.splice(e,1)},ke.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const i=[],s=t.substr(e);for(const t of s){const e=new Yt.MathAtom("command","command",t);e.suggestion=!0,i.push(e)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(i))},ke.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},ke.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},ke.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(i+=1)}s.row+=1}return i}(t,e.col)){!function(t,e){let i=0;for(;i"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==i.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,i.slice(e+1,e+2)),i.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,i.slice(t,e)),i.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},ke.prototype.moveToNextPlaceholder_=function(){this.leap(1)},ke.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},ke.prototype.moveToNextChar_=function(){this.move(1)},ke.prototype.moveToPreviousChar_=function(){this.move(-1)},ke.prototype.moveUp_=function(){this.up()},ke.prototype.moveDown_=function(){this.down()},ke.prototype.moveToNextWord_=function(){this.skip(1)},ke.prototype.moveToPreviousWord_=function(){this.skip(-1)},ke.prototype.moveToGroupStart_=function(){this.setSelection(0)},ke.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},ke.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},ke.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},ke.prototype.deleteNextChar_=function(){this.delete_(1)},ke.prototype.deletePreviousChar_=function(){this.delete_(-1)},ke.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},ke.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},ke.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},ke.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},ke.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},ke.prototype.transpose_=function(){},ke.prototype.extendToNextChar_=function(){this.extend(1)},ke.prototype.extendToPreviousChar_=function(){this.extend(-1)},ke.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendUp_=function(){this.up({extend:!0})},ke.prototype.extendDown_=function(){this.down({extend:!0})},ke.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},ke.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},ke.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},ke.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},ke.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Ie()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Ie()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},ke.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Ie()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Ie()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},ke.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Ie()]),this.setSelection(0,"end",t)},ke.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},ke.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=ve(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},ke.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const i=this.relation();if(e.array){const s=Se(e.array,i);"after row"===t||"before row"===t?(s.col=0,s.row=s.row+("after row"===t?1:0),e.array.splice(s.row,0,[[]])):(s.col+="after column"===t?1:0,e.array[s.row].splice(s.col,0,[]));const a=we(e.array,s);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},ke.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",i=wt.getEnvironmentInfo(e),s=[[t.body]];i.parser&&Object.assign(t,i.parser(e,[],s)),t.tabularMode=i.tabular,t.parseMode=this.anchorMode(),t.env={...i},t.env.name=e,t.array=s,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},ke.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},ke.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},ke.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},ke.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},ke.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function i(t,i){let s=!0;return e.forEachSelected(e=>{s=s&&e[t]===i},{recursive:!0}),s}t.color&&i("color",t.color)&&(t.color="none"),t.backgroundColor&&i("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&i("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&i("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&i("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&i("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Pe={EditableMathlist:ke,parseMathString:De};const Be={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Oe={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Re={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Ke(t){let e,i=!0;"Unidentified"===t.key&&t.target&&(e=Re[t.target.value]||t.target.value),e||(Be[t.key]?(e=Be[t.key],i=!1):e=Oe[t.key],e||(e=Re[t.key.toLowerCase()])),!e&&t.code&&(e=Oe[t.code]||t.code);const s=[];return t.ctrlKey&&s.push("Ctrl"),t.metaKey&&s.push("Meta"),i&&t.altKey&&s.push("Alt"),i&&t.shiftKey&&s.push("Shift"),0===s.length?e:(s.push(e),s.join("-"))}function Ne(t,e){let i,s=null,a=null,o=!1,n=!1;function r(t){clearTimeout(i),i=setTimeout((function(){clearTimeout(i),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const i=t.value;t.value="",i.length>0&&e.typedText(i)}const c=t||e.container;c.addEventListener("keydown",(function(i){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==i.key&&"Unidentified"!==i.key&&229!==i.keyCode)n=!1;else{n=!0,o=!1;const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s}return!(!o&&"CapsLock"!==i.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code))||(s=i,a=null,e.keystroke(Ke(i),i))}),!0),c.addEventListener("keypress",(function(t){o||(s&&a&&e.keystroke(Ke(s),s),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!s||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const i=t.value;t.value="",i.length>0&&e.paste(i)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){s=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const i=e.blur,s=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=i,e.focus=s,n=!1,o=!1,r(l)}else o||r(l)})}var $e={delegateKeyboardEvents:Ne,select:Ne.select,keyboardEventToString:Ke,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const We={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},He={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function Ve(t){let e=He[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ue(t,e){t.popover.innerHTML=e;const i=t._getCaretPosition();i&&je(t,i),t.popover.classList.add("is-visible")}function je(t,e){const i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>s-a?t.popover.style.left=s-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>i-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Ge(t){t.popover.classList.remove("is-visible")}var Ze={getNote:Ve,SAMPLES:We,NOTES:He,showPopoverWithLatex:function(t,e,i){if(!e||0===e.length)return void Ge(t);const s=e,a=function(t,e){const i=le.parseTokens(n(t),"math",null,e.config.macros),s=Yt.decompose({mathstyle:"displaystyle",macros:e.config.macros},i),a=$.makeSpan(s,"ML__base"),o=$.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=$.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),$.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(We[s]||e,t),o=Ve(s),r=xe.forCommand(s);let l=i?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=i?'
    ':"",Ue(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ue,hidePopover:Ge,updatePopoverPosition:function t(e,i){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(i&&i.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&je(e,t)}else Ge(e)}};function Xe(t,e,i){let s="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";s=function t(e,i,s,a){if(0===s.length)return"";if(0===i.length)return s.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=i[0];let c=s[0][l];"fontFamily"===l&&(c=s[0].fontFamily||s[0].baseFontFamily);const h=function(t,e,i){let s=0;if("fontFamily"===e)for(;t[s]&&("mop"===t[s].type||(t[s].fontFamily||t[s].baseFontFamily)===i);)s++;else for(;t[s]&&("mop"===t[s].type||t[s][e]===i);)s++;return s}(s,l,c);if("text"===s[0].mode){if("fontShape"===l&&s[0].fontShape)"it"===s[0].fontShape?(n="\\textit{",r="}"):"sl"===s[0].fontShape?(n="\\textsl{",r="}"):"sc"===s[0].fontShape?(n="\\textsc{",r="}"):"n"===s[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+s[0].fontShape+"}",r="}");else if("fontSeries"===l&&s[0].fontSeries)"b"===s[0].fontSeries?(n="\\textbf{",r="}"):"l"===s[0].fontSeries?(n="\\textlf{",r="}"):"m"===s[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+s[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(i+=" & "),i+=Xe(this,this.array[s][e],t);s1&&(i+=" "),i+=Xe(this,this.body,t),i+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?i+="("+Xe(this,this.body,t)+")":(i+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(i+=" "),i+=Xe(this,this.body,t),i+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(i+=" "));break;case"delim":case"sizeddelim":i+=n+"{"+this.delim+"}";break;case"rule":i+=n,this.shift&&(i+=`[${Xe(this,this.shift,t)}em]`),i+=`{${Xe(this,this.width,t)}em}{${Xe(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":i+=`${n}{${Xe(this,this.body,t)}}`;break;case"overunder":i+=`${n}{${Xe(this,this.overscript||this.underscript,t)}}{${Xe(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?i+=n+"{"+Xe(this,this.body,t)+"}":'\\char"'===n?i+=this.latex+" ":"\\unicode"===n?(i+='\\unicode{"',i+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),i+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?i+=n+"{"+Xe(this,this.body,t)+"}":"\\operatorname"===n?i+=n+"{"+Xe(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(i+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(i+=" ")):i+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(i+="\\limits "),"nolimits"===this.limits&&(i+="\\nolimits "));break;case"box":if("\\bbox"===n){if(i+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(ie(this.backgroundcolor)),i+=`[${t.join(",")}]`}i+=`{${Xe(this,this.body,t)}}`}else"\\boxed"===n?i+=`\\boxed{${Xe(this,this.body,t)}}`:(i+=n,this.framecolor&&(i+=`{${ie(this.framecolor)}}`),this.backgroundcolor&&(i+=`{${ie(this.backgroundcolor)}}`),i+=`{${Xe(this,this.body,t)}}`);break;case"spacing":i+=n,"\\hspace"===n||"\\hspace*"===n?(i+="{",this.width?i+=this.width+"em":i+="0em",i+="}"):(i+=" ",this.width&&(i+=this.width+"em "));break;case"enclose":if(i+=n,"\\enclose"===n){i+="{";let t="";for(const e in this.notation)Object.prototype.hasOwnProperty.call(this.notation,e)&&this.notation[e]&&(i+=t+e,t=" ");i+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+ie(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+ie(this.strokeColor)+'"',t=","),e&&(i+=`[${e}]`)}i+=`{${Xe(this,this.body,t)}}`;break;case"mathstyle":i+="\\"+this.mathstyle+" ";break;case"space":i+=this.latex;break;case"placeholder":i+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":i+=this.latex}if(this.superscript){let e=Xe(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),i+="^"+e):i+="^{"+e+"}"}if(this.subscript){const e=Xe(this,this.subscript,t);1===e.length?i+="_"+e:i+="_{"+e+"}"}return i},Je.plural=function(t,e,i){(i=i||{}).type=i.type||"cardinal";const s=Je.locale.substring(0,2),a="ordinal"===i.type?Je.ordinal:Je.cardinal;let o,n="ordinal"===i.type?Je._ordinalPluralCategories.indexOf(a.select(t)):Je._cardinalPluralCategories.indexOf(a.select(t));return Je.strings[Je.locale]&&(o=Je.strings[Je.locale][e]),!o&&Je.strings[s]&&(o=Je.strings[s][e]),o||(o=Je.strings.en[e],o||(o=e),n="ordinal"===i.type?Je._ordinalPluralCategories.indexOf(Je._ordinalEnglish.select(t)):Je._cardinalPluralCategories.indexOf(Je._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Je.merge=function(t,e){if(t&&e){const i=Je._locale;Je.locale=t,Je.strings[t]={...Je.strings[t],...e},Je.locale=i}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Je.merge(t,e[t])))},Object.defineProperty(Je,"locale",{set(t){Je._locale=t,Je._ordinal=null,Je._cardinal=null},get:()=>(Je._locale||(Je._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Je._locale)}),Object.defineProperty(Je,"ordinal",{get:()=>(Je._ordinal||(Je._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Je._ordinalEnglishPluralCategories=Je._ordinalEnglish.resolvedOptions().pluralCategories,Je._ordinal=new Intl.PluralRules(Je.locale,{type:"ordinal"}),Je._ordinalPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._ordinal)}),Object.defineProperty(Je,"cardinal",{get:()=>(Je._cardinal||(Je._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Je._cardinalEnglishPluralCategories=Je._cardinalEnglish.resolvedOptions().pluralCategories,Je._cardinal=new Intl.PluralRules(Je.locale,{type:"cardinal"}),Je._cardinaPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._cardinal)}),Je.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const Ye={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},Qe={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ti={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let ei={};const ii={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function si(t,e,i){t=t.replace(/(^|[^\\])#@/g,"$1#?");const s=le.parseTokens(n(t),"math",e,i.config.macros),a=Yt.decompose({mathstyle:"displaystyle",macros:i.config.macros},s),o=$.makeSpan(a,"ML__base"),r=$.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=$.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),$.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function ai(t,e,i){let s="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},Ye,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;s+="
    "+e[t].label+"
    "}}return s+="
    ",s+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function oi(t,e,i){for(let s=0;s"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&Qe[n]&&(a.setAttribute("data-shifted",Qe[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",Qe[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],i&&(o=[i,o]),a.getAttribute("data-alt-keys")){const t=ei[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function ni(t,e){const i={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},s=i[t.config.virtualKeyboardLayout]?i[t.config.virtualKeyboardLayout]:i.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const i of t){const t=i.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=s[e.name];if(r||(r=i.qwerty[e.name]),r)for(const t of r){let i=e.class||"";i&&(i=" "+i),"~"===t?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===t?a+="
  • ":"^"===t?a+="
  • ":"/"===t?a+="
  • ÷
  • ":"*"===t?a+="
  • ×
  • ":"-"===t?a+="
  • ":/tt/.test(i)?a+="
  • '+t+"
  • ":a+="
  • "+t+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var ri={make:function(t,e){let i='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ti["foreground-color"]=[];for(const t of ae)ti["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+t+'"}]'});ti["background-color"]=[];for(const t of se)ti["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+t+'"}]'});ei={...ti},Object.keys(ei).forEach(t=>{ei[t]=ei[t].slice()});const s="abcdefghijklmnopqrstuvwxyz";for(let t=0;t<26;t++){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t];ei[e]||(ei[e]=[]),ei[e].unshift({latex:"\\mathbb{"+e+"}",aside:"blackboard",insert:"\\mathbb{"+e+"}"}),ei[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),ei[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),ei[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),ei[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),ei[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"}),ei[e].unshift({latex:"\\mathbb{"+s[t]+"}",aside:"blackboard",insert:"\\mathbb{"+s[t]+"}"}),ei[e].unshift({latex:"\\mathbf{"+s[t]+"}",aside:"bold",insert:"\\mathbf{"+s[t]+"}"}),ei[e].unshift({latex:"\\mathsf{"+s[t]+"}",aside:"sans",insert:"\\mathsf{"+s[t]+"}"}),ei[e].unshift({latex:"\\mathcal{"+s[t]+"}",aside:"script",insert:"\\mathcal{"+s[t]+"}"}),ei[e].unshift({latex:"\\mathfrak{"+s[t]+"}",aside:"fraktur",insert:"\\mathfrak{"+s[t]+"}"})}for(let t=0;t<=26;t++){const e=s[t];ei[e]||(ei[e]=[]),ei[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathbb{"+e+"}"}),ei[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),ei[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),ei[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}for(let t=0;t<10;t++){const e="0123456789"[t];ei[e]||(ei[e]=[]),ei[e].unshift({latex:"\\mathbf{"+e+"}",aside:"bold",insert:"\\mathbf{"+e+"}"}),ei[e].unshift({latex:"\\mathsf{"+e+"}",aside:"sans",insert:"\\mathsf{"+e+"}"}),ei[e].unshift({latex:"\\mathtt{"+e+"}",aside:"monospace",insert:"\\mathtt{"+e+"}"}),ei[e].unshift({latex:"\\mathcal{"+e+"}",aside:"script",insert:"\\mathcal{"+e+"}"}),ei[e].unshift({latex:"\\mathfrak{"+e+"}",aside:"fraktur",insert:"\\mathfrak{"+e+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ii,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},Ye,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const e of r){if(!n[e])break;let s=n[e].layers||[];n[e].layer&&s.push(n[e].layer),s=Array.from(new Set(s));for(const n of s){if(!o[n])break;if("object"==typeof o[n]){let t="";if(o[n].styles&&(t+=``),o[n].backdrop&&(t+=`
    `),o[n].container&&(t+=`
    `),o[n].rows){t+="
    ";for(const e of o[n].rows){t+="
      ";for(const i of e)t+="${i.label?i.label:""}`;t+="
    "}t+="
    ",o[n].container&&(t+=""),o[n].backdrop&&(t+="")}o[n]=t}i+="
    ",i+=ai(t,a,e);const s="function"==typeof o[n]?o[n]():o[n];i+=ni(t,s),i+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=i,oi(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let e=0;e{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:oi};const li={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},ci={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},hi={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function di(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function pi(t,e){return t&&e.generateID?' extid="'+t+'"':""}function mi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(s=!0,ui(t)&&(n=t.index,t.index+=1),fi(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=vi(t.atoms[r].subscript,0,0,i).mathML,a+=vi(t.atoms[n].superscript,0,0,i).mathML,a+="";else if(n>=0){if(a=""+o,ui(t)){const e=vi(t.atoms[n].superscript,0,0,i).mathML,s=vi(t.atoms[n+1].superscript,0,0,i).mathML;a+=""!==e&&""!==e||""!==s&&""!==s?""===e||""===e?"":e:""}else a+=vi(t.atoms[n].superscript,0,0,i).mathML;a+=""}else r>=0?(a=""+o,a+=vi(t.atoms[r].subscript,0,0,i).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return s}function ui(t){return t.index"+t,a+=vi(o.subscript,0,0,i).mathML,a+=vi(o.superscript,0,0,i).mathML,a+=""):o.superscript?(a=""+t,a+=vi(o.superscript,0,0,i).mathML,a+=""):o.subscript&&(a=""+t,a+=vi(o.subscript,0,0,i).mathML,a+=""),a.length>0&&(s=!0,e.mathML+=a,e.lastType=""),s))}function yi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(s=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),s}function bi(t,e,i){let s=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,i=t.index,s=!1,a=!1;for(;i=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(s=!0,o=""+o+"",n<0&&ui(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=vi(t.atoms[n].superscript,0,0,i).mathML,o+=""),t.mathML+=o,t.lastType="mn"),s}function xi(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=wi(t.atoms[l],i),a+=vi(t.atoms,l+1,c,i).mathML,a+=wi(t.atoms[c],i),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,gi(a,t,i)&&(s=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function ki(t,e,i){let s=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=vi(n.subscript,0,0,i).mathML,a+=vi(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=vi(n.superscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=vi(n.subscript,0,0,i).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Si(e.body)+"":wi(e,i);a+=r,t.index+=1,gi(a,t,i)&&(s=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(s=!0,t.mathML+=a,t.lastType=o),s}function vi(t,e,i,s){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(i=i||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(s);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function wi(t,e){let i="";const s=Si(t.body);return s&&(i=""+s+""),i}function Si(t){if(!t)return"";if("string"==typeof t)return di(t);if(!Array.isArray(t)&&"string"==typeof t.body)return di(t.body);let e="";for(const i of t)"string"==typeof i.body&&(e+=i.body);return di(e)}Yt.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},i={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let s,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=vi(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(hi[this.lFence]||this.lFence)+"")),c+="",s=0;s"+vi(this.array[a][s],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(hi[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hi[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=vi(this.numer,0,0,t).mathML||" ",c+=vi(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+vi(this.numer,0,0,t).mathML+"",c+=""+vi(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hi[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=vi(this.body,0,0,t).mathML,c+=vi(this.index,0,0,t).mathML,c+=""):(c+="",c+=vi(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hi[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=vi(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hi[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(hi[this.delim]||this.delim)+"";break;case"accent":c+='",c+=vi(this.body,0,0,t).mathML,c+=""+(hi[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+vi(l,0,0,t).mathML,c+=vi(n,0,0,t).mathML,c+=vi(r,0,0,t).mathML,c+=""):r?(c+=""+vi(l,0,0,t).mathML,c+=vi(r,0,0,t).mathML,c+=""):n&&(c+=""+vi(l,0,0,t).mathML,c+=vi(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const i=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;i?c="&#x"+i[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const s=/\d/.test(c)?"mn":"mi";c="<"+s+d+pi(this.id,t)+">"+di(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&hi[p]?""+hi[p]+"":wi(this,t);break;case"mpunct":c='"+(hi[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+vi(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+vi(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},Yt.toMathML=function(t,e){return vi(t,0,0,e).mathML};const Ai={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},Mi={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Ci={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},_i={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Ti(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Li(t){return t&&_i[t]||-1}function Fi(t){return/=|=>/.test(t)?"right":"left"}function Di(t){if("f"===t||"g"===t)return!0;const e=Ci[t];return!!e&&!!/%[^01_^]?/.test(e)}function zi(t){t=(t||"").trim();let e=Ai[t];if(!e)if(/^\\[^{}]+$/.test(t)){const i=wt.getInfo(t,"math",{});e=i&&i.value||t.slice(1)}else e=t;return e}function Ei(t){if(!t)return null;const e=zi(Ri(t)),i=[Li(e),Fi(e)];return i[0]<=0?null:i}function qi(t){return null!==Ei(t)}const Ii={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Pi={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Bi={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Oi={",":"list",";":"list2"};function Ri(t){if(Array.isArray(t)){let e="";for(const i of t)e+=Ri(i);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const i of t.body)e+=Ri(i);return e}return""}function Ki(t){return"string"==typeof t.sym?function(t){let e=Ci[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const i=wt.getInfo("\\"+t,"math");!i||i.fontFamily&&"cmr"!==i.fontFamily&&"ams"!==i.fontFamily||(e="\\"+t)}return e||(e=wt.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Ni(t){return parseFloat(t.num)}function $i(t){return"object"==typeof t&&void 0!==t.num}function Wi(t){let e=0;return $i(t)&&(e="object"==typeof t.num?void 0!==t.num.re?ls(t.num.re):0:parseFloat(t.num)),e}function Hi(t){let e=0;return $i(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?ls(t.num.im):0),e}function Vi(t){return t&&void 0!==t.sup}function Ui(t){return t&&void 0!==t.sub}function ji(t,e,i){let s=!1;const a=t.atoms[t.index];return a&&a.type===e&&(s=void 0===i||Ri(a)===i),s}function Gi(t,...e){const i={fn:t};if(e){const t=[];for(const i of e)i&&t.push(i);t.length>0&&(i.arg=t)}return i}function Zi(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Xi(t){if($i(t)){const e=Wi(t),i=Hi(t);return 0!==i?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-i).toString()):t.num=(-e).toString(),t}return Gi("negate",t)}function Ji(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function Yi(t,e){let i=t.atoms[t.index];return!i||void 0===i.superscript&&void 0===i.subscript?i=null:t.index+=1,i||(i=t.atoms[t.index+1],i&&"msubsup"===i.type&&(i.superscript||i.subscript)?t.index+=2:i=null),i?(void 0!==i.subscript&&(t.ast.sub=os(i.subscript,e)),void 0!==i.superscript&&("msubsup"===i.type?/['\u2032]|\\prime/.test(Ri(i.superscript))?(t.index+=1,i=t.atoms[t.index+1],i&&"msubsup"===i.type&&/['\u2032]|\\prime/.test(Ri(i.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test(Ri(i.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=os(i.superscript,e)):t.ast.sup=os(i.superscript,e))):t.index+=1,t}function Qi(t,e){const i=t.ast;if(es(t,"!!"))return t.index+=1,t.ast=Gi("factorial2",i),Qi(t=Yi(t,e),e);if(es(t,"++"))return t.index+=1,t.ast=Gi("increment",i),Qi(t=Yi(t,e),e);if(es(t,"--"))return t.index+=1,t.ast=Gi("decrement",i),Qi(t=Yi(t,e),e);const s=t.atoms[t.index];return s&&s.latex&&Pi[s.latex.trim()]&&(t.ast=Gi(Pi[s.latex.trim()],i),t=Qi(t=Yi(t,e),e)),t}function ts(t,e,i,s){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&Ri(o)===e)t.index+=1,o=(t=ss(t,s)).atoms[t.index],o&&"mclose"===o.type&&Ri(o)===i&&(Ji(t)&&(t.ast={group:t.ast}),t=Qi(t=Yi(t,s),s));else if("textord"===o.type&&Ri(o)===e)t.index+=1,o=(t=ss(t,s)).atoms[t.index],o&&"textord"===o.type&&Ri(o)===i&&(t.index+=1,t=Qi(t=Yi(t,s),s));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=ss(t,s)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=Qi(t=Yi(t,s),s))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=ss(t,s)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===i&&(t.index+=1,t=Qi(t=Yi(t,s),s));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==i)return;t.ast=os(o.body,s),Ji(t)&&(t.ast={group:t.ast}),t=Qi(t=Yi(t,s),s)}return t.minPrec=a,t}{let s=!0;if("mopen"===o.type?(e=o.latex.trim(),i=wt.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,i=wt.RIGHT_DELIM[e]):"leftright"===o.type?(s=!1,e=o.leftDelim,"?"===(i=o.rightDelim)&&(i=wt.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),i=wt.RIGHT_DELIM[e]),e&&i){if("|"===e&&"|"===i){const s=t.atoms[t.index+1];s&&"textord"===s.type&&"|"===s.latex&&(e="\\lVert",i="\\rVert")}if(t=ts(t,e,i))return s&&(t.index+=1),t.ast={fn:Ii[e+i]||e+i,arg:[t.ast]},t.minPrec=a,t}}}function es(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===Ri(t.atoms[t.index])+Ri(t.atoms[t.index+1])}function is(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!ji(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,i=/^(>=|<=|>>|<<|:=|!=|\*\*|\+\+|--)$/.test(e)?e:"";return i&&(t.index+=1),i}return t.index+=1,ji(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):ji(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function ss(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let i=function t(e,i){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let s=e.atoms[e.index];if("text"===s.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=zi(Ri(s));if(is(e))e.ast=Gi(e.ast,t(e,i).ast);else{if("root"===s.type)return e.index=0,e.atoms=s.body,t(e,i);if("mbin"===s.type&&"-"===a)e.index+=1,(e=t(e,i)).ast=Xi(e.ast);else if("mbin"===s.type&&"+"===a)e.index+=1,(e=t(e,i)).ast=Gi("add",e.ast);else if("mord"===s.type&&/^[0-9.]$/.test(s.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>as(t)))),e=[t])}return e}function os(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const i=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;i.push(e)}else{const s=ss(t,e).ast;if(!s)return;i.push(s)}return i.length>1?Gi("text",...i):i[0]||void 0}({atoms:as(t)},e)}function ns(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let i="";if(e.length>0){"."!==t[0]&&(i+=t[0]);let s="";for(const a of e)i+=s+a,s=t[2];"."!==t[1]&&(i+=t[1])}return i}function rs(t,e){const i=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return i!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function ls(t){return parseFloat(parseFloat(t).toPrecision(15))}function cs(t,e){let i="";if("number"==typeof e.precision){if("number"!=typeof t){let i="",s="";if("-"===t[0]?(i="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(s=a[4]||"","0"===o){let s=0;for(;"0"===n[s]&&s=e.precision)a="0",i="";else{a=t[s];const i=rs(t.substr(s+1),e);i&&(a+=e.decimalMarker+i)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),s>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-s).toString():a+="10^{"+(1-s).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const i=rs(n,e);i&&(t+=e.decimalMarker+i)}}else if(t.length>e.precision){const i=t.length;let s=t[0];const a=rs(t.substr(2),e);a&&(s+=e.decimalMarker+a,"}"!==s[s.length-1]&&(s+="\\ldots")),"1"!==s?s+=e.exponentProduct:s="",e.exponentMarker?s+=e.exponentMarker+(i-2).toString():s+="10^{"+(i-2).toString()+"}",t=s}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return s&&(s=e.exponentMarker?e.exponentMarker+s:e.exponentProduct+" 10^{"+s+"}"),i+t+s}t=ls(t)}if("engineering"===e.scientificNotation)if(0===t)i="0";else{const s=Math.abs(t);let a=Math.round(Math.log10(s));a-=a%3,s<1e3&&(a=0);let o=s/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=rs(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",i=(t<0?"-":"")+o+a}else{const s="string"==typeof t?t:t.toString();let a,o,n,r=s.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=s,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=rs(n,e)),n&&(n=e.decimalMarker+n),i=a+n+(o||"")}return i}Yt.MathAtom.prototype.toAST=function(t){let e,i,s,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(i=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),i=le.parseTokens(n(i),"math",null,t.macros),s=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),s=le.parseTokens(n(s),"math",null,t.macros),o=Gi("divide",os(i,t),os(s,t))):o.fn="divide"):o.group=os(this.body,t);break;case"genfrac":o=Gi("divide",os(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Zi(1):os(this.denom,t));break;case"surd":o=this.index?Gi("pow",os(this.body,t),Gi("divide",1,os(this.index,t))):Gi("sqrt",os(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=zi(Ri(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=wt.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=os(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Gi("card",os(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>os(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const i=[];i.push(os(e[0],t));let s=os(e[1],t);s&&"text"===s.fn&&s.arg&&/^(if|when|for)$/i.test(s.arg[0].trim())&&(s=s.arg.filter(t=>"string"!=typeof t)),i.push(s||{}),o.args.push(i)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},Yt.toAST=function(t,e){return os(t,e)};var hs=function t(e,i){const s=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},i);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if($i(e)){const i=Ni(e);if(i===-1/0)a="-\\infty ";else if(i===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(i)?"\\text{NaN}":cs(e.num,s);else{const t=Wi(e),i=Hi(e);isNaN(t)||isNaN(i)?a="\\text{NaN}":Math.abs(i)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=cs(t,s)),Math.abs(i)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=i>0?"+":""),a+=(1!==Math.abs(i)?cs(i,s):"")+"\\imaginaryI "))}Vi(e)&&(a+="^{"+t(e.sup,s)+"}"),Ui(e)&&(a+="_{"+t(e.sub,s)+"}")}else if(e.group)a=t(e.group,s),$i(e.group)||Ki(e.group)?0!==Hi(e.group)&&(a=ns(e.fence||"(),",a)):a=ns(e.fence||"(),",a),Vi(e)&&(a+="^{"+t(e.sup,s)+"}"),Ui(e)&&(a+="_{"+t(e.sub,s)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Ti(e,0),s)+"|_{",e.arg&&2===e.arg.length)a+=t(Ti(e,1));else{let i="";for(let s=1;s=2)a=t(Ti(e,0),s),$i(Ti(e,0))||Ki(Ti(e,0))||(a=ns(e.fence||"(),",a)),a+="^{"+t(Ti(e,1),s)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,s)).join(" = ");else{const i=function(t){let e=Ci[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=i;let o="";if(/%(?![01_^])/.test(i)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ns(e.fence||"(),",...e.arg.map(e=>t(e,s)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Ti(e,0),s),r=t(Ti(e,1),s),l=[...e.arg];/%0/.test(i)&&(a=a.replace("%0",n),l.shift()),/%1/.test(i)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ns(e.fence||"(),",...l.map(e=>t(e,s))))}else o=ns(e.fence||"(),","");a=Vi(e)?a.replace("%^","^{"+t(e.sup,s)+"}"):a.replace("%^",""),a=Ui(e)?a.replace("%_","_{"+t(e.sub,s)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const i=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?i.push(ns("() ",t(a,s))):0!==Wi(o=a)&&0!==Hi(o)?i.push(ns("() ",t(a,s))):Vi(e)&&0!==Hi(a)&&1!==Hi(a)?i.push(ns("() ",t(a,s))):i.push(t(a,s));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!$i(e.arg[0])&&"divide"!==e.arg[0].fn||$i(e.arg[1])&&(0!==Wi(e.arg[1])||1!==Hi(e.arg[1]))?i.join(" \\times "):i[0]+i[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||$i(e.arg[0])&&Ni(e.arg[0])<0?i[0]:"+"+i[0];else{a=i[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function ps(t){let e=0;if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&(e+=1);return 1===e}function ms(t){let e="";if(t&&Array.isArray(t))for(const i of t)"first"!==i.type&&"string"==typeof i.body&&(e+=i.body);return e}function us(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],i,a)}else t.addEventListener(a,i,s)}}function fs(t,e,i,s){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=s||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],i,a)}else t.removeEventListener(a,i,s)}}function gs(t,e){let i=document.getElementById(t);return i?i.setAttribute("data-refcount",parseInt(i.getAttribute("data-refcount"))+1):(i=document.createElement("div"),i.setAttribute("aria-hidden","true"),i.setAttribute("data-refcount","1"),i.className=e,i.id=t,document.body.appendChild(i)),i}function ys(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function bs(t){return t.element&&t.element.mathfield===t}Yt.toSpeakableFragment=function(t,e){function i(t){return""+t+""}if(!t)return"";let s="";if(t.id&&"math"===e.speechMode&&(s+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=Yt.toSpeakableFragment(t.body,e),t.index){let i=Yt.toSpeakableFragment(t.index,e);i=i.trim();const a=i.replace(//g,"");s+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+i+', of '+n+'. End root'}else ps(t.body)?s+=" the square root of "+n+" , ":s+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":s+=ds[t.leftDelim]||t.leftDelim,s+=Yt.toSpeakableFragment(t.body,e),s+=ds[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":s+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const i=t.latex?t.latex.trim():"";if("\\mathbin"===i||"\\mathrel"===i||"\\mathopen"===i||"\\mathclose"===i||"\\mathpunct"===i||"\\mathord"===i||"\\mathinner"===i){s=Yt.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)s+=a;else{if("mbin"===t.type&&(s+=''),a){const t=ds[a]||(o?ds[o.trim()]:"");if(t)s+=" "+t;else{const t=o?function(t){let e=Ze.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";s+=t||function(t){let i="";return e.textToSpeechMarkup?/[a-z]/.test(t)?i+=' '+t+"":/[A-Z]/.test(t)?i+="capital "+t.toLowerCase():i+=t:/[a-z]/.test(t)?i+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?i+=" 'capital "+t.toUpperCase()+"'":i+=t,i}(a)}}else s+=Yt.toSpeakableFragment(t.body,e);"mbin"===t.type&&(s+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let i=Yt.toSpeakableFragment(t.superscript,e);i=i.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the summation from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=Yt.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the summation from '+i+' of ',r=!0}else s+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let i=Yt.toSpeakableFragment(t.superscript,e);i=i.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),s+=' the product from '+a+' to '+i+' of ',r=!0}else if(t.subscript){let i=Yt.toSpeakableFragment(t.subscript,e);i=i.trim(),s+=' the product from '+i+' of ',r=!0}else s+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=Yt.toSpeakableFragment(t.superscript,e);a=a.trim();let o=Yt.toSpeakableFragment(t.subscript,e);o=o.trim(),s+=' the integral from '+i(o)+' to '+i(a)+' of ',r=!0}else s+=' the integral of ';else if("string"==typeof t.body){s+=ds[t.body]||ds[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?s+=" "+t.latex.substr(1):s+=" "+t.latex)}break;case"enclose":n=Yt.toSpeakableFragment(t.body,e),ps(t.body)?s+=" crossed out "+n+" , ":s+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let i=Yt.toSpeakableFragment(t.superscript,e);i=i.trim();const a=i.replace(/<[^>]*>/g,"");if(ps(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(s+='')}"′"===a?s+=" prime ":"2"===a?s+=" squared ":"3"===a?s+=" cubed ":isNaN(parseInt(a))?s+=" to the "+i+"; ":s+=' to the '+a+" power; "}else isNaN(parseInt(a))?s+=" raised to the "+i+"; ":s+=' raised to the '+a+" power; "}if(!r&&t.subscript){let i=Yt.toSpeakableFragment(t.subscript,e);i=i.trim(),ps(t.subscript)?s+=" sub "+i:s+=" subscript "+i+". End subscript. "}}return s},Yt.toSpeakableText=function(t,e){const i=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(i.speechMode="math",window.sre&&"sre"===i.textToSpeechRules){i.generateID=!0;const e=Yt.toMathML(t,i);return e?(i.textToSpeechMarkup&&(i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup=i.textToSpeechMarkup,"ssml"===i.textToSpeechRulesOptions.markup&&(i.textToSpeechRulesOptions.markup="ssml_step"),i.textToSpeechRulesOptions.rate=i.speechEngineRate),i.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(i.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let s=Yt.toSpeakableFragment(t,i);if("ssml"===i.textToSpeechMarkup){let t="";i.speechEngineRate&&(t=''),s=''+t+"

    "+s+"

    "+(t?"
    ":"")+""}else s="mac"===i.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?s.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):s.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return s};class xs{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let i=this.element.textContent;i&&(i=i.trim());let s="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?s+=this.config.substituteTextArea:s+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?s+="\n \n \n ":s+='',s+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(s+=`"):s+="",s+="",s+='\n
    \n \n \n
    \n ',this.element.innerHTML=s;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=gs("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=gs("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,us(this.element,"focus",this),us(this.element,"blur",this),us(this.textarea,"cut",this),us(this.textarea,"copy",this),us(this.textarea,"paste",this),$e.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?us(this.field,"pointerdown",this):us(this.field,"touchstart:active mousedown",this),us(window,"resize",this);const o={...e};o.onSelectionDidChange=xs.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=xs.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Pe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const i=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=i}}(this.mathlist),i.length>0&&this.$latex(i),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>bs(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,fs(this.textarea,"cut",this),fs(this.textarea,"copy",this),fs(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,ys(this.popover),ys(this.keystrokeCaption),ys(this.virtualKeyboard),ys(document.getElementById("mathlive-alternate-keys-panel")),fs(this.element,"pointerdown",this),fs(this.element,"touchstart:active mousedown",this),fs(this.element,"focus",this),fs(this.element,"blur",this),fs(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let i;return Array.from(e.children).forEach((function(e){i=i||t(e)})),i}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const i=t.getBoundingClientRect();i.lefte.right&&(e.right=i.right),i.bottom>e.bottom&&(e.bottom=i.bottom),i.top=t.left&&i<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,i,s);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(s=de.pathFromString(e[0]).path,0===i.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const s=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=s=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){if(this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1,i=this._pathFromPoint(d,p,{bias:0}),i){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,i),i=de.clone(this.mathlist.path),i[i.length-1].offset-=1):this.mathlist.setPath(i,0),o=!0,this.style={},3===t.detail||vs>2?(n(t),3!==t.detail&&3!==vs||this.mathlist.selectAll_()):s||(s=!0,window.PointerEvent?(us(e.field,"pointermove",h),us(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(us(window,"blur",n),t.touches?(us(t.target,"touchmove",h),us(t.target,"touchend",n)):(us(window,"mousemove",h),us(window,"mouseup",n))),2!==t.detail&&2!==vs||(a=!0,this.mathlist.selectGroup_()))}}else ks=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Ze.hidePopover(this),this.mathlist.removeCommandString())}Ze.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this),this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const i=t?t.path:[],s=this.mathlist.path,a=s[s.length-1];let o="";for(;i.length>s.length;)o+="out of "+e(t.parent(),i[i.length-1])+"; ",i.pop();if(!this.mathlist.isCollapsed())return ws(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=ws(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,i){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,i)}_onFocus(){this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Ze.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Ze.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const i=this.element.getBoundingClientRect();e.style.left=i.left+"px",e.style.top=i.top-64+"px",e.innerHTML=""+(xe.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,i=!1,s=[],a=!1;if(Array.isArray(t)?(e=t[0],s=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...s),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);0===e.length?Ze.hidePopover(this):Ze.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,i=!0}else"function"==typeof this[e]&&(a=this[e](...s),i=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),i}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let i=0,s=!1;for(this.mathlist.contentWillChange();!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),s||(a.applyStyle({mode:"text"}),a.latex=a.body),i-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let i=0,s=!1;for(;!s;){const a=this.mathlist.sibling(i);s=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),s||a.applyStyle({mode:"math",type:"mord"}),i-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,i=!1;for(;!i;){const s=this.mathlist.sibling(e);i=!(s&&("text"===s.mode&&!s.type||"math"===s.mode&&/mord|textord|mpunct/.test(s.type))),i||(t=s.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(i));const s=this.getTextBeforeAnchor_()+i;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(i))return!0;if(/[\^_]/.test(i))return/(^|\s)[a-zA-Z][^_]$/.test(s)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[i];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(s))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(i))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(s))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(s)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(s))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(s))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(i))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(s)&&!/(dxd|abc|xyz|uvw)$/.test(s))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(s))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(s)&&!/(αβγ)$/.test(s))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(i))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let i,s,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=$e.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!i&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const s=this.mode;i?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==s&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(i||a||(a=xe.selectorForKeystroke(this.mode,t)),!i&&!a)return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!i){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||i)&&i){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(i)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert($e.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const i=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[s],{...this.config,suppressChangeNotifications:!0}),this.mode=i}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(i,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),i.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),i=$e.charToEvent(e);if(!this.$keystroke($e.keyboardEventToString(i),i))return}let i="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=s(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),s=wt.suggest(e+t);a=s.length>1,0===s.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Ze.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),s[0].match!==e+t&&this.mathlist.insertSuggestion(s[0].match,-s[0].match.length+e.length+1),i=s[0].match)}else if("math"===this.mode){const i={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(i){if("moveToSuperscript"===i){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===i&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(i)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Ze.showPopoverWithLatex(this,i,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let i=0;ibs(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1});const e=this.$hasFocus();this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0});const i=Yt.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),s=$.makeSpan(i,"ML__base");s.attributes={translate:"no","aria-hidden":"true"};const a=$.makeSpan("","ML__strut");a.setStyle("height",s.height,"em");const o=[a];if(0!==s.depth){const t=$.makeSpan("","ML__strut--bottom");t.setStyle("height",s.height+s.depth,"em"),t.setStyle("vertical-align",-s.depth,"em"),o.push(t)}o.push(s);const n=$.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e),this.accessibleNode.innerHTML=""+Yt.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let i="";if("latex"===(e=e||"latex")||"latex-expanded"===e)i=t.toLatex("latex-expanded"===e);else if("mathML"===e)i=t.toMathML(this.config);else if("spoken"===e)i=Yt.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",i=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const s=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),i=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=s,this.config.generateID=a}else if("json"===e){const e=Yt.toAST(t,this.config);i=JSON.stringify(e)}else"ASCIIMath"===e&&(i=function t(e,i){if(!e)return"";if(Array.isArray(e)){let i="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let s=0;for(i='"';e[s]&&"text"===e[s].mode;)i+=e[s].body,s++;i+='"'+t(e.slice(s))}else{let s=0;for(;e[s]&&"math"===e[s].mode;)i+=t(e[s]),s++;i+=t(e.slice(s))}return i.trim()}if("text"===e.mode)return'"'+e.body+'"';let s="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":s=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(s+="(",s+=t(e.numer),s+=")/(",s+=t(e.denom),s+=")"):(s+="("+t(e.numer)+"),",s+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?s+="root("+t(e.index)+")("+t(e.body)+")":s+="sqrt("+t(e.body)+")";break;case"leftright":s+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",s+=t(e.body),s+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":s=li[a]||a||("string"==typeof e.body?e.body:""),"\\"===s[0]&&(s+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?s=String.fromCharCode(parseInt("0x"+o[1])):s.length>0&&"\\"===s.charAt(0)&&(s="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":s=a&&li[a]?li[a]:a&&ci[a]?ci[a]:e.body;break;case"mopen":case"mclose":s+=e.body;break;case"mpunct":s=ci[a]||a;break;case"mop":"​"!==e.body&&(s="",s+="\\operatorname"===a?t(e.body):e.body||a,s+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":s=" "}if(e.subscript){s+="_";const i=t(e.subscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}if(e.superscript){s+="^";const i=t(e.superscript);i.length>1&&!/^(-)?\d+(\.\d*)?$/.test(i)?s+="("+i+")":s+=i}return s}(t,this.config));return i}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const i=Yt.makeRoot("math",e);return this.formatMathlist(i,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!0:i.subscript&&(s=!1),e+=1,i=this.mathlist.ancestor(e);return s?t:0}_subscriptDepth(){let t=0,e=0,i=this.mathlist.ancestor(e),s=!1;for(;i;)(i.superscript||i.subscript)&&(t+=1),i.superscript?s=!1:i.subscript&&(s=!0),e+=1,i=this.mathlist.ancestor(e);return s?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const i=this._getSelectionBounds();i&&(t={x:i.right+e.left-this.field.scrollLeft,y:i.top+e.top-this.field.scrollTop})}if(t){const i=t.x-window.scrollX;ie.right&&this.field.scroll({top:0,left:i-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const i=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=i)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,i){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Ze.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,i&&this.$insert(i,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Ze.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(wt.commandAllowed(t,e)){const i=le.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(i)}else{const i=le.parseTokens(n(e),t,null,this.config.macros);i?this.mathlist.spliceCommandStringAroundInsertionPoint(i):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);if(0===e.length)Ze.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const i=this.suggestionIndex%e.length,s=t.length-e[i].match.length;0!==s&&this.mathlist.insertSuggestion(e[i].match,s),Ze.showPopoverWithLatex(this,e[i].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const i=this;let s,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),us(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),s=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+i.config.namespace+"command-pressed");n&&i.$perform(JSON.parse(n));const l=t.getAttribute("data-"+i.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&i.$perform(JSON.parse(l))}),300))}})),us(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),us(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?i.style.width="286px":4===e.length||2===e.length?i.style.width="146px":1===e.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let s="";for(const t of e)s+="";s="
      "+s+"
    ",i.innerHTML=s,ri.makeKeycap(this,i.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-i.clientHeight<0&&(i.style.width="auto",e.length<=6?i.style.height="56px":e.length<=12?i.style.height="108px":i.style.height="205px");const t=(a.top-i.clientHeight+5).toString()+"px",s=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(a.left+a.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+s+","+t+")",i.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",ys(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let i=!1;for(let s=0;s=1){i=[];for(let t=1;t<=s;t++)i.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),s=t.mathlist.endOffset()+1;if(s<=e.length-1){i=[];for(let t=s;t<=e.length-1;t++)i.push(e[t])}break}case"start":case"end":break;case"group":i=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(i=t.mathlist.parent());break}}return i}(this,t);if(null===i)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const s={...this.config};(e.withHighlighting||"amazon"===s.speechEngine)&&(s.textToSpeechMarkup=window.sre&&"sre"===s.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(s.generateID=!0));const a=Yt.toSpeakableText(i,s);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,s),!1}}let ks,vs=0;function ws(t,e,i){const s=Object.assign({},t.config);return s.textToSpeechMarkup="",s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup="none",e+Yt.toSpeakableText(i,s)}function Ss(t,e,i,s){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=ws(t,"deleted: ",s):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(i):"replacement"===e?a=ws(t,"",t.mathlist.sibling(0)):"line"===e?(a=ws(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+Yt.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=s?ws(t,e+" ",s):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}xs.prototype.undo_=xs.prototype.undo,xs.prototype.redo_=xs.prototype.redo,xs.prototype.scrollIntoView_=xs.prototype.scrollIntoView,xs.prototype.scrollToStart_=xs.prototype.scrollToStart,xs.prototype.scrollToEnd_=xs.prototype.scrollToEnd,xs.prototype.insert_=xs.prototype.$insert;var As={isValidMathfield:bs,MathField:xs};function Ms(t,e,i){let s=i,a=0;const o=t.length;for(;s0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=Ms(i,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+i.length),mathstyle:s}),c=r+i.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(e){i.textContent=t}return i.className="sr-only",i}(t,i)),/\bspeakable-text\b/i.test(i.renderAccessibleContent)&&i.renderToSpeakableText){const s=document.createElement("span");s.innerHTML=i.renderToSpeakableText(t,i),s.className="sr-only",e.appendChild(s)}return e.appendChild(a),e}return a}function Ls(t,e){let i=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))i=document.createDocumentFragment(),i.appendChild(Ts(t,void 0,e,!0));else{const s=_s(t,e.TeX.delimiters);if(1===s.length&&"text"===s[0].type)return null;i=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Ps(t,e,i){if(!window)return;if(!i&&window.mathlive&&(i=window.mathlive.config),"amazon"!==(i=i||{}).speechEngine)return void(i.handleSpeak&&i.handleSpeak(e));if(!window.AWS)return;const s=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:i.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=i.onReadAloudStatus||window.mathlive.onReadAloudStatus;s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const t of window.mathlive.readAloudMarks)t.value&&window.mathlive.readAloudTokens.push(t.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],s.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),i=new Blob([t.buffer],{type:"audio/mpeg"}),s=URL.createObjectURL(i);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const i of window.mathlive.readAloudMarks)i.time0&&Array.from(e.children).forEach(e=>{t(e,i)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=s,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function Bs(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Os(t,e){Ds&&((e=e||{}).renderToMarkup=e.renderToMarkup||zs,e.renderToMathML=e.renderToMathML||Es,e.renderToSpeakableText=e.renderToSpeakableText||qs,e.macros=e.macros||wt.MACROS,Ds.renderMathInElement(Bs(t),e))}function Rs(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const Ks={latexToMarkup:zs,latexToMathML:Es,latexToSpeakableText:qs,latexToAST:function(t,e){if(!Yt.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,wt.MACROS);const i=le.parseTokens(n(t),"math",null,e.macros);return Yt.toAST(i,e)},astToLatex:function(t,e){return hs(t,e)},makeMathField:function(t,e){if(!As)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Is,e.handleReadAloud=e.handleReadAloud||Ps,new As.MathField(Bs(t),e)},renderMathInDocument:function(t){Os(document.body,t)},renderMathInElement:Os,revertToOriginalContent:function(t,e){(t=(t=Bs(t)).children[1])instanceof As.MathField?t.revertToOriginalContent():(Rs(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Bs(t)).children[1])instanceof As.MathField?t.originalContent:(Rs(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Ps,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let i=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(i=e.time/1e3);let s=window.mathlive.readAloudTokens.indexOf(t);s>=0&&(s+=e,s=1){const i=t.charCodeAt(e-1),a=s;return 55296<=i&&i<=56319?1024*(i-55296)+(a-56320)+65536:a}return s}function e(e,i){if((i=i||0)<0)return 0;if(i>=e.length-1)return e.length;let a=s(t(e,i));for(let r=i+1;r=this.s.length}get(){return this.pos="0"&&s<="9"?parseInt(s):"?"):t=new a("literal","#")}}else"~"===this.peek()?(this.get(),t=new a("command","space")):"$"===this.peek()?(this.get(),"$"===this.peek()?(this.get(),t=new a("$$")):t=new a("$")):t=new a("literal",this.get());return t}}var n=function(t){const e=[],s=t.toString().split(/\r?\n/);let i="",a="";for(const o of s){i+=a,a=" ";const t=o.match(/((?:\\%)|[^%])*/);t&&(i+=t[0])}const n=new o(i);for(;!n.end();){const t=n.makeToken();t&&e.push(t)}return e},r={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0],58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}};const l=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,c={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25]},h={defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,pxPerEm:40/3,doubleRuleSep:.2,arraycolsep:.5,baselineskip:1.2,arrayrulewidth:.04,fboxsep:.3,fboxrule:.04},d={" ":" ","​":" ","Å":"A","Ç":"C","Ð":"D","Þ":"o","å":"a","ç":"c","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function p(t,e,s){if("string"==typeof t){const s=t.match(/([-+]?[0-9.]*)\s*([a-zA-Z]+)/);s?(t=parseFloat(s[1]),e=s[2].toLowerCase()):t=parseFloat(t)}const i={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:.75,em:h.ptPerEm,bp:1.00375,dd:1238/1157,pc:12,in:72.27,mu:10/18}[e]||1;if(isFinite(s)){const e=Math.pow(10,s);return Math.round(t/h.ptPerEm*i*e)/e}return t/h.ptPerEm*i}var m={toEm:p,toPx:function(t,e){return p(t,e)*(4/3)*h.ptPerEm},METRICS:h,SIGMAS:c,getCharacterMetrics:function(t,e){const s={cal:"Caligraphic-Regular",ams:"AMS-Regular",frak:"Fraktur-Regular",bb:"AMS-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmtt:"Typewriter-Regular",cmss:"SansSerif-Regular"}[e]||e;let i=t.charCodeAt(0);t[0]in d?i=d[t[0]].charCodeAt(0):l.test(t[0])&&(i=77);const a=r[s][i];return a?a?{depth:a[0],height:a[1],italic:a[2],skew:a[3]}:null:{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0}}};const u=[{},{},{}];let f;for(const Ki in c)if(Object.prototype.hasOwnProperty.call(c,Ki))for(f=0;f<3;f++)u[f][Ki]=c[Ki][f];for(f=0;f<3;f++)u[f].emPerEx=c.xHeight[f]/c.quad[f];class g{constructor(t,e,s,i){this.id=t,this.size=e,this.cramped=i,this.sizeMultiplier=s,this.metrics=u[e>0?e-1:0]}sup(){return y[k[this.id]]}sub(){return y[v[this.id]]}fracNum(){return y[w[this.id]]}fracDen(){return y[S[this.id]]}cramp(){return y[A[this.id]]}cls(){return b[this.size]}adjustTo(t){let e=x[this.size][t.size];return e.length>0&&(e=" "+e),e}isTight(){return this.size>=2}}const y=[new g(0,0,1,!1),new g(1,0,1,!0),new g(2,1,1,!1),new g(3,1,1,!0),new g(4,2,.7,!1),new g(5,2,.7,!0),new g(6,3,.5,!1),new g(7,3,.5,!0)],b=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],x=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]],k=[4,5,4,5,6,7,6,7],v=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],S=[3,3,5,5,7,7,7,7],A=[1,1,3,3,5,5,7,7];var M={DISPLAY:y[0],TEXT:y[2],SCRIPT:y[4],SCRIPTSCRIPT:y[6],toMathstyle:function(t){return t?"object"==typeof t?t:{displaystyle:y[0],textstyle:y[2],scriptstyle:y[4],scriptscriptstyle:y[6]}[t]:t}};class C{constructor(t){this.macros=t.macros||{},this.generateID=!!t.generateID&&t.generateID,this.mathstyle=M.toMathstyle(t.mathstyle||"displaystyle"),this.size=t.size||"size5",this.parentMathstyle=t.parentMathstyle||this.mathstyle,this.parentSize=t.parentSize||this.size,this.opacity=t.opacity}clone(t){const e=new C(this);return e.parentMathstyle=this.mathstyle,e.parentSize=this.size,e.macros=this.macros,t&&("auto"!==t.mathstyle&&t.mathstyle||delete t.mathstyle,Object.assign(e,t),"string"==typeof t.mathstyle&&(e.mathstyle=M.toMathstyle(t.mathstyle))),e}setMathstyle(t){t&&"auto"!==t&&(this.mathstyle=M.toMathstyle(t))}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sup()})}}var _=C;function T(t){let e="";if("number"==typeof t)e+=Math.floor(100*t)/100;else if("string"==typeof t)e+=t;else if(Array.isArray(t))for(const s of t)e+=T(s);else t&&(e+=t.toString());return e}class L{constructor(t,e){this.classes=e||"",Array.isArray(t)?this.children=[].concat.apply([],t):"string"==typeof t?this.body=t:t&&"object"==typeof t&&(this.children=[t]),this.style=null,this.updateDimensions()}updateDimensions(){let t=0,e=0,s=1;this.children&&this.children.forEach(i=>{i.height>t&&(t=i.height),i.depth>e&&(e=i.depth),i.maxFontSize>s&&(s=i.maxFontSize)}),this.height=t,this.depth=e,this.maxFontSize=s}selected(t){t&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!t&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach(e=>e.selected(t))}applyStyle(t){if(!t)return;if(t.color&&("none"!==t.color?this.setStyle("color",t.color):this.setStyle("color","")),t.backgroundColor&&("none"!==t.backgroundColor?this.setStyle("background-color",t.backgroundColor):this.setStyle("background-color","")),t.cssClass&&(this.classes+=" "+t.cssClass),!this.body)return;let e=t.fontFamily;"math"===e&&"n"===t.fontShape&&(e="cmr");let s="Main-Regular";if(e&&(s=function(t,e){if("string"!=typeof t||t.length>1||"​"===t)return R[e];if("bb"===e||"scr"===e){if(!/^[A-Z ]$/.test(t))return null}else if("cal"===e){if(!/^[0-9A-Z ]$/.test(t))return null}else if("frak"===e){if(!/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/.test(t))return null}else if(("cmtt"===e||"cmss"===e)&&!/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9’‘]$/.test(t))return null;return R[e]}(this.body,e)),t.fontShape&&(this.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const e=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);e&&(this.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[e[1]||""]||""),this.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[e[2]||""]||""))}if(K[e]?this.classes+=" "+K[e]:e&&this.setStyle("font-family",e),this.body&&this.body.length>0&&s){this.height=0,this.depth=0,this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[t.fontSize]||1,this.skew=0,this.italic=0;for(let t=0;t0&&(this.style||(this.style={}),this.style[t]=s)}setTop(t){t&&0!==t&&(this.style||(this.style={}),this.style.top=T(t)+"em",this.height-=t,this.depth+=t)}setLeft(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-left"]=T(t)+"em")}setRight(t){t&&0!==t&&(this.style||(this.style={}),this.style["margin-right"]=T(t)+"em")}setWidth(t){t&&0!==t&&(this.style||(this.style={}),this.style.width=T(t)+"em")}addMarginRight(t){if(t&&0!==t){if(!this.style&&!/qquad|quad|enspace|thickspace|mediumspace|thinspace|negativethinspace/.test(this.classes)){const e={2:"qquad",1:"quad",".5":"enspace",.277778:"thickspace",.222222:"mediumspace",.166667:"thinspace","-0.166667":"negativethinspace"}[t.toString()];if(e)return void(this.classes+=" rspace "+e)}this.style||(this.style={});const e=parseFloat(this.style["margin-right"]||"0");this.style["margin-right"]=T(e+t)+"em"}}toMarkup(t,e){t=t||0,e=e||1;let s="",i=this.body||"";if(this.children){let t="none";for(const s of this.children){let a=0;if(t){let i=s.type;i&&("textord"===i&&(i="mord"),"first"===i&&(i="none"),a=s.isTight?E[t+"+"+i]||0:F[t+"+"+i]||0,a=Math.floor(e*a))}i+=s.toMarkup(a,e),t=q(s)}}if("​"!==i&&i||this.classes&&"ML__selected"!==this.classes){if(s="1?e.filter((function(t,e,s){return t.length>0&&s.indexOf(t)===e})).join(" "):e[0],a.length>0&&(s+=' class="'+a+'"'),t&&(this.style&&this.style["margin-left"]?this.style["margin-left"]=T(parseFloat(this.style["margin-left"])+t/18)+"em":t<0&&z[-t]?i=z[-t]+i:D[t]?i=D[t]+i:(this.style||(this.style={}),this.style["margin-left"]=T(t/18)+"em")),this.style){let t="";const e=/ML__selected/.test(this.classes);for(const s in this.style)Object.prototype.hasOwnProperty.call(this.style,s)&&("background-color"===s&&e||(t+=s+":"+this.style[s]+";"));t.length>0&&(s+=' style="'+t+'"')}s+=">",this.svgOverlay?(s+='",s+=""):s+=i,s+=""}else s="";return this.caret&&"command"!==this.type&&("text"===this.caret?s+='':s+=''),s}tryCoalesceWith(t){if(this.tag!==t.tag)return!1;if(this.type!==t.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;const e=this.children&&this.children.length>0,s=t.children&&t.children.length>0;if(e||s)return!1;if((this.style?this.style.length:0)!==(t.style?t.style.length:0))return!1;const i=this.classes.trim().replace(/\s+/g," ").split(" "),a=t.classes.trim().replace(/\s+/g," ").split(" ");if(i.length!==a.length)return!1;i.sort(),a.sort();for(let o=0;oMath.max(t,e.height),0):t.height:0}function P(t){return t?Array.isArray(t)?t.reduce((t,e)=>Math.max(t,e.depth),0):t.depth:0}function B(t,e){if(Array.isArray(t)){const s=[];for(const e of t)e&&s.push(e);if(1===s.length)return B(s[0],e)}return new L(t,e)}function O(t,e,s){const i=B(e,s);return i.type=t,i}function $(t,e){if(!e||0===e.length){if(t instanceof L)return t;if(Array.isArray(t)&&1===t.length)return t[0]}const s=new L(t,e);let i=1;return i=t instanceof L?t.maxFontSize:t.reduce((t,e)=>Math.max(t,e.maxFontSize),0),s.height*=i,s.depth*=i,s}const R={ams:"AMS-Regular",bb:"AMS-Regular",cal:"Caligraphic-Regular",frak:"Fraktur-Regular",scr:"Script-Regular",cmr:"Main-Regular",cmss:"SansSerif-Regular",cmtt:"Typewriter-Regular",math:"Math-Regular",mainit:"Main-Italic"},K={ams:"ML__ams",bb:"ML__bb",cal:"ML__cal",frak:"ML__frak",scr:"ML__script",cmr:"ML__mathrm",cmss:"ML__sans",cmtt:"ML__tt",math:"ML__mathit",mainit:"ML__mainit"};var N={coalesce:function t(e){if(!e||0===e.length)return[];e[0].children=t(e[0].children);const s=[e[0]];for(let i=1;i0?"em":""),i.attributes={"aria-hidden":!0}),"size5"!==t.size?new L(i,"fontsize-ensurer reset-"+t.size+" size5"):0!==s?i:null}(t,n),l=[];o=a;for(const h of e)if("number"==typeof h)o+=h;else{const t=B([r,h]);t.setTop(-h.depth-o),l.push(t),o+=h.height+h.depth}const c=B(l,"vlist");return c.depth=Math.max(a,P(c)||0),c.height=Math.max(-o,I(c)||0),c},makeHlist:$,makeStyleWrap:function(t,e,s,i,a){a=a||"";const o=$(e,(a+=" style-wrap ")+s.adjustTo(i));o.type=t;const n=i.sizeMultiplier/s.sizeMultiplier;return o.height*=n,o.depth*=n,o.maxFontSize=i.sizeMultiplier,o},makeSVG:function(t,e,s){return t.svgOverlay=e,t.svgStyle=s,t},height:I,depth:P,skew:function(t){if(!t)return 0;if(Array.isArray(t)){let e=0;for(const s of t)e+=s.skew||0;return e}return t.skew},italic:function(t){return t?Array.isArray(t)?t[t.length-1].italic:t.italic:0}};let W="";const H={},V={},U={},j="CRYPTIC",G="COMMON",Z="SUPERCOMMON",X={CRYPTIC:0,ARCANE:200,VERY_RARE:600,RARE:1200,UNCOMMON:2e3,COMMON:3e3,SUPERCOMMON:4e3};function J(t,...e){const s="string"==typeof t?X[t]:t;for(const i of e)H[i]&&(H[i].frequency=s),V[i]&&(V[i]=Object.assign({},V[i]),V[i].frequency=s)}function Y(t,e,s,i,a){e&&/^(ams|cmr|bb|cal|frak|scr)$/.test(e),"string"==typeof a&&(a=X[a]),H[t]={type:s===rt?lt:s,baseFontFamily:e,value:i,category:W,frequency:a}}function Q(t,e){for(let s=t;s<=e;s++){const t=String.fromCodePoint(s);Y(t,"","mord",t)}}const tt={8739:"|",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",8243:"\\doubleprime",8736:"\\angle",8450:"\\C",8469:"\\N",8473:"\\P",8474:"\\Q",8477:"\\R",8484:"\\Z"};function et(t,e){const s=String.fromCodePoint(e);if("math"===t&&tt[s])return tt[s];if(e>32&&e<127)return s;let i="";if("math"===t){for(const a in H)if(Object.prototype.hasOwnProperty.call(H,a)&&H[a].value===s){i=a;break}}else for(const a in vt)if(Object.prototype.hasOwnProperty.call(vt,a)&&vt[a]===s){i=a;break}return i||s}const st={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},it=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(t){let e=t;if("string"==typeof t&&(e=t.codePointAt(0)),(e<119808||e>120831)&&(e<8448||e>8527))return{char:t};for(const s in st)if(Object.prototype.hasOwnProperty.call(st,s)&&st[s]===e){e=s;break}for(let s=0;s=it[s].start&&et.body).join("")}function yt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a=ft(e),o={category:W,params:a,parser:i,mathstyle:"displaystyle",tabular:s.tabular||!0,colFormat:s.colFormat||[]};for(const n of t)U[n]=o}function bt(t,e,s,i){"string"==typeof t&&(t=[t]),s||(s={});const a={category:W,baseFontFamily:s.fontFamily,params:ft(e),allowedInText:!!s.allowedInText,infix:!!s.infix,parse:i};for(const o of t)V[o]=a}W="Environments",yt("math","",{frequency:0},(function(){return{mathstyle:"textstyle"}})),yt("displaymath","",{frequency:8},(function(){return{mathstyle:"displaystyle"}})),yt("array","{columns:colspec}",{frequency:G},(function(t,e){return{colFormat:e[0],mathstyle:"textstyle"}})),yt("eqnarray","",{},(function(){return{}})),yt("equation","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("subequations","",{},(function(){return{colFormat:[{align:"c"}]}})),yt("multline","",{},(function(){return{firstRowFormat:[{align:"l"}],colFormat:[{align:"c"}],lastRowFormat:[{align:"r"}]}})),yt(["align","aligned"],"",{},(function(t,e,s){let i=0;for(const n of s)i=Math.max(i,n.length);const a=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let o=2;for(;o({color:e[0]})),bt("\\textcolor","{:color}{content:auto*}",{allowedInText:!0},(t,e)=>({color:e[0]})),J(3,"\\textcolor"),bt("\\overline","{:auto}",null,(function(t,e){return{type:"line",position:"overline",skipBoundary:!0,body:e[0]}})),J(G,"\\overline"),bt("\\underline","{:auto}",null,(function(t,e){return{type:"line",position:"underline",skipBoundary:!0,body:e[0]}})),J(G,"\\underline"),bt("\\overset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\overset"),bt("\\underset","{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",underscript:e[0],skipBoundary:!0,body:e[1]}})),J(G,"\\underset"),bt(["\\stackrel","\\stackbin"],"{annotation:auto}{symbol:auto}",null,(function(t,e){return{type:"overunder",overscript:e[0],skipBoundary:!0,body:e[1],mathtype:"\\stackrel"===t?"mrel":"mbin"}})),J(G,"\\stackrel"),J(0,"\\stackbin"),bt("\\rlap","{:auto}",null,(function(t,e){return{type:"overlap",align:"right",skipBoundary:!0,body:e[0]}})),J(270,"\\rlap"),bt("\\llap","{:auto}",null,(function(t,e){return{type:"overlap",align:"left",skipBoundary:!0,body:e[0]}})),J(18,"\\llap"),bt("\\mathrlap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:e[0]}})),J(j,"\\mathrlap"),bt("\\mathllap","{:auto}",null,(function(t,e){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:e[0]}})),J(j,"\\mathllap"),bt("\\boxed","{content:math}",null,(function(t,e){return{type:"box",framecolor:"black",skipBoundary:!0,body:e[0]}})),J(1236,"\\boxed"),bt("\\colorbox","{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",backgroundcolor:e[0],skipBoundary:!0,body:e[1]}})),J(j,"\\colorbox"),bt("\\fcolorbox","{frame-color:color}{background-color:color}{content:auto}",{allowedInText:!0},(function(t,e){return{type:"box",framecolor:e[0],backgroundcolor:e[1],skipBoundary:!0,body:e[2]}})),J(j,"\\fcolorbox"),bt("\\bbox","[:bbox]{body:auto}",{allowedInText:!0},(function(t,e){return e[0]?{type:"box",padding:e[0].padding,border:e[0].border,backgroundcolor:e[0].backgroundcolor,skipBoundary:!0,body:e[1]}:{type:"box",skipBoundary:!0,body:e[1]}})),J(j,"\\bbox"),bt("\\enclose","{notation:string}[style:string]{body:auto}",null,(function(t,e){let s=e[0]||[];const i={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:e[2]};if(e[1]){const t=e[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=e.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(t)i.strokeWidth=m.toPx(t[1],"px"),isFinite(i.strokeWidth)||(i.strokeWidth=1),i.strokeStyle=t[2],i.strokeColor=t[3];else{const t=e.match(/\s*([a-z]*)\s*=\s*"(.*)"/);t&&("mathbackground"===t[1]?i.backgroundcolor=t[2]:"mathcolor"===t[1]?i.strokeColor=t[2]:"padding"===t[1]?i.padding=m.toPx(t[2],"px"):"shadow"===t[1]&&(i.shadow=t[2]))}}"dashed"===i.strokeStyle?i.svgStrokeStyle="5,5":"dotted"===i.strokeStyle&&(i.svgStrokeStyle="1,5")}i.borderStyle=i.strokeWidth+"px "+i.strokeStyle+" "+i.strokeColor,s=s.toString().split(/[, ]/).filter(t=>t.length>0).map(t=>t.toLowerCase()),i.notation={};for(const a of s)i.notation[a]=!0;return i.notation.updiagonalarrow&&(i.notation.updiagonalstrike=!1),i.notation.box&&(i.notation.left=!1,i.notation.right=!1,i.notation.bottom=!1,i.notation.top=!1),i})),J(j,"\\enclose"),bt("\\cancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:e[0]}})),bt("\\bcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:e[0]}})),bt("\\xcancel","{body:auto}",null,(function(t,e){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:e[0]}})),J(j,"\\cancel","\\bcancel","\\xcancel"),W="Styling",bt(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],"",{allowedInText:!0},(function(t,e){return{fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.slice(1)]}})),bt("\\fontseries","{:text}",{allowedInText:!0},(t,e)=>({fontSeries:gt(e[0])})),bt("\\bf","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bm","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\bold","",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b"})),bt(["\\mathbf","\\boldsymbol"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"b",fontShape:"n"})),bt("\\bfseries","",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\textbf","{:text*}",{allowedInText:!0},(t,e)=>({fontSeries:"b"})),bt("\\mathmd","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"n"})),bt("\\mdseries","",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\textmd","{:math*}",{allowedInText:!0},(t,e)=>({fontSeries:"m"})),bt("\\fontshape","{:text}",{allowedInText:!0},(t,e)=>({fontShape:gt(e[0])})),bt("\\it","",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\mathit","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontSeries:"m",fontShape:"it"})),bt("\\upshape","",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textup","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"n"})),bt("\\textit","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"it"})),bt("\\slshape","",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\textsl","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sl"})),bt("\\scshape","",{allowedInText:!0},(t,e)=>({mode:"text",fontShape:"sc"})),bt("\\textsc","{:text*}",{allowedInText:!0},(t,e)=>({fontShape:"sc"})),bt("\\fontfamily","{:text}",{allowedInText:!0},(t,e)=>({fontFamily:gt(e[0])})),bt("\\mathrm","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",fontFamily:"cmr",fontSeries:"m",fontShape:"n"})),bt("\\rmfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\textrm","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr"})),bt("\\mathsf","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmss",fontSeries:"m",fontShape:"n"})),bt("\\sffamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\textsf","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmss"})),bt("\\mathtt","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cmtt",fontSeries:"m",fontShape:"n"})),bt("\\ttfamily","",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt("\\texttt","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmtt"})),bt(["\\Bbb","\\mathbb"],"{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"bb"})),bt(["\\frak","\\mathfrak"],"{:math*}",{allowedInText:!0},(t,e)=>({baseFontFamily:"frak"})),bt("\\mathcal","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"cal",fontSeries:"m",fontShape:"n"})),bt("\\mathscr","{:math*}",{allowedInText:!0},(t,e)=>({mode:"math",baseFontFamily:"scr",fontSeries:"m",fontShape:"n"})),J(Z,"\\mathbb"),J(1081,"\\Bbb"),J(0,"\\mathcal"),J(G,"\\mathfrak"),J(271,"\\frak"),J(G,"\\mathscr"),J("UNCOMMON","\\mathsf"),J(G,"\\mathtt"),J(G,"\\boldsymbol"),bt("\\textnormal","{:text*}",{allowedInText:!0},(t,e)=>({fontFamily:"cmr",fontShape:"n",fontSeries:"n"})),bt("\\mbox","{:text*}",null,(t,e)=>({fontFamily:"cmr"})),bt("\\text","{:text*}",{allowedInText:!0},(t,e)=>({})),bt("\\class","{name:text}{content:auto*}",{allowedInText:!0},(t,e)=>({cssClass:gt(e[0])})),bt("\\cssId","{id:text}{content:auto}",{allowedInText:!0},(t,e)=>({cssId:gt(e[0]),body:e[1],type:"group"})),bt("\\em","",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",type:"group"})),bt("\\emph","{:auto}",{allowedInText:!0},(t,e)=>({cssClass:"ML__emph",body:e[0],type:"group",skipBoundary:!0})),J(G,"\\textrm"),J(G,"\\textit"),J(G,"\\textsf"),J(G,"\\texttt"),J(433,"\\textnormal"),J(G,"\\textbf"),J(421,"\\textup"),J(819,"\\emph"),J(49,"\\em"),W="Operators",bt("\\sqrt","[index:auto]{radicand:auto}",null,(function(t,e){return{type:"surd",body:e[1],index:e[0]}})),J(Z,"\\sqrt"),W="Fractions",bt(["\\frac","\\dfrac","\\tfrac","\\cfrac","\\binom","\\dbinom","\\tbinom"],"{numerator}{denominator}",null,(function(t,e){const s={type:"genfrac",numer:e[0],denom:e[1],mathstyle:"auto"};switch(t){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":s.hasBarLine=!0;break;case"\\\\atopfrac":s.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s.hasBarLine=!1,s.leftDelim="(",s.rightDelim=")"}switch(t){case"\\dfrac":case"\\dbinom":s.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":s.mathstyle="textstyle"}return"\\cfrac"===t&&(s.continuousFraction=!0),s})),bt(["\\over","\\atop","\\choose"],"",{infix:!0},(function(t,e){const s=e[0],i=e[1];let a=!1,o=null,n=null;switch(t){case"\\atop":break;case"\\over":a=!0;break;case"\\choose":a=!1,o="(",n=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:s,denom:i,hasBarLine:a,leftDelim:o,rightDelim:n,mathstyle:"auto"}})),J(21,"\\over"),J(12,"\\atop"),J(1968,"\\choose"),bt(["\\overwithdelims","\\atopwithdelims"],"{left-delim:delim}{right-delim:delim}",{infix:!0},(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],hasBarLine:!1,leftDelim:e[2],rightDelim:e[3],mathstyle:"auto"}})),J(15,"\\overwithdelims"),J(G,"\\atopwithdelims"),W="Fractions",bt("\\pdiff","{numerator}{denominator}",null,(function(t,e){return{type:"genfrac",numer:e[0],denom:e[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"}})),W="Quantifiers",Y("\\forall","",lt,"∀",Z),Y("\\exists","",lt,"∃",Z),Y("\\nexists",nt,lt,"∄",Z),Y("\\mid","",ht,"∣",G),Y("\\top","",lt,"⊤","RARE"),Y("\\bot","",lt,"⊥","RARE"),W="Variable Sized Symbols",bt(["\\sum","\\prod","\\bigcup","\\bigcap","\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\\intop"],"",null,(function(t){return{type:"mop",limits:"auto",symbol:!0,baseFontFamily:"cmr",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[t.slice(1)]}})),bt(["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!0,body:{int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑"}[t.slice(1)]}})),J(Z,"\\sum","\\prod","\\bigcap","\\bigcup","\\int"),J(G,"\\bigoplus","\\smallint","\\iint","\\oint"),J("RARE","\\bigwedge","\\bigvee"),J(756,"\\coprod"),J(723,"\\bigsqcup"),J(1241,"\\bigotimes"),J(150,"\\bigodot"),J(174,"\\biguplus"),J(878,"\\iiint"),J(97,"\\intop"),W="Various",Y("\\sharp","",lt,"♯",G),Y("\\flat","",lt,"♭",590),Y("\\natural","",lt,"♮",278),Y("\\#","",lt,"#","RARE"),Y("\\&","",lt,"&","RARE"),Y("\\clubsuit","",lt,"♣",172),Y("\\heartsuit","",lt,"♡","ARCANE"),Y("\\spadesuit","",lt,"♠","ARCANE"),Y("\\diamondsuit","",lt,"♢",j),Y("\\differencedelta","",ht,"∆",G),W="Letters and Letter Like Forms",bt("\\unicode","{charcode:number}",null,(function(t,e){let s=parseInt(e[0]);return isFinite(s)||(s=10067),{type:"mord",body:String.fromCodePoint(s)}})),Y("\\backslash","",lt,"\\"),Y("?","",lt,"?"),Y("!","",lt,"!"),Y("\\nabla","",lt,"∇",Z),Y("\\partial","",lt,"∂",Z),Y("\\ell","",lt,"ℓ",G),Y("\\imaginaryI","",lt,"i"),Y("\\imaginaryJ","",lt,"j"),bt(["\\Re","\\Im"],"",null,(function(t){return{type:"mop",limits:"nolimits",symbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[t],baseFontFamily:"frak"}})),Y("\\hbar","",lt,"ℏ",G),Y("\\hslash",nt,lt,"ℏ",G),Y("\\differentialD","cmr",lt,"d"),Y("\\rd","cmr",lt,"d"),Y("\\capitalDifferentialD","cmr",lt,"D"),Y("\\rD","cmr",lt,"D"),Y("\\exponentialE","cmr",lt,"e"),Y("\\Finv",nt,lt,"Ⅎ",3),Y("\\Game",nt,lt,"⅁",1),Y("\\wp","",lt,"℘",1306),Y("\\eth",nt,lt,"ð",77),Y("\\mho",nt,lt,"℧",138),Y("\\Bbbk",nt,lt,"k"),Y("\\doubleStruckCapitalN","bb",lt,"N"),Y("\\N","bb",lt,"N"),Y("\\doubleStruckCapitalR","bb",lt,"R"),Y("\\R","bb",lt,"R"),Y("\\doubleStruckCapitalQ","bb",lt,"Q"),Y("\\Q","bb",lt,"Q"),Y("\\doubleStruckCapitalC","bb",lt,"C"),Y("\\C","bb",lt,"C"),Y("\\doubleStruckCapitalZ","bb",lt,"Z"),Y("\\Z","bb",lt,"Z"),Y("\\doubleStruckCapitalP","bb",lt,"P"),Y("\\P","bb",lt,"P"),Y("\\scriptCapitalE","scr",lt,"E"),Y("\\scriptCapitalH","scr",lt,"H"),Y("\\scriptCapitalL","scr",lt,"L"),Y("\\gothicCapitalC","frak",lt,"C"),Y("\\gothicCapitalH","frak",lt,"H"),Y("\\gothicCapitalI","frak",lt,"I"),Y("\\gothicCapitalR","frak",lt,"R"),Y("\\pounds","",lt,"£",509),Y("\\yen",nt,lt,"¥",57),Y("\\euro","",lt,"€",4),W="Crosses",Y("\\textdagger","",ct,"†"),Y("\\dagger","",ct,"†",G),Y("\\dag","",ct,"†",G),Y("\\ddag","",ct,"‡",500),Y("\\textdaggerdbl","",ct,"‡"),Y("\\ddagger","",ct,"‡",353),Y("\\maltese",nt,lt,"✠",24),W="Arrows",Y("\\longrightarrow","",ht,"⟶",Z),Y("\\rightarrow","",ht,"→",Z),Y("\\Longrightarrow","",ht,"⟹",Z),Y("\\Rightarrow","",ht,"⇒",Z),Y("\\longmapsto","",ht,"⟼",G),Y("\\mapsto","",ht,"↦",G),Y("\\Longleftrightarrow","",ht,"⟺",G),Y("\\rightleftarrows",nt,ht,"⇄",G),Y("\\leftarrow","",ht,"←",G),Y("\\curvearrowleft",nt,ht,"↶",G),Y("\\uparrow","",ht,"↑",G),Y("\\downarrow","",ht,"↓",G),Y("\\hookrightarrow","",ht,"↪",G),Y("\\rightharpoonup","",ht,"⇀",G),Y("\\rightleftharpoons","",ht,"⇌",G),Y("\\Leftarrow","",ht,"⇐",1695),Y("\\longleftrightarrow","",ht,"⟷",1599),Y("\\longleftarrow","",ht,"⟵",878),Y("\\Longleftarrow","",ht,"⟸",296),Y("\\searrow","",ht,"↘",1609),Y("\\nearrow","",ht,"↗",1301),Y("\\swarrow","",ht,"↙",167),Y("\\nwarrow","",ht,"↖",108),Y("\\Uparrow","",ht,"⇑",257),Y("\\Downarrow","",ht,"⇓",556),Y("\\updownarrow","",ht,"↕",192),Y("\\Updownarrow","",ht,"⇕",161),Y("\\hookleftarrow","",ht,"↩",115),Y("\\leftharpoonup","",ht,"↼",93),Y("\\leftharpoondown","",ht,"↽",42),Y("\\rightharpoondown","",ht,"⇁",80),Y("\\leftrightarrows",nt,ht,"⇆",765),Y("\\dashrightarrow",nt,ht,"⇢",311),Y("\\dashleftarrow",nt,ht,"⇠",5),Y("\\leftleftarrows",nt,ht,"⇇",8),Y("\\Lleftarrow",nt,ht,"⇚",7),Y("\\twoheadleftarrow",nt,ht,"↞",32),Y("\\leftarrowtail",nt,ht,"↢",25),Y("\\looparrowleft",nt,ht,"↫",6),Y("\\leftrightharpoons",nt,ht,"⇋",205),Y("\\circlearrowleft",nt,ht,"↺",105),Y("\\Lsh",nt,ht,"↰",11),Y("\\upuparrows",nt,ht,"⇈",15),Y("\\downharpoonleft",nt,ht,"⇃",21),Y("\\multimap",nt,ht,"⊸",108),Y("\\leftrightsquigarrow",nt,ht,"↭",31),Y("\\twoheadrightarrow",nt,ht,"↠",835),Y("\\rightarrowtail",nt,ht,"↣",195),Y("\\looparrowright",nt,ht,"↬",37),Y("\\curvearrowright",nt,ht,"↷",209),Y("\\circlearrowright",nt,ht,"↻",63),Y("\\Rsh",nt,ht,"↱",18),Y("\\downdownarrows",nt,ht,"⇊",6),Y("\\upharpoonright",nt,ht,"↾",579),Y("\\downharpoonright",nt,ht,"⇂",39),Y("\\rightsquigarrow",nt,ht,"⇝",674),Y("\\leadsto",nt,ht,"⇝",709),Y("\\Rrightarrow",nt,ht,"⇛",62),Y("\\restriction",nt,ht,"↾",29),Y("\\upharpoonleft",nt,ht,"↿",j),Y("\\rightrightarrows",nt,ht,"⇉",j),W="Negated Arrows",Y("\\nrightarrow",nt,ht,"↛",324),Y("\\nRightarrow",nt,ht,"⇏",107),Y("\\nleftrightarrow",nt,ht,"↮",36),Y("\\nLeftrightarrow",nt,ht,"⇎",20),Y("\\nleftarrow",nt,ht,"↚",7),Y("\\nLeftarrow",nt,ht,"⇍",5),W="Negated Relations",Y("\\nless",nt,ht,"≮",146),Y("\\nleqslant",nt,ht,"",58),Y("\\lneq",nt,ht,"⪇",54),Y("\\lneqq",nt,ht,"≨",36),Y("\\nleqq",nt,ht,"",18),Y("\\unlhd",nt,ct,"⊴",253),Y("\\unrhd",nt,ct,"⊵",66),Y("\\lvertneqq",nt,ht,"",6),Y("\\lnsim",nt,ht,"⋦",4),Y("\\lnapprox",nt,ht,"⪉",j),Y("\\nprec",nt,ht,"⊀",71),Y("\\npreceq",nt,ht,"⋠",57),Y("\\precnsim",nt,ht,"⋨",4),Y("\\precnapprox",nt,ht,"⪹",2),Y("\\nsim",nt,ht,"≁",40),Y("\\nshortmid",nt,ht,"",1),Y("\\nmid",nt,ht,"∤",417),Y("\\nvdash",nt,ht,"⊬",266),Y("\\nvDash",nt,ht,"⊭",405),Y("\\ngtr",nt,ht,"≯",90),Y("\\ngeqslant",nt,ht,"",23),Y("\\ngeqq",nt,ht,"",12),Y("\\gneq",nt,ht,"⪈",29),Y("\\gneqq",nt,ht,"≩",35),Y("\\gvertneqq",nt,ht,"",6),Y("\\gnsim",nt,ht,"⋧",3),Y("\\gnapprox",nt,ht,"⪊",j),Y("\\nsucc",nt,ht,"⊁",44),Y("\\nsucceq",nt,ht,"⋡",j),Y("\\succnsim",nt,ht,"⋩",4),Y("\\succnapprox",nt,ht,"⪺",j),Y("\\ncong",nt,ht,"≆",128),Y("\\nshortparallel",nt,ht,"",6),Y("\\nparallel",nt,ht,"∦",54),Y("\\nVDash",nt,ht,"⊯",5),Y("\\nsupseteqq",nt,ht,"",1),Y("\\supsetneq",nt,ht,"⊋",286),Y("\\varsupsetneq",nt,ht,"",2),Y("\\supsetneqq",nt,ht,"⫌",49),Y("\\varsupsetneqq",nt,ht,"",3),Y("\\nVdash",nt,ht,"⊮",179),Y("\\precneqq",nt,ht,"⪵",11),Y("\\succneqq",nt,ht,"⪶",3),Y("\\nsubseteqq",nt,ht,"",16),W="Various",Y("\\checkmark",nt,lt,"✓",1025),Y("\\diagup",nt,lt,"╱",440),Y("\\diagdown",nt,lt,"╲",175),Y("\\measuredangle",nt,lt,"∡",271),Y("\\sphericalangle",nt,lt,"∢",156),Y("\\backprime",nt,lt,"‵",104),Y("\\backdoubleprime",nt,lt,"‶",j),W="Shapes",Y("\\ast","",ct,"∗",Z),Y("\\star","",ct,"⋆",G),Y("\\diamond","",ct,"⋄",1356),Y("\\Diamond",nt,lt,"◊",695),Y("\\lozenge",nt,lt,"◊",422),Y("\\blacklozenge",nt,lt,"⧫",344),Y("\\bigstar",nt,lt,"★",168),W="Hebrew",Y("\\aleph","",lt,"ℵ",1381),Y("\\beth",nt,lt,"ℶ",54),Y("\\daleth",nt,lt,"ℸ",43),Y("\\gimel",nt,lt,"ℷ",36),W="Fences",Y("\\lbrace","",dt,"{",Z),Y("\\rbrace","",pt,"}",Z),Y("\\langle","",dt,"⟨",G),Y("\\rangle","",pt,"⟩",G),Y("\\lfloor","",dt,"⌊",G),Y("\\rfloor","",pt,"⌋",G),Y("\\lceil","",dt,"⌈",G),Y("\\rceil","",pt,"⌉",G),Y("\\vert","",lt,"∣",Z),Y("\\mvert","",ht,"∣"),Y("\\lvert","",dt,"∣",496),Y("\\rvert","",pt,"∣",496),Y("\\|","",lt,"∥"),Y("\\Vert","",lt,"∥",Z),Y("\\mVert","",lt,"∥"),Y("\\lVert","",dt,"∥",287),Y("\\rVert","",pt,"∥",j),Y("\\lbrack","",dt,"[",574),Y("\\rbrack","",pt,"]",213),Y("\\{","",dt,"{"),Y("\\}","",pt,"}"),Y("(","",dt,"("),Y(")","",pt,")"),Y("[","",dt,"["),Y("]","",pt,"]"),Y("\\ulcorner",nt,dt,"┌",296),Y("\\urcorner",nt,pt,"┐",310),Y("\\llcorner",nt,dt,"└",137),Y("\\lrcorner",nt,pt,"┘",199),Y("\\lgroup","",dt,"⟮",24),Y("\\rgroup","",pt,"⟯",24),Y("\\lmoustache","",dt,"⎰",j),Y("\\rmoustache","",pt,"⎱",j),bt(["\\middle"],"{:delim}",null,(function(t,e){return{type:"delim",delim:e[0]}})),W="Sizing";const xt={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function kt(t){let e="",s=!0;for(const i of t)"string"==typeof i.body?e+=i.body:s=!1;return s?e:""}bt(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],"{:delim}",null,(function(t,e){return{type:"sizeddelim",size:xt[t].size,cls:xt[t].mclass,delim:e[0]}})),W="Relations",Y("=","",ht,"=",Z),Y("\\ne","",ht,"≠",Z),Y("\\neq","",ht,"≠",G),Y("<","",ht,"<",Z),Y("\\lt","",ht,"<",G),Y(">","",ht,">",Z),Y("\\gt","",ht,">",G),Y("\\le","",ht,"≤",G),Y("\\ge","",ht,"≥",G),Y("\\leqslant",nt,ht,"⩽",Z),Y("\\geqslant",nt,ht,"⩾",Z),Y("\\leq","",ht,"≤",G),Y("\\geq","",ht,"≥",G),Y("\\ll","",ht,"≪"),Y("\\gg","",ht,"≫",G),Y("\\coloneq","",ht,"≔",5),Y("\\measeq","",ht,"≝"),Y("\\eqdef","",ht,"≞"),Y("\\questeq","",ht,"≟"),Y(":","",ht,":"),Y("\\cong","",ht,"≅",G),Y("\\equiv","",ht,"≡",G),Y("\\prec","",ht,"≺",G),Y("\\preceq","",ht,"⪯",G),Y("\\succ","",ht,"≻",G),Y("\\succeq","",ht,"⪰",1916),Y("\\perp","",ht,"⊥",G),Y("\\parallel","",ht,"∥",G),Y("\\propto","",ht,"∝",G),Y("\\Colon","",ht,"∷"),Y("\\smile","",ht,"⌣",G),Y("\\frown","",ht,"⌢",G),Y("\\sim","",ht,"∼",G),Y("\\gtrsim",nt,ht,"≳",G),Y("\\approx","",ht,"≈",Z),Y("\\approxeq",nt,ht,"≊",147),Y("\\thickapprox",nt,ht,"≈",377),Y("\\lessapprox",nt,ht,"⪅",146),Y("\\gtrapprox",nt,ht,"⪆",95),Y("\\precapprox",nt,ht,"⪷",50),Y("\\succapprox",nt,ht,"⪸",j),Y("\\thicksim",nt,ht,"∼",779),Y("\\succsim",nt,ht,"≿",251),Y("\\precsim",nt,ht,"≾",104),Y("\\backsim",nt,ht,"∽",251),Y("\\eqsim",nt,ht,"≂",62),Y("\\backsimeq",nt,ht,"⋍",91),Y("\\simeq","",ht,"≃",j),Y("\\lesssim",nt,ht,"≲",j),Y("\\nleq",nt,ht,"≰",369),Y("\\ngeq",nt,ht,"≱",164),Y("\\smallsmile",nt,ht,"⌣",31),Y("\\smallfrown",nt,ht,"⌢",71),Y("\\bowtie","",ht,"⋈",558),Y("\\asymp","",ht,"≍",755),Y("\\sqsubseteq","",ht,"⊑",1255),Y("\\sqsupseteq","",ht,"⊒",183),Y("\\leqq",nt,ht,"≦",1356),Y("\\eqslantless",nt,ht,"⪕",15),Y("\\lll",nt,ht,"⋘",157),Y("\\lessgtr",nt,ht,"≶",281),Y("\\lesseqgtr",nt,ht,"⋚",134),Y("\\lesseqqgtr",nt,ht,"⪋",j),Y("\\risingdotseq",nt,ht,"≓",8),Y("\\fallingdotseq",nt,ht,"≒",99),Y("\\subseteqq",nt,ht,"⫅",82),Y("\\Subset",nt,ht,"⋐"),Y("\\sqsubset",nt,ht,"⊏",309),Y("\\preccurlyeq",nt,ht,"≼",549),Y("\\curlyeqprec",nt,ht,"⋞",14),Y("\\vDash",nt,ht,"⊨",646),Y("\\Vvdash",nt,ht,"⊪",20),Y("\\bumpeq",nt,ht,"≏",13),Y("\\Bumpeq",nt,ht,"≎",12),Y("\\geqq",nt,ht,"≧",972),Y("\\eqslantgtr",nt,ht,"⪖",13),Y("\\ggg",nt,ht,"⋙",127),Y("\\gtrless",nt,ht,"≷",417),Y("\\gtreqless",nt,ht,"⋛",190),Y("\\gtreqqless",nt,ht,"⪌",91),Y("\\supseteqq",nt,ht,"⫆",6),Y("\\Supset",nt,ht,"⋑",34),Y("\\sqsupset",nt,ht,"⊐",71),Y("\\succcurlyeq",nt,ht,"≽",442),Y("\\curlyeqsucc",nt,ht,"⋟",10),Y("\\Vdash",nt,ht,"⊩",276),Y("\\shortmid",nt,ht,"∣",67),Y("\\shortparallel",nt,ht,"∥",17),Y("\\between",nt,ht,"≬",110),Y("\\pitchfork",nt,ht,"⋔",66),Y("\\varpropto",nt,ht,"∝",203),Y("\\backepsilon",nt,ht,"∍",176),Y("\\llless",nt,ht,"⋘",j),Y("\\gggtr",nt,ht,"⋙",j),Y("\\lhd",nt,ct,"⊲",447),Y("\\rhd",nt,ct,"⊳",338),Y("\\Join","",ht,"⋈",35),Y("\\doteq","",ht,"≐",1450),Y("\\doteqdot",nt,ht,"≑",60),Y("\\Doteq",nt,ht,"≑",j),Y("\\eqcirc",nt,ht,"≖",6),Y("\\circeq",nt,ht,"≗",31),Y("\\lessdot",nt,ct,"⋖",88),Y("\\gtrdot",nt,ct,"⋗",45),Y("\\~","",ht,"~"),W="Logic",Y("\\leftrightarrow","",ht,"↔",Z),Y("\\Leftrightarrow","",ht,"⇔",Z),Y("\\to","",ht,"→",Z),Y("\\models","",ht,"⊨",G),Y("\\vdash","",ht,"⊢",G),Y("\\therefore",nt,ht,"∴",1129),Y("\\because",nt,ht,"∵",388),Y("\\implies","",ht,"⟹",1858),Y("\\gets","",ht,"←",150),Y("\\dashv","",ht,"⊣",299),Y("\\impliedby","",ht,"⟸",j),Y("\\biconditional","",ht,"⟷",j),Y("\\roundimplies","",ht,"⥰",j),W="Operators",Y("+","",ct,"+",Z),Y("-","",ct,"−",Z),Y("−","",ct,"−",Z),Y("\\pm","",ct,"±",G),Y("\\mp","",ct,"∓",G),Y("*","",ct,"∗",G),Y("\\times","",ct,"×",G),Y("\\div","",ct,"÷",G),Y("\\surd","",lt,"√",G),Y("\\divides","",ct,"∣",j),Y("\\ltimes",nt,ct,"⋉",576),Y("\\rtimes",nt,ct,"⋊",946),Y("\\leftthreetimes",nt,ct,"⋋",34),Y("\\rightthreetimes",nt,ct,"⋌",14),Y("\\intercal",nt,ct,"⊺",478),Y("\\dotplus",nt,ct,"∔",81),Y("\\centerdot",nt,ct,"⋅",271),Y("\\doublebarwedge",nt,ct,"⩞",5),Y("\\divideontimes",nt,ct,"⋇",51),Y("\\cdot","",ct,"⋅",j),W="Others",Y("\\infty","",lt,"∞",Z),Y("\\prime","",rt,"′",Z),Y("\\doubleprime","",lt,"″"),Y("\\angle","",lt,"∠",G),Y("`","",lt,"‘"),Y("\\$","",lt,"$"),Y("\\%","",lt,"%"),Y("\\_","",lt,"_"),W="Greek",Y("\\alpha","",rt,"α",G),Y("\\beta","",rt,"β",G),Y("\\gamma","",rt,"γ",G),Y("\\delta","",rt,"δ",G),Y("\\epsilon","",rt,"ϵ",G),Y("\\varepsilon","",rt,"ε"),Y("\\zeta","",rt,"ζ",G),Y("\\eta","",rt,"η",G),Y("\\theta","",rt,"θ",G),Y("\\vartheta","",rt,"ϑ",G),Y("\\iota","",rt,"ι",G),Y("\\kappa","",rt,"κ",G),Y("\\varkappa",nt,rt,"ϰ",G),Y("\\lambda","",rt,"λ",G),Y("\\mu","",rt,"μ",G),Y("\\nu","",rt,"ν",G),Y("\\xi","",rt,"ξ",G),Y("\\omicron","",rt,"o"),Y("\\pi","",rt,"π",G),Y("\\varpi","",rt,"ϖ",G),Y("\\rho","",rt,"ρ",G),Y("\\varrho","",rt,"ϱ",G),Y("\\sigma","",rt,"σ",G),Y("\\varsigma","",rt,"ς",G),Y("\\tau","",rt,"τ",G),Y("\\phi","",rt,"ϕ",G),Y("\\varphi","",rt,"φ",G),Y("\\upsilon","",rt,"υ",G),Y("\\chi","",rt,"χ",G),Y("\\psi","",rt,"ψ",G),Y("\\omega","",rt,"ω",G),Y("\\Gamma","",rt,"Γ",G),Y("\\Delta","",rt,"Δ",G),Y("\\Theta","",rt,"Θ",G),Y("\\Lambda","",rt,"Λ",G),Y("\\Xi","",rt,"Ξ",G),Y("\\Pi","",rt,"Π",G),Y("\\Sigma","",rt,"Σ",G),Y("\\Upsilon","",rt,"Υ",G),Y("\\Phi","",rt,"Φ",G),Y("\\Psi","",rt,"Ψ",G),Y("\\Omega","",rt,"Ω",G),Y("\\digamma",nt,rt,"ϝ",248),W="Others",Y("\\emptyset","",lt,"∅",Z),Y("\\varnothing",nt,lt,"∅",Z),W="Set Operators",Y("\\cap","",ct,"∩",Z),Y("\\cup","",ct,"∪",Z),Y("\\setminus","",ct,"∖",G),Y("\\smallsetminus",nt,ct,"∖",254),Y("\\complement",nt,lt,"∁",200),W="Set Relations",Y("\\in","",ht,"∈",Z),Y("\\notin","",ht,"∉",Z),Y("\\not","",ht,"̸",G),Y("\\ni","",ht,"∋",G),Y("\\owns","",ht,"∋",18),Y("\\subset","",ht,"⊂",Z),Y("\\supset","",ht,"⊃",Z),Y("\\subseteq","",ht,"⊆",Z),Y("\\supseteq","",ht,"⊇",Z),Y("\\subsetneq",nt,ht,"⊊",1945),Y("\\varsubsetneq",nt,ht,"",198),Y("\\subsetneqq",nt,ht,"⫋",314),Y("\\varsubsetneqq",nt,ht,"",55),Y("\\nsubset",nt,ht,"⊄",j),Y("\\nsupset",nt,ht,"⊅",j),Y("\\nsubseteq",nt,ht,"⊈",950),Y("\\nsupseteq",nt,ht,"⊉",49),W="Spacing",Y("\\ ","",mt," "),Y("~","",mt," "),Y("\\space","",mt," "),Y("\\!","",mt,null),Y("\\,","",mt,null),Y("\\:","",mt,null),Y("\\;","",mt,null),Y("\\enskip","",mt,null),Y("\\enspace","",mt,null,672),Y("\\quad","",mt,null,G),Y("\\qquad","",mt,null,G),bt(["\\hspace","\\hspace*"],"{width:skip}",{allowedInText:!0},(function(t,e){return{type:"spacing",width:e[0]||0}})),bt(["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner"],"{:auto}",null,(function(t,e){const s={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[t],body:kt(e[0])||e[0],captureSelection:!0,baseFontFamily:"\\mathop"===t?"math":""};return"\\mathop"===t&&(s.limits="nolimits",s.isFunction=!0),s})),bt(["\\operatorname","\\operatorname*"],"{operator:math}",null,(function(t,e){const s={type:"mop",skipBoundary:!0,body:e[0],isFunction:!0};return s.body.forEach(t=>{t.isFunction=!1,t.autoFontFamily="cmr"}),"\\operatorname"===t?s.limits="nolimits":"\\operatorname*"===t&&(s.limits="limits"),s})),W="Punctuation",Y("\\colon","","mpunct",":",G),Y("\\cdotp","","mpunct","⋅",G),Y("\\ldots","","minner","…",G),Y("\\cdots","","minner","⋯",G),Y("\\ddots","","minner","⋱",G),Y("\\mathellipsis","","minner","…",91),Y("\\vdots","",lt,"⋮",G),Y("\\ldotp","","mpunct",".",18),Y(",","","mpunct",","),Y(";","","mpunct",";"),W="Logical Operators",Y("\\wedge","",ct,"∧",Z),Y("\\vee","",ct,"∨",Z),Y("\\lnot","",lt,"¬",G),Y("\\neg","",lt,"¬",Z),Y("\\land","",ct,"∧",659),Y("\\lor","",ct,"∨",364),Y("\\barwedge",nt,ct,"⊼",21),Y("\\veebar",nt,ct,"⊻",43),Y("\\nor",nt,ct,"⊻",7),Y("\\curlywedge",nt,ct,"⋏",58),Y("\\curlyvee",nt,ct,"⋎",57),W="Boxes",Y("\\square",nt,lt,"□",G),Y("\\Box",nt,lt,"□",G),Y("\\blacksquare",nt,lt,"■",1679),Y("\\boxminus",nt,ct,"⊟",79),Y("\\boxplus",nt,ct,"⊞",276),Y("\\boxtimes",nt,ct,"⊠",457),Y("\\boxdot",nt,ct,"⊡",120),W="Circles",Y("\\circ","",ct,"∘",Z),Y("\\bigcirc","",ct,"◯",903),Y("\\bullet","",ct,"∙",G),Y("\\circleddash",nt,ct,"⊝",G),Y("\\circledast",nt,ct,"⊛",339),Y("\\oplus","",ct,"⊕",G),Y("\\ominus","",ct,"⊖",1568),Y("\\otimes","",ct,"⊗",G),Y("\\odot","",ct,"⊙",G),Y("\\circledcirc",nt,ct,"⊚",93),Y("\\oslash","",ct,"⊘",497),Y("\\circledS",nt,lt,"Ⓢ",31),Y("\\circledR",nt,lt,"®",1329),W="Triangles",Y("\\triangle","",lt,"△",G),Y("\\triangleq",nt,ht,"≜",G),Y("\\bigtriangleup","",ct,"△",1773),Y("\\vartriangle",nt,ht,"△",762),Y("\\triangledown",nt,lt,"▽",520),Y("\\bigtriangledown","",ct,"▽",661),Y("\\triangleleft","",ct,"◃",534),Y("\\vartriangleleft",nt,ht,"⊲",281),Y("\\trianglelefteq",nt,ht,"⊴",176),Y("\\ntriangleleft",nt,ht,"⋪",13),Y("\\ntrianglelefteq",nt,ht,"⋬",22),Y("\\triangleright","",ct,"▹",516),Y("\\vartriangleright",nt,ht,"⊳",209),Y("\\trianglerighteq",nt,ht,"⊵",45),Y("\\ntriangleright",nt,ht,"⋫",15),Y("\\ntrianglerighteq",nt,ht,"⋭",6),Y("\\blacktriangle",nt,lt,"▲",360),Y("\\blacktriangledown",nt,lt,"▼",159),Y("\\blacktriangleleft",nt,ht,"◀",101),Y("\\blacktriangleright",nt,ht,"▶",271),W="Others",Y("\\/","",rt,"/"),Y("|","","textord","∣"),W="Big Operators",Y("\\sqcup","",ct,"⊔",1717),Y("\\sqcap","",ct,"⊓",735),Y("\\uplus","",ct,"⊎",597),Y("\\wr","",ct,"≀",286),Y("\\Cap",nt,ct,"⋒",2),Y("\\Cup",nt,ct,"⋓",2),Y("\\doublecap",nt,ct,"⋒",1),Y("\\doublecup",nt,ct,"⋓",1),Y("\\amalg","",ct,"⨿",j),Y("\\And","",ct,"&"),W="Accents",bt(["\\acute","\\grave","\\dot","\\ddot","\\mathring","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec"],"{body:auto}",null,(function(t,e){return{type:"accent",accent:{"\\acute":"ˊ","\\grave":"ˋ","\\dot":"˙","\\ddot":"¨","\\mathring":"˚","\\tilde":"~","\\bar":"ˉ","\\breve":"˘","\\check":"ˇ","\\hat":"^","\\vec":"⃗"}[t],limits:"accent",skipBoundary:!0,body:e[0]}})),J(G,"\\bar","\\ddot","\\acute","\\tilde","\\check"),J(1548,"\\breve"),J(735,"\\grave"),J(Z,"\\vec"),W="Letters and Letter Like Forms",Y("\\imath","",lt,"ı"),Y("\\jmath","",lt,"ȷ"),W="Others",Y("\\degree","",lt,"°",46),W="Others",Y("'","",lt,"′"),Y('"',"",lt,"”"),W="Others",bt("\\^","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\`","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[e[0]]||"`",baseFontFamily:"cmr"}})),bt("\\'","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[e[0]]||"^",baseFontFamily:"cmr"}})),bt("\\~","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[e[0]]||"´",baseFontFamily:"cmr"}})),bt("\\c","{:string}",{allowedInText:!0},(function(t,e){return{type:"mord",limits:"nolimits",symbol:!0,isFunction:!1,body:e[0]&&{c:"ç",C:"Ç"}[e[0]]||"",baseFontFamily:"cmr"}}));const vt={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"};var wt={matchCodepoint:et,commandAllowed:function(t,e){return!(!V[e]||"text"===t&&!V[e].allowedInText)||!!{text:vt,math:H}[t][e]},unicodeToMathVariant:at,mathVariantToUnicode:function(t,e,s){if(!/[A-Za-z0-9]/.test(t))return t;if(!e&&!s)return t;const i=t.codePointAt(0);for(let a=0;a=it[a].offset&&i=1;)i.params.push({optional:!1,type:"math",defaultValue:null,placeholder:null}),a-=1}}}else"math"===e?i=H[t]:vt[t]&&(i={value:vt[t]});return!i||"mord"!==i.type||"f"!==i.value&&"g"!==i.value&&"h"!==i.value||(i.isFunction=!0),i},getValue:function(t,e){return"math"===t?H[e]&&H[e].value?H[e].value:e:vt[e]?vt[e]:e},getEnvironmentInfo:function(t){let e=U[t];return e||(e={params:"",parser:null,mathstyle:"displaystyle",tabular:!0,colFormat:[],lFence:".",rFence:"."}),e},suggest:function(t){if(t.length<=1)return[];const e=[];for(const s in V)Object.prototype.hasOwnProperty.call(V,s)&&s.startsWith(t)&&!V[s].infix&&e.push({match:s,frequency:V[s].frequency});for(const s in H)Object.prototype.hasOwnProperty.call(H,s)&&s.startsWith(t)&&e.push({match:s,frequency:H[s].frequency});return e.sort((t,e)=>t.frequency===e.frequency?t.match.length-e.match.length:(e.frequency||0)-(t.frequency||0)),e},FREQUENCY_VALUE:X,TEXT_SYMBOLS:vt,MATH_SYMBOLS:H,ENVIRONMENTS:U,RIGHT_DELIM:{"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},FUNCTIONS:V,MACROS:{iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace"},COMMAND_MODE_CHARACTERS:/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,LETTER:/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/,LETTER_AND_DIGITS:/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/};const St=N.makeSymbol,At=N.makeSpan,Mt=N.makeVlist;function Ct(t,e,s,i,a,o){const n=St("Size"+s+"-Regular",wt.getValue("math",e)),r=N.makeStyleWrap(t,At(n,"delimsizing size"+s),a.mathstyle,M.TEXT,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}function _t(t,e){let s="";return"Size1-Regular"===e?s=" delim-size1":"Size4-Regular"===e&&(s=" delim-size4"),At(St(e,wt.getValue("math",t)),"delimsizinginner"+s)}function Tt(t,e,s,i,a,o){let n,r,l,c;n=l=c=wt.getValue("math",e),r=null;let h="Size1-Regular";"\\vert"===e||"\\lvert"===e||"\\rvert"===e||"\\mvert"===e||"\\mid"===e?l=n=c="∣":"\\Vert"===e||"\\lVert"===e||"\\rVert"===e||"\\mVert"===e||"\\|"===e?l=n=c="∥":"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?n=l="⏐":"\\Downarrow"===e?n=l="‖":"\\updownarrow"===e?(n="↑",l="⏐",c="↓"):"\\Updownarrow"===e?(n="⇑",l="‖",c="⇓"):"["===e||"\\lbrack"===e?(n="⎡",l="⎢",c="⎣",h="Size4-Regular"):"]"===e||"\\rbrack"===e?(n="⎤",l="⎥",c="⎦",h="Size4-Regular"):"\\lfloor"===e?(l=n="⎢",c="⎣",h="Size4-Regular"):"\\lceil"===e?(n="⎡",l=c="⎢",h="Size4-Regular"):"\\rfloor"===e?(l=n="⎥",c="⎦",h="Size4-Regular"):"\\rceil"===e?(n="⎤",l=c="⎥",h="Size4-Regular"):"("===e?(n="⎛",l="⎜",c="⎝",h="Size4-Regular"):")"===e?(n="⎞",l="⎟",c="⎠",h="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(n="⎧",r="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(n="⎫",r="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e?(n="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e?(n="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e?(n="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"===e?(n="⎫",c="⎩",l="⎪",h="Size4-Regular"):"\\surd"===e?(n="",c="⎷",l="",h="Size4-Regular"):"\\ulcorner"===e?(n="┌",l=c=" "):"\\urcorner"===e?(n="┐",l=c=" "):"\\llcorner"===e?(c="└",l=n=" "):"\\lrcorner"===e&&(n="┘",l=n=" ");const d=m.getCharacterMetrics(wt.getValue("math",n),h),p=d.height+d.depth,u=m.getCharacterMetrics(wt.getValue("math",l),h),f=u.height+u.depth,g=m.getCharacterMetrics(wt.getValue("math",c),h),y=g.height+g.depth;let b=0,x=1;if(null!==r){const t=m.getCharacterMetrics(wt.getValue("math",r),h);b=t.height+t.depth,x=2}const k=p+y+b,v=Math.ceil((s-k)/(x*f)),w=k+v*x*f;let S=a.mathstyle.metrics.axisHeight;i&&(S*=a.mathstyle.sizeMultiplier);const A=w/2-S,C=[];if(C.push(_t(c,h)),null===r)for(let m=0;m","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],zt=[0,1.2,1.8,2.4,3],Et=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],qt=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"stack"}],It=[{type:"small",mathstyle:M.SCRIPTSCRIPT},{type:"small",mathstyle:M.SCRIPT},{type:"small",mathstyle:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Pt(t,e,s,i,a,o){if(!e||0===e.length||"."===e)return Bt(t,a,t);let n;"<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),n=Dt.includes(e)?Et:Lt.includes(e)?It:qt;const r=function(t,e,s,i){for(let o=Math.min(2,3-i.mathstyle.size);oe)return s[o]}var a;return s[s.length-1]}(wt.getValue("math",e),s,n,a);return"small"===r.type?function(t,e,s,i,a,o){const n=St("AMS-Regular",wt.getValue("math",e)),r=N.makeStyleWrap(t,n,a.mathstyle,s,o);return i&&r.setTop((1-a.mathstyle.sizeMultiplier/s.sizeMultiplier)*a.mathstyle.metrics.axisHeight),r.setStyle("color",a.color),"number"==typeof a.opacity&&r.setStyle("opacity",a.opacity),r}(t,e,r.mathstyle,i,a,o):"large"===r.type?Ct(t,e,r.size,i,a,o):Tt(t,e,s,i,a,o)}function Bt(t,e,s){return N.makeSpanOfType(t,"","sizing"+e.mathstyle.adjustTo(M.TEXT)+" nulldelimiter "+(s||""))}var Ot={makeSizedDelim:function(t,e,s,i,a){return"."===e?Bt(t,i,a):("<"===e||"\\lt"===e?e="\\langle":">"!==e&&"\\gt"!==e||(e="\\rangle"),Lt.includes(e)||Dt.includes(e)?Ct(t,e,s,!1,i,a):Ft.includes(e)?Tt(t,e,zt[s],!1,i,a):null)},makeCustomSizedDelim:Pt,makeLeftRightDelim:function(t,e,s,i,a,o){if("."===e)return Bt(t,a,o);const n=a.mathstyle.metrics.axisHeight*a.mathstyle.sizeMultiplier,r=5/m.METRICS.ptPerEm;let l=i+n,c=s-n;c=Math.max(l,c);let h=901*c/500;return l=2*c-r,h=Math.max(h,l),Pt(t,e,h,!0,a,o)}};const $t=N.makeSpan,Rt=N.makeOrd,Kt=N.makeInner,Nt=N.makeHlist,Wt=N.makeVlist,Ht=/\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,Vt=/^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,Ut={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49};class jt{constructor(t,e,s,i){this.mode=t,this.type=e,this.body=s,this.applyStyle(i)}getStyle(){return{color:this.phantom?"transparent":this.color,backgroundColor:this.phantom?"transparent":this.backgroundColor,fontFamily:this.baseFontFamily||this.fontFamily||this.autoFontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(t){if(Object.assign(this,t),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=Ut[this.fontSize]),"math"===this.mode){const t="string"==typeof this.body?this.body:"";this.autoFontFamily="cmr",Vt.test(t)?this.autoFontFamily="math":/\\imath|\\jmath|\\pounds/.test(t)?this.autoFontFamily="mainit":Ht.test(t)||"math"!==this.baseFontFamily||(this.autoFontFamily="cmr")}else"text"===this.mode&&("root"!==this.type&&(this.type=""),delete this.baseFontFamily,delete this.autoFontFamily)}getInitialBaseElement(){let t=this;return Array.isArray(this.body)&&this.body.length>0&&("first"!==this.body[0].type?t=this.body[0].getInitialBaseElement():this.body[1]&&(t=this.body[1].getInitialBaseElement())),t}getFinalBaseElement(){return Array.isArray(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const t=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(t.type)}forEach(t){if(t(this),Array.isArray(this.body))for(const e of this.body)e&&e.forEach(t);else this.body&&"object"==typeof this.body&&t(this.body);if(this.superscript)for(const e of this.superscript)e&&e.forEach(t);if(this.subscript)for(const e of this.subscript)e&&e.forEach(t);if(this.overscript)for(const e of this.overscript)e&&e.forEach(t);if(this.underscript)for(const e of this.underscript)e&&e.forEach(t);if(this.numer)for(const e of this.numer)e&&e.forEach(t);if(this.denom)for(const e of this.denom)e&&e.forEach(t);if(this.index)for(const e of this.index)e&&e.forEach(t);if(this.array)for(const e of this.array)for(const s of e)for(const e of s)e.forEach(t)}filter(t){let e=[];t(this)&&e.push(this);for(const s of["body","superscript","subscript","overscript","underscript","numer","denom","index"])if(Array.isArray(this[s]))for(const i of this[s])i&&(e=e.concat(i.filter(t)));if(Array.isArray(this.array))for(const s of this.array)for(const i of s)i&&(e=e.concat(i.filter(t)));return e}decomposeGroup(t){const e=t.clone({mathstyle:this.mathstyle}),s=Rt(Jt(e,this.body));return this.cssId&&(s.cssId=this.cssId),s.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),s}decomposeArray(t){let e=this.colFormat;e&&0===e.length&&(e=[{align:"l"}]),e||(e=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const s=[];let i=0;for(const h of e)h.align&&i++;for(const h of this.array){let t=0;for(;t0&&(m+=r,a0&&u.push(Wt(t,e,"individualShift"))}const f=[];let g=!1,y=!1,b=0,x=!this.lFence;for(const S of e){if(S.align&&b>=u.length)break;if(S.align&&b0?3*c:7*h.defaultRuleThickness,m=e.metrics.denom1):(c>0?(d=e.metrics.num2,p=c):(d=e.metrics.num3,p=3*h.defaultRuleThickness),m=e.metrics.denom2);const u=o?o.depth:0,f=l?l.height:0;let g;if(0===c){const t=d-u-(f-m);tN.height(s)+N.depth(s)+o&&(o=(o+l-(N.height(s)+N.depth(s)))/2),r.setTop(r.height-N.height(s)-(o+i));const c=$t(null,t.mathstyle.adjustTo(M.TEXT)+" sqrt-line");c.applyStyle(this.getStyle()),c.height=i;const d=Wt(t,[s,o,c,i]);if(!this.index)return this.bind(t,Rt([r,d],"sqrt"));const p=t.clone({mathstyle:M.SCRIPTSCRIPT}),m=$t(Jt(p,this.index),e.adjustTo(M.SCRIPTSCRIPT)),u=Math.max(r.height,d.height),f=Math.max(r.depth,d.depth),g=Wt(t,[m],"shift",-.6*(u-f));return this.bind(t,Rt([$t(g,"root"),r,d],"sqrt"))}decomposeAccent(t){const e=t.mathstyle;let s=Jt(t.cramp(),this.body);(this.superscript||this.subscript)&&(s=this.attachSupsub(t,Rt(s),"mord"));let i=0;Array.isArray(this.body)&&1===this.body.length&&this.body[0].isCharacterBox()&&(i=N.skew(s));const a=Math.min(N.height(s),e.metrics.xHeight),o=N.makeSymbol("Main-Regular",this.accent,"math");o.italic=0;const n="⃗"===this.accent?" accent-vec":"";let r=$t($t(o),"accent-body"+n);return r=Wt(t,[s,-a,r]),r.children[1].setLeft(2*i),Rt(r,"accent")}decomposeLine(t){const e=t.mathstyle,s=Jt(t.cramp(),this.body),i=h.defaultRuleThickness/e.sizeMultiplier,a=$t(null,t.mathstyle.adjustTo(M.TEXT)+" "+this.position+"-line");let o;if(a.height=i,a.maxFontSize=1,"overline"===this.position)o=Wt(t,[s,3*i,a,i]);else{const e=$t(s);o=Wt(t,[i,a,3*i,e],"top",N.height(e))}return Rt(o,this.position)}decomposeOverunder(t){const e=Jt(t,this.body),s=t.clone({mathstyle:"scriptstyle"}),i=this.overscript?$t(Jt(s,this.overscript),t.mathstyle.adjustTo(s.mathstyle)):null,a=this.underscript?$t(Jt(s,this.underscript),t.mathstyle.adjustTo(s.mathstyle)):null;return Xt(t,e,0,0,i,a,this.mathtype||"mrel")}decomposeOverlap(t){const e=$t(Jt(t,this.body),"inner");return Rt([e,$t(null,"fix")],"left"===this.align?"llap":"rlap")}decomposeRule(t){const e=t.mathstyle,s=Rt("","rule");let i=this.shift&&!isNaN(this.shift)?this.shift:0;i/=e.sizeMultiplier;const a=this.width/e.sizeMultiplier,o=this.height/e.sizeMultiplier;return s.setStyle("border-right-width",a,"em"),s.setStyle("border-top-width",o,"em"),s.setStyle("margin-top",-(o-i),"em"),s.setStyle("border-color",t.color),s.width=a,s.height=o+i,s.depth=-i,s}decomposeOp(t){const e=t.mathstyle;let s,i=!1;e.size===M.DISPLAY.size&&"string"==typeof this.body&&"\\smallint"!==this.body&&(i=!0);let a=0,o=0;if(this.symbol){const n=i?"Size2-Regular":"Size1-Regular";s=N.makeSymbol(n,this.body,"op-symbol "+(i?"large-op":"small-op")),s.type="mop",a=(s.height-s.depth)/2-e.metrics.axisHeight*e.sizeMultiplier,o=s.italic,this.bind(t,s)}else Array.isArray(this.body)?(s=N.makeOp(Jt(t,this.body)),this.bind(t,s)):s=this.makeSpan(t,this.body);if(this.superscript||this.subscript){const i=this.limits||"auto";return this.alwaysHandleSupSub||"limits"===i||"auto"===i&&e.size===M.DISPLAY.size?this.attachLimits(t,s,a,o):this.attachSupsub(t,s,"mop")}return this.symbol&&s.setTop(a),s}decomposeBox(t){const e=Rt(Jt(t,this.body)),s=$t();s.setStyle("position","absolute");const i="number"==typeof this.padding?this.padding:h.fboxsep;s.setStyle("height",e.height+e.depth+2*i,"em"),0!==i?s.setStyle("width","calc(100% + "+2*i+"em)"):s.setStyle("width","100%"),s.setStyle("top",-i,"em"),s.setStyle("left",-i,"em"),s.setStyle("z-index","-1"),this.backgroundcolor&&s.setStyle("background-color",this.backgroundcolor),this.framecolor&&s.setStyle("border",h.fboxrule+"em solid "+this.framecolor),this.border&&s.setStyle("border",this.border),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("vertical-align",-e.depth+i,"em");const a=$t([s,e]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-i+e.depth,"em"),a.height=e.height+i,a.depth=e.depth+i,a.setLeft(i),a.setRight(i),a}decomposeEnclose(t){const e=Rt(Jt(t,this.body)),s="auto"===this.padding?.2:this.padding;e.setStyle("padding",s,"em"),e.setStyle("display","inline-block"),e.setStyle("height",e.height+e.depth,"em"),e.setStyle("left",-s,"em"),this.backgroundcolor&&"transparent"!==this.backgroundcolor&&e.setStyle("background-color",this.backgroundcolor);let i="";if(this.notation.box&&e.setStyle("border",this.borderStyle),this.notation.actuarial&&(e.setStyle("border-top",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(e.setStyle("border-bottom",this.borderStyle),e.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(e.setStyle("border-radius",(N.height(e)+N.depth(e))/2,"em"),e.setStyle("border",this.borderStyle)),this.notation.circle&&(e.setStyle("border-radius","50%"),e.setStyle("border",this.borderStyle)),this.notation.top&&e.setStyle("border-top",this.borderStyle),this.notation.left&&e.setStyle("border-left",this.borderStyle),this.notation.right&&e.setStyle("border-right",this.borderStyle),this.notation.bottom&&e.setStyle("border-bottom",this.borderStyle),this.notation.horizontalstrike&&(i+='0?s.setWidth(this.width):s.setStyle("margin-left",this.width,"em");else{const t={qquad:"qquad",quad:"quad",enspace:"enspace",";":"thickspace",":":"mediumspace",",":"thinspace","!":"negativethinspace"}[this.body]||"quad";s=$t("​","mspace "+t)}else"mathstyle"===this.type?t.setMathstyle(this.mathstyle):"box"===this.type?s=this.decomposeBox(t):"enclose"===this.type?s=this.decomposeEnclose(t):"command"===this.type||"error"===this.type?(s=this.makeSpan(t,this.body),s.classes="",this.error&&(s.classes+=" ML__error"),this.suggestion&&(s.classes+=" ML__suggestion")):"placeholder"===this.type?s=this.makeSpan(t,"⬚"):"first"===this.type&&(s=this.makeSpan(t,"​"));if(!s)return s;if(this.caret&&"styling"!==this.type&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(Array.isArray(s)?s[s.length-1].caret=this.caret:s.caret=this.caret),this.containsCaret&&(Array.isArray(s)?(s[0].classes=(s[0].classes||"")+" ML__contains-caret",s[s.length-1].classes=(s[s.length-1].classes||"")+" ML__contains-caret"):s.classes=(s.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(Array.isArray(s)){const e=s[s.length-1];s[s.length-1]=this.attachSupsub(t,e,e.type)}else s=[this.attachSupsub(t,s,s.type)];return Array.isArray(s)?s:[s]}attachSupsub(t,e,s){if(!this.superscript&&!this.subscript)return e;const i=t.mathstyle;let a=null,o=null;if(this.superscript){const e=Jt(t.sup(),this.superscript);a=$t(e,i.adjustTo(i.sup()))}if(this.subscript){const e=Jt(t.sub(),this.subscript);o=$t(e,i.adjustTo(i.sub()))}let n,r=0,l=0;this.isCharacterBox()||(r=N.height(e)-i.metrics.supDrop,l=N.depth(e)+i.metrics.subDrop),n=i===M.DISPLAY?i.metrics.sup1:i.cramped?i.metrics.sup3:i.metrics.sup2;const c=M.TEXT.sizeMultiplier*i.sizeMultiplier,d=.5/h.ptPerEm/c;let p=null;if(o&&a){r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),l=Math.max(l,i.metrics.sub2);const s=h.defaultRuleThickness;if(r-N.depth(a)-(N.height(o)-l)<4*s){l=4*s-(r-a.depth)+N.height(o);const t=.8*i.metrics.xHeight-(r-N.depth(a));t>0&&(r+=t,l-=t)}p=Wt(t,[o,l,a,-r],"individualShift"),this.symbol&&p.children[0].setLeft(-N.italic(e))}else o&&!a?(l=Math.max(l,i.metrics.sub1,N.height(o)-.8*i.metrics.xHeight),p=Wt(t,[o],"shift",l),p.children[0].setRight(d),this.isCharacterBox()&&p.children[0].setLeft(-N.italic(e))):!o&&a&&(r=Math.max(r,n,a.depth+.25*i.metrics.xHeight),p=Wt(t,[a],"shift",-r),p.children[0].setRight(d));const m=$t(p,"msubsup");return this.caret&&(m.caret=this.caret),N.makeSpanOfType(s,[e,m])}attachLimits(t,e,s,i){const a=this.superscript?$t(Jt(t.sup(),this.superscript),t.mathstyle.adjustTo(t.mathstyle.sup())):null,o=this.subscript?$t(Jt(t.sub(),this.subscript),t.mathstyle.adjustTo(t.mathstyle.sub())):null;return Xt(t,e,s,i,a,o,"mop")}bind(t,e){return"first"!==this.type&&"​"!==this.body&&(this.id=function(t){let e;return"boolean"==typeof t.generateID&&t.generateID?e=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36):"object"==typeof t.generateID&&(e=t.generateID.overrideID?t.generateID.overrideID:t.generateID.seed.toString(36),t.generateID.seed+=1),e}(t),this.id&&(e.attributes||(e.attributes={}),e.attributes["data-atom-id"]=this.id)),e}makeSpan(t,e){const s="textord"===this.type?"mord":this.type,i=N.makeSpanOfType(s,e),a=this.getStyle();i.applyStyle(a);const o=a&&a.fontSize?a.fontSize:"size5";return o!==t.parentSize?(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+o):t.parentSize!==t.size&&(i.classes+=" sizing reset-"+t.parentSize,i.classes+=" "+t.size),i.maxFontSize=Math.max(i.maxFontSize,t.sizeMultiplier||1),"text"===this.mode&&(i.classes+=" ML__text"),t.mathstyle.isTight()&&(i.isTight=!0),"math"!==this.mode&&(i.italic=0),i.setRight(i.italic),"number"==typeof t.opacity&&i.setStyle("opacity",t.opacity),this.bind(t,i),this.caret&&(this.superscript||this.subscript||(i.caret=this.caret,t.mathstyle.isTight()&&(i.isTight=!0))),i}}function Gt(t){const e=$t("​","arraycolsep");return e.setWidth(t,"em"),e}function Zt(t,e,s,i){const a=[];for(const o of e){const e=$t(Jt(t,i));e.depth=o.depth,e.height=o.height,a.push(e),a.push(o.pos-s)}return Wt(t,a,"individualShift")}function Xt(t,e,s,i,a,o,n){if(!a&&!o)return e;e=$t(e);let r=0,l=0;a&&(r=Math.max(h.bigOpSpacing1,h.bigOpSpacing3-a.depth)),o&&(l=Math.max(h.bigOpSpacing2,h.bigOpSpacing4-o.height));let c=null;if(o&&a){const n=h.bigOpSpacing5+N.height(o)+N.depth(o)+l+N.depth(e)+s;c=Wt(t,[h.bigOpSpacing5,o,l,e,r,a,h.bigOpSpacing5],"bottom",n),c.children[0].setLeft(-i),c.children[2].setLeft(i)}else if(o&&!a){const a=N.height(e)-s;c=Wt(t,[h.bigOpSpacing5,o,l,e],"top",a),c.children[0].setLeft(-i)}else if(!o&&a){const o=N.depth(e)+s;c=Wt(t,[e,r,a,h.bigOpSpacing5],"bottom",o),c.children[1].setLeft(i)}return N.makeSpanOfType(n,c,"op-limits")}function Jt(t,e){function s(t){return"mord"===t.type&&/[0-9,.]/.test(t.latex)}function i(t){return"text"===t.mode}t instanceof _||(t=new _(t));const a=!t.generateID||!t.generateID.groupNumbers;let o=[];if(Array.isArray(e)){if(0===e.length)return o;if(1===e.length)o=e[0].decompose(t),o&&a&&e[0].isSelected&&o.forEach(t=>t.selected(!0));else{let n="none",r=e[1].type,l=[],c=null,h=!0,d=null;for(let p=0;pt.selected(!0))):(l.length>0&&(o=[...o,...l],l=[]),o=o.concat(n))}n=e[p].getFinalBaseElement().type,r=e[p+1]?e[p+1].getInitialBaseElement().type:"none"}l.length>0&&(o=[...o,...l],l=[])}}else e&&(o=e.decompose(t),o&&a&&e.isSelected&&o.forEach(t=>t.selected(!0)));if(!o||0===o.length)return null;if(t.mathstyle!==t.parentMathstyle){const e=t.mathstyle.sizeMultiplier/t.parentMathstyle.sizeMultiplier;for(const t of o)t.height*=e,t.depth*=e}if(t.size!==t.parentSize){const e=Ut[t.size]/Ut[t.parentSize];for(const t of o)t.height*=e,t.depth*=e}return o}var Yt={MathAtom:jt,decompose:Jt,makeRoot:function(t,e){const s=new jt(t=t||"math","root",e||[]);return 0!==s.body.length&&"first"===s.body[0].type||s.body.unshift(new jt("","first")),s},GREEK_REGEX:Ht};const Qt={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},te={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};var ee=function(t){const e=t.toLowerCase().split("!");let s,i,a,o=255,n=255,r=255,l=-1;const c=e.length>0&&"-"===e[0].charAt(0);c&&(e[0]=e[0].slice(1));for(let h=0;h=0&&(o=(1-l)*o+l*s,n=(1-l)*n+l*i,r=(1-l)*r+l*a,l=-1),h+1=0&&(o=l*o+(1-l)*s,n=l*n+(1-l)*i,r=l*r+(1-l)*a),c&&(o=255-o,n=255-n,r=255-r),"#"+("00"+Math.round(o).toString(16)).slice(-2)+("00"+Math.round(n).toString(16)).slice(-2)+("00"+Math.round(r).toString(16)).slice(-2)},se=function(t){let e=t.toUpperCase();for(const s in te)if(te[s]===e){e=s;break}for(const s in Qt)if(Qt[s]===e){e=s;break}return e},ie=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],ae=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"];const oe=Yt.MathAtom;class ne{constructor(t,e,s){this.tokens=t,this.index=0,this.args=e,this.macros=s,this.mathList=[],this.style={},this.parseMode="math",this.tabularMode=!1,this.endCount=0}swapMathList(t){const e=this.mathList;return this.mathList=t||[],e}swapParseMode(t){const e=this.parseMode;return this.parseMode=t,e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index=t.length}const a=t.toUpperCase()===i.toUpperCase();return a||(this.index=e),a}scanString(){let t="",e=this.end();for(;!e;){if(this.hasLiteral("]"))e=!0;else if(this.hasToken("literal"))t+=this.get().value;else if(this.skipWhitespace())t+=" ";else if(this.hasToken("command")){const e=this.get();"space"===e.value?t+=" ":t+=e.value}else e=!0;e=e||this.end()}return t}scanColor(){return ee(this.scanString())}scanNumber(t){const e=this.parseLiteral("-");e||this.parseLiteral("+"),this.skipWhitespace(),t=!!t;let s=10,i=/[0-9]/;this.parseLiteral("'")?(s=8,i=/[0-7]/,t=!0):(this.parseLiteral('"')||this.parseLiteral("x"))&&(s=16,i=/[0-9A-F]/,t=!0);let a="";for(;this.hasLiteralPattern(i);)a+=this.get().value;if(!t&&(this.parseLiteral(".")||this.parseLiteral(",")))for(a+=".";this.hasLiteralPattern(i);)a+=this.get().value;const o=t?parseInt(a,s):parseFloat(a);return e?-o:o}scanDimen(){const t=this.scanNumber(!1);let e;return this.skipWhitespace(),e=this.parseKeyword("pt")?m.toEm(t,"pt"):this.parseKeyword("mm")?m.toEm(t,"mm"):this.parseKeyword("cm")?m.toEm(t,"cm"):this.parseKeyword("ex")?m.toEm(t,"ex"):this.parseKeyword("px")?m.toEm(t,"px"):this.parseKeyword("em")?m.toEm(t,"em"):this.parseKeyword("bp")?m.toEm(t,"bp"):this.parseKeyword("dd")?m.toEm(t,"dd"):this.parseKeyword("pc")?m.toEm(t,"pc"):this.parseKeyword("in")?m.toEm(t,"in"):this.parseKeyword("mu")?m.toEm(t,"mu"):m.toEm(t,"pt"),e}scanSkip(){const t=this.scanDimen();return this.skipWhitespace(),this.parseKeyword("plus")&&this.scanDimen(),this.skipWhitespace(),this.parseKeyword("minus")&&this.scanDimen(),t}scanColspec(){this.skipWhitespace();const t=[];for(;!this.end()&&!this.hasToken("}")&&!this.hasLiteral("]");)if(this.hasLiteral()){const e=this.get().value;if("lcr".includes(e))t.push({align:e});else if("|"===e)t.push({rule:!0});else if("@"===e){if(this.parseToken("{")){const e=this.swapParseMode("math");t.push({gap:this.scanImplicitGroup(t=>"}"===t.type)}),this.swapParseMode(e)}this.parseToken("}")}}return t}scanModeSet(){let t;if(this.parseCommand("(")&&(t=")"),!t&&this.parseCommand("[")&&(t="]"),!t)return null;const e=this.swapParseMode("math"),s=new oe("math","group");return s.mathstyle=")"===t?"textstyle":"displaystyle",s.body=this.scanImplicitGroup(e=>"command"===e.type&&e.value===t),this.parseCommand(t),this.swapParseMode(e),s.body&&0!==s.body.length?s:null}scanModeShift(){if(!this.hasToken("$")&&!this.hasToken("$$"))return null;const t=this.get().type,e=new oe("math","group");e.mathstyle="$"===t?"textstyle":"displaystyle",e.latexOpen="textstyle"===e.mathstyle?"$":"$$",e.latexClose=e.latexOpen;const s=this.swapParseMode("math");return e.body=this.scanImplicitGroup(e=>e.type===t),this.parseToken(t),this.swapParseMode(s),e.body&&0!==e.body.length?e:null}scanEnvironment(){if(!this.parseCommand("begin"))return null;const t=this.scanArg("string"),e=wt.getEnvironmentInfo(t),s=[];if(e&&e.params)for(const p of e.params)if(p.optional){const t=this.scanOptionalArg(p.type);s.push(t)}else s.push(this.scanArg(p.type));const i=this.parseMode,a=this.tabularMode,o=this.swapMathList([]);this.tabularMode=e.tabular;const n=[],r=[];let l=[],c=!1;do{if(c=this.end(),!c&&this.parseCommand("end")&&(c=this.scanArg("string")===t),!c)if(this.parseColumnSeparator())l.push(this.swapMathList([]));else if(this.parseRowSeparator()){l.push(this.swapMathList([]));let t=0;this.skipWhitespace(),this.parseLiteral("[")&&(t=this.scanDimen(),this.skipWhitespace(),this.parseLiteral("]")),r.push(t||0),n.push(l),l=[]}else this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!c);l.push(this.swapMathList([])),l.length>0&&n.push(l);const h=this.swapMathList(o);if(this.parseMode=i,this.tabularMode=a,!e.tabular&&0===h.length)return null;if(e.tabular&&0===n.length)return null;const d=new oe(this.parseMode,"array",h,e.parser?e.parser(t,s,n):{});return d.array=n,d.rowGaps=r,d.env={...e},d.env.name=t,d}scanImplicitGroup(t){const e=this.style;t||(t=t=>"}"===t.type||"literal"===t.type&&"&"===t.value||"command"===t.type&&/^(end|cr|\\)$/.test(t.value));let s=null,i=null;const a=this.swapMathList([]);for(;!this.end()&&!t(this.peek());)if(this.hasImplicitCommand(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"])){this.parseMode="math";const t=new oe("math","mathstyle");t.mathstyle=this.get().value,this.mathList.push(t)}else this.hasInfixCommand()&&!s?(s=this.get(),i=this.swapMathList([])):this.parseAtom();let o;if(s){const t=this.swapMathList(a),e=wt.getInfo("\\"+s.value,"math",this.macros);o=e?[new oe(this.parseMode,e.type,e.value||s.value,e.parse?e.parse("\\"+s.value,[i,t]):null)]:[new oe(this.parseMode,"mop",s.value)]}else o=this.swapMathList(a);return this.style=e,o}scanGroup(){if(!this.parseToken("{"))return null;const t=new oe(this.parseMode,"group");return t.body=this.scanImplicitGroup(t=>"}"===t.type),this.parseToken("}"),t.latexOpen="{",t.latexClose="}",t}scanSmartFence(){if(this.skipWhitespace(),!this.parseLiteral("("))return null;const t=new oe(this.parseMode,"leftright");t.leftDelim="(",t.inner=!1;const e=this.swapMathList([]);let s=1;for(;!this.end()&&0!==s;)this.hasLiteral("(")&&(s+=1),this.hasLiteral(")")&&(s-=1),0!==s&&this.parseAtom();return 0===s&&this.parseLiteral(")"),t.rightDelim=0===s?")":"?",t.body=this.swapMathList(e),t}scanDelim(){this.skipWhitespace();const t=this.get();if(!t)return null;let e=".";"command"===t.type?e="\\"+t.value:"literal"===t.type&&(e=t.value);const s=wt.getInfo(e,"math",this.macros);return s?"mopen"===s.type||"mclose"===s.type?e:/^(\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:null:null}scanLeftRight(){if(this.parseCommand("right")||this.parseCommand("mright"))return null;const t=this.style;let e="right";if(!this.parseCommand("left")){if(!this.parseCommand("mleft"))return null;e="mright"}const s=this.scanDelim();if(!s)return null;const i=this.swapMathList([]);for(;!this.end()&&!this.parseCommand(e);)this.parseAtom();this.style=t;const a=this.scanDelim(),o=new oe(this.parseMode,"leftright");return o.leftDelim=s,o.rightDelim=a,o.inner="right"===e,o.body=this.swapMathList(i),o}parseSupSub(){if("math"!==this.parseMode)return!1;let t=!1;for(;this.hasLiteral("^")||this.hasLiteral("_")||this.hasLiteral("'");){let e;if(this.hasLiteral("^")?e="superscript":this.hasLiteral("_")&&(e="subscript"),this.parseLiteral("^")||this.parseLiteral("_")){const s=this.scanArg();if(s){const i=this.lastMathAtom();i[e]=i[e]||[],i[e]=i[e].concat(s),t=!0}}else if(this.parseLiteral("'")){const e=this.lastMathAtom();e.superscript=e.superscript||[],e.superscript.push(new oe(e.parseMode,"mord","′")),t=!0}}return t}parseLimits(){if(this.parseCommand("limits")){const t=this.lastMathAtom();return t.limits="limits",t.explicitLimits=!0,!0}if(this.parseCommand("nolimits")){const t=this.lastMathAtom();return t.limits="nolimits",t.explicitLimits=!0,!0}return!1}scanOptionalArg(t){if(t=t&&"auto"!==t?t:this.parseMode,this.skipWhitespace(),!this.parseLiteral("["))return null;const e=this.parseMode;this.parseMode=t;const s=this.swapMathList();let i;for(;!this.end()&&!this.parseLiteral("]");)if("string"===t)i=this.scanString();else if("number"===t)i=this.scanNumber();else if("dimen"===t)i=this.scanDimen();else if("skip"===t)i=this.scanSkip();else if("colspec"===t)i=this.scanColspec();else if("color"===t)i=this.scanColor()||"#ffffff";else if("bbox"===t){const t=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const e of t){const t=ee(e);if(t)i=i||{},i.backgroundcolor=t;else{const t=e.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(t)i=i||{},i.padding=m.toEm(t[1],t[2]);else{const t=e.match(/^\s*border\s*:\s*(.*)/);t&&(i=i||{},i.border=t[1])}}}}else this.mathList=this.mathList.concat(this.scanImplicitGroup(t=>"literal"===t.type&&"]"===t.value));this.parseMode=e;const a=this.swapMathList(s);return i||a}scanArg(t){let e;if(t=t&&"auto"!==t?t:this.parseMode,this.parseFiller(),!this.parseToken("{")){if("delim"===t)return this.scanDelim()||".";if(/^(math|text)$/.test(t)){const e=this.parseMode;this.parseMode=t;const s=this.scanToken();return this.parseMode=e,Array.isArray(s)?s:s?[s]:null}}if(this.hasToken("#")){const t=this.get();return this.skipUntilToken("}"),"?"===t.value?this.placeholder():this.args?void 0===this.args[t.value]&&void 0!==this.args["?"]?this.placeholder():this.args[t.value]||null:null}const s=this.parseMode;this.parseMode=t;const i=this.swapMathList([]);if("string"===t)e=this.scanString(),this.skipUntilToken("}");else if("number"===t)e=this.scanNumber(),this.skipUntilToken("}");else if("dimen"===t)e=this.scanDimen(),this.skipUntilToken("}");else if("skip"===t)e=this.scanSkip(),this.skipUntilToken("}");else if("colspec"===t)e=this.scanColspec(),this.skipUntilToken("}");else if("color"===t)e=this.scanColor()||"#ffffff",this.skipUntilToken("}");else if("delim"===t)e=this.scanDelim()||".",this.skipUntilToken("}");else do{this.mathList=this.mathList.concat(this.scanImplicitGroup())}while(!this.parseToken("}")&&!this.end());this.parseMode=s;const a=this.swapMathList(i);return e||a}scanToken(){const t=this.get();if(!t)return null;let e=null;if("space"===t.type)"text"===this.parseMode&&(e=new oe("text",""," ",this.style));else if("placeholder"===t.type)e=new oe(this.parseMode,"placeholder",t.value),e.captureSelection=!0;else if("command"===t.type){if("placeholder"===t.value)e=new oe(this.parseMode,"placeholder",this.scanArg("string"),this.style),e.captureSelection=!0;else if("char"===t.value){let t=Math.floor(this.scanNumber(!0));(!isFinite(t)||t<0||t>1114111)&&(t=10067),e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(t)),e.latex='{\\char"'+("000000"+t.toString(16)).toUpperCase().substr(-6)+"}"}else if("hskip"===t.value||"kern"===t.value){const s=this.scanSkip();isFinite(s)&&(e=new oe(this.parseMode,"spacing",null,this.style),e.width=s),e.latex="\\"+t.value}else if(e=this.scanMacro(t.value),!e){const s=wt.getInfo("\\"+t.value,this.parseMode,this.macros),i=[];let a="",o="";if(s&&s.params)for(const t of s.params)if(t.optional){const e=this.scanOptionalArg(t.type);i.push(e)}else if(t.type.endsWith("*"))o=t.type.slice(0,-1);else{const e=this.scanArg(t.type);if(e&&1===e.length&&"placeholder"===e[0].type&&t.placeholder&&(e[0].value=t.placeholder),e)i.push(e);else if(t.placeholder){const e=new oe(this.parseMode,"placeholder",t.placeholder);e.captureSelection=!0,i.push([e])}else i.push(this.placeholder());"math"!==t.type&&"string"==typeof e&&(a+=e)}if(s&&!s.infix){if(s.parse){const a=s.parse("\\"+t.value,i);if(a.type)e=new oe(this.parseMode,s.type,o?this.scanArg(o):null,{...this.style,...a});else{const t=this.parseMode;if(a.mode&&(this.parseMode=a.mode,delete a.mode),o){const t=this.style;this.style={...this.style,...a},e=this.scanArg(o),this.style=t}else this.style={...this.style,...a};this.parseMode=t}}else{const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new oe(this.parseMode,s.type||"mop",s.value||t.value,i),s.skipBoundary&&(e.skipBoundary=!0)}if(e&&!/^(llap|rlap|class|cssId)$/.test(t.value)&&(e.latex="\\"+t.value,a&&(e.latex+="{"+a+"}"),e.isFunction&&this.smartFence)){const t=this.scanSmartFence();t&&(e=[e,t])}}s||(e=new oe(this.parseMode,"error","\\"+t.value),e.latex="\\"+t.value)}}else if("literal"===t.type){const s=wt.getInfo(t.value,this.parseMode,this.macros);if(s){const i={...this.style};s.baseFontFamily&&(i.baseFontFamily=s.baseFontFamily),e=new oe(this.parseMode,s.type,s.value||t.value,i),s.isFunction&&(e.isFunction=!0)}else e=new oe(this.parseMode,"math"===this.parseMode?"mord":"",t.value,this.style);if(e.latex=wt.matchCodepoint(this.parseMode,t.value.codePointAt(0)),s&&s.isFunction&&this.smartFence){const t=this.scanSmartFence();t&&(e=[e,t])}}else"#"===t.type&&("?"===t.value?e=this.placeholder():this.args&&(e=this.args[t.value]||this.placeholder()));return e}scanMacro(t){if(!this.macros||!this.macros[t])return null;const e={};let s,i=0;"string"==typeof this.macros[t]?(s=this.macros[t],/(^|[^\\])#1/.test(s)&&(i=1),/(^|[^\\])#2/.test(s)&&(i=2),/(^|[^\\])#3/.test(s)&&(i=3),/(^|[^\\])#4/.test(s)&&(i=4),/(^|[^\\])#5/.test(s)&&(i=5),/(^|[^\\])#6/.test(s)&&(i=6),/(^|[^\\])#7/.test(s)&&(i=7),/(^|[^\\])#8/.test(s)&&(i=8),/(^|[^\\])#9/.test(s)&&(i=9)):(s=this.macros[t].def,i=this.macros[t].args||0);for(let n=1;n<=i;n++)e[n]=this.scanArg();this.args&&"string"==typeof this.args["?"]&&(e["?"]=this.args["?"]);const a=new oe(this.parseMode,"group",re(n(s),this.parseMode,e,this.macros));a.captureSelection=!0,a.latex="\\"+t;let o="";for(let n=1;n<=i;n++){if(o+="{",Array.isArray(e[n]))for(let t=0;t1&&(e.extent=parseInt(s[1]));const i=s[0].split("/");for(const a of i){const t=a.match(/([^:]*):(.*)/);t&&e.path.push({relation:t[1],offset:parseInt(t[2])})}return e}var de={pathFromString:he,pathToString:ce,pathDistance:function(t,e){let s=0,i=-1,a=!1;for(;!a;)i+=1,a=i>=t.length||i>=e.length,a=a||!(t[i].relation===e[i].relation&&t[i].offset===e[i].offset);return s=i===t.length&&i===e.length?0:i+1===t.length&&i+1===e.length&&t[i].relation===e[i].relation?1:2,s},pathCommonAncestor:function(t,e){const s=[],i=Math.min(t.length-1,e.length-1);let a=0;for(;a<=i&&t[a].relation===e[a].relation&&t[a].offset===e[a].offset;)s.push(t[a]),a+=1;return s},clone:function(t){return he(ce(t)).path}};const pe={Left:"moveToPreviousChar",Right:"moveToNextChar",Up:"moveUp",Down:"moveDown","Shift-Left":"extendToPreviousChar","Shift-Right":"extendToNextChar","Shift-Up":"extendUp","Shift-Down":"extendDown",Backspace:"deletePreviousChar","Alt-Del":"deletePreviousChar",Del:"deleteNextChar","Alt-Backspace":"deleteNextChar","Alt-Left":"moveToPreviousWord","Alt-Right":"moveToNextWord","Alt-Shift-Left":"extendToPreviousWord","Alt-Shift-Right":"extendToNextWord","Ctrl-Left":"moveToGroupStart","Ctrl-Right":"moveToGroupEnd","Ctrl-Shift-Left":"extendToGroupStart","Ctrl-Shift-Right":"extendToGroupEnd","math:Spacebar":"moveAfterParent","math:Shift-Spacebar":"moveBeforeParent",Home:"moveToMathFieldStart","mac:Meta-Left":"moveToMathFieldStart","Shift-Home":"extendToMathFieldStart","mac:Meta-Shift-Left":"extendToMathFieldStart",End:"moveToMathFieldEnd","mac:Meta-Right":"moveToMathFieldEnd","Shift-End":"extendToMathFieldEnd","mac:Meta-Shift-Right":"extendToMathFieldEnd",PageUp:"moveToGroupStart",PageDown:"moveToGroupEnd","math:Tab":"moveToNextPlaceholder","math:F8":"moveToNextPlaceholder","math:Shift-Tab":"moveToPreviousPlaceholder","math:Shift-F8":"moveToPreviousPlaceholder","text:Tab":"moveToNextPlaceholder","text:F8":"moveToNextPlaceholder","text:Shift-Tab":"moveToPreviousPlaceholder","text:Shift-F8":"moveToPreviousPlaceholder","math:Esc":["switch-mode","command"],"math:Backslash":["switch-mode","command"],"math:IntlBackslash":["switch-mode","command"],"math:Alt-Equal":["apply-style",{mode:"text"}],"text:Alt-Equal":["apply-style",{mode:"math"}],"command:Esc":["complete",{discard:!0}],"command:Tab":["complete",{acceptSuggestion:!0}],"command:Return":"complete","command:Enter":"complete","command:Shift-Esc":["complete",{discard:!0}],"command:Down":"nextSuggestion","ios:command:Tab":"nextSuggestion","command:Up":"previousSuggestion","!mac:Ctrl-KeyA":"selectAll","mac:Meta-KeyA":"selectAll",Cut:"cut",Copy:"copy",Paste:"paste",Clear:"delete","!mac:Ctrl-KeyZ":"undo","mac:Meta-KeyZ":"undo",Undo:"undo","!mac:Ctrl-KeyY":"redo","mac:Meta-Shift-KeyY":"redo","!mac:Ctrl-Shift-KeyZ":"redo","mac:Meta-Shift-KeyZ":"redo",Redo:"redo",EraseEof:"deleteToGroupEnd","mac:Ctrl-KeyB":"moveToPreviousChar","mac:Ctrl-KeyF":"moveToNextChar","mac:Ctrl-KeyP":"moveUp","mac:Ctrl-KeyN":"moveDown","mac:Ctrl-KeyA":"moveToMathFieldStart","mac:Ctrl-KeyE":"moveToMathFieldEnd","mac:Ctrl-Shift-KeyB":"extendToPreviousChar","mac:Ctrl-Shift-KeyF":"extendToNextChar","mac:Ctrl-Shift-KeyP":"extendUp","mac:Ctrl-Shift-KeyN":"extendDown","mac:Ctrl-Shift-KeyA":"extendToMathFieldStart","mac:Ctrl-Shift-KeyE":"extendToMathFieldEnd","mac:Ctrl-Alt-KeyB":"moveToPreviousWord","mac:Ctrl-Alt-KeyF":"moveToNextWord","mac:Ctrl-Shift-Alt-KeyB":"extendToPreviousWord","mac:Ctrl-Shift-Alt-KeyF":"extendToNextWord","mac:Ctrl-KeyH":"deletePreviousChar","mac:Ctrl-KeyD":"deleteNextChar","mac:Ctrl-KeyL":"scrollIntoView","mac:Ctrl-KeyT":"transpose","math:Shift-Quote":["switch-mode","text","","“"],"text:Shift-Quote":["switch-mode","math","”",""],"math:Ctrl-Digit2":["insert","\\sqrt{#0}"],"math:Ctrl-Digit5":"moveToOpposite","math:Ctrl-Digit6":"moveToSuperscript","math:Ctrl-Minus":"moveToSubscript","math:Alt-BracketLeft":["insert","\\left\\lbrack #0 \\right\\rbrack"],"math:Alt-Shift-BracketLeft":["insert","\\left\\lbrace #0 \\right\\rbrace"],"math:Return":"addRowAfter","math:Enter":"addRowAfter","math:Ctrl-Comma":"addColumnAfter","math:Alt-KeyQ":["insert","\\theta"],"math:Alt-KeyP":["insert","\\pi"],"math:Alt-KeyV":["insert","\\sqrt{#0}"],"math:Alt-KeyW":["insert","\\sum_{i=#?}^{#?}"],"math:Alt-KeyB":["insert","\\int_{#?}^{#?}"],"math:Alt-KeyU":["insert","\\cup"],"math:Alt-KeyN":["insert","\\cap"],"math:Alt-KeyO":["insert","\\emptyset"],"math:Alt-KeyD":["insert","\\differentialD"],"math:Alt-Shift-KeyO":["insert","\\varnothing"],"math:Alt-Shift-KeyD":["insert","\\partial"],"math:Alt-Shift-KeyP":["insert","\\prod_{i=#?}^{#?}"],"math:Alt-Shift-KeyU":["insert","\\bigcup"],"math:Alt-Shift-KeyN":["insert","\\bigcap"],"math:Alt-Shift-KeyA":["insert","\\forall"],"math:Alt-Shift-KeyE":["insert","\\exists"],"math:Alt-Digit5":["insert","\\infty"],"math:Alt-Digit6":["insert","\\wedge"],"math:Alt-Shift-Digit6":["insert","\\vee"],"math:Alt-Digit9":["insert","("],"math:Alt-Digit0":["insert",")"],"math:Alt-Shift-Backslash":["insert","|"],"math:Alt-Backslash":["insert","\\backslash"],"math:Slash":["insert","\\frac{#@}{#?}"],"math:Alt-Slash":["insert","\\frac{#?}{#@}"],"math:NumpadDivide":["insert","\\frac{#@}{#?}"],"math:Alt-NumpadDivide":["insert","\\frac{#?}{#@}"],"math:Shift-Backquote":["insert","\\~"],"math:Alt-Shift-Slash":["insert","\\/"],"Alt-Shift-KeyK":"toggleKeystrokeCaption","Alt-Space":"toggleVirtualKeyboard","mac:Ctrl-Meta-Up":["speak","parent",{withHighlighting:!1}],"!mac:Ctrl-Alt-Up":["speak","parent",{withHighlighting:!1}],"mac:Ctrl-Meta-Down":["speak","all",{withHighlighting:!1}],"!mac:Ctrl-Alt-Down":["speak","all",{withHighlighting:!1}],"mac:Ctrl-Meta-Left":["speak","left",{withHighlighting:!1}],"!mac:Ctrl-Alt-Left":["speak","left",{withHighlighting:!1}],"mac:Ctrl-Meta-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Right":["speak","right",{withHighlighting:!1}],"!mac:Ctrl-Alt-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Period":["speak","selection",{withHighlighting:!1}],"mac:Ctrl-Meta-Shift-Up":["speak","parent",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Up":["speak","parent",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Down":["speak","all",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Down":["speak","all",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Left":["speak","left",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Left":["speak","left",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Right":["speak","right",{withHighlighting:!0}],"!mac:Ctrl-Alt-Shift-Period":["speak","selection",{withHighlighting:!0}],"mac:Ctrl-Meta-Shift-Period":["speak","selection",{withHighlighting:!0}]},me={"\\theta":"Alt-KeyQ","\\sqrt":["Alt-KeyV","Ctrl-Digit2"],"\\pi":"Alt-KeyP","\\prod":"Alt-Shift-KeyP","\\sum":"Alt-KeyW","\\int":"Alt-KeyB","\\cup":"Alt-KeyU","\\cap":"Alt-KeyN","\\bigcup":"Alt-Shift-KeyU","\\bigcap":"Alt-Shift-KeyN","\\forall":"Alt-Shift-KeyA","\\exists":"Alt-Shift-KeyE","\\infty":"Alt-Digit5","\\wedge":"Alt-Digit5","\\vee":"Alt-Shift-Digit6","\\differentialD":"Alt-keyD","\\partial":"Alt-Shift-KeyD","\\frac":"Slash","\\emptyset":"Alt-KeyO","\\varnothing":"Alt-Shift-KeyO","\\~":"~"},ue={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},sin:{mode:"math",value:"\\sin"},cos:{mode:"math",value:"\\cos"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:"\\differentialD x",dy:"\\differentialD y",dt:"\\differentialD t",AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:"\\times","+-":"\\pm","!=":"\\ne",">=":"\\ge","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","≈":"\\approx","?=":"\\questeq","÷":"\\div","¬":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:"\\forall",exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function fe(t,e,s){if(!s)return s;if("string"==typeof s)return s;if("string"==typeof s.mode&&s.mode!==t)return null;if(!e)return s?s.value:void 0;let i=!1,a=!1,o=!1,n=!1,r=!1,l=!1,c=!1,h=!1,d=!1,p=!1,m=!1,u=!1,f=!1,g=!1,y=e[e.length-1],b=e.length-1;for(;y&&/msubsup|placeholder/.test(y.type);)b-=1,y=e[b];return i=!y||"first"===y.type,y&&(f="text"===y.mode,a=!f&&"mord"===y.type&&wt.LETTER.test(y.body),o=!f&&"mord"===y.type&&/[0-9]+$/.test(y.body),n=!f&&y.isFunction,r="genfrac"===y.type,l="surd"===y.type,c="mbin"===y.type,h="mrel"===y.type,d="mpunct"===y.type||"minner"===y.type,p=y.array,m="mopen"===y.type,u="mclose"===y.type||"leftright"===y.type,g="space"===y.type),void 0!==s.after?/nothing/.test(s.after)&&i||/letter/.test(s.after)&&a||/digit/.test(s.after)&&o||/function/.test(s.after)&&n||/frac/.test(s.after)&&r||/surd/.test(s.after)&&l||/binop/.test(s.after)&&c||/relop/.test(s.after)&&h||/punct/.test(s.after)&&d||/array/.test(s.after)&&p||/openfence/.test(s.after)&&m||/closefence/.test(s.after)&&u||/text/.test(s.after)&&f||/space/.test(s.after)&&g?s.value:null:s.value}function ge(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}function ye(t){let e=t;return Array.isArray(e)&&e.length>0&&(e=e[0]+"("+e.slice(1).join("")+")"),e}function be(t,e){let s="";Array.isArray(t)||(t=[t]);for(const i of t){let t;const a=i.match(/(^[^:]*):/),o=a?a[1]:"";if(o===ge("mac")||o===ge("win")||o===ge("ios")||o===ge("android")||o===ge("chromeos")||o===ge("other")){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}else if(!["mac","!mac","win","!win","ios","!ios","android","!android","chromeos","!chromeos","other","!other"].includes(o)){const e=i.match(/:([^:]*)$/);t=e?e[1]:i}if(t){const i="mac"===ge("mac")||"ios"===ge("ios"),a=t.length>1?t.split("-"):[t];let o="";for(const t of a)!i&&o.length>0&&(o+='+'),"Key"===t.substr(0,3)?o+=t.substr(3,1):"Digit"===t.substr(0,5)?o+=t.substr(5,1):o+={Meta:i?"⌘":"command",Shift:i?"⇧":"shift",Alt:i?"⌥":"alt",Ctrl:i?"⌃":"control","\n":i?"⏎":"return",Return:i?"⏎":"return",Enter:i?"⌤":"enter",Tab:i?"⇥":"tab",Esc:"esc",Backspace:i?"⌫":"backspace",Del:i?"⌦":"del",PageUp:i?"⇞":"page up",PageDown:i?"⇟":"page down",Home:i?"⤒":"home",End:i?"⤓":"end",Spacebar:"space",Semicolon:";",Period:".",Comma:",",Minus:"-",Equal:"=",Quote:"'",BracketLeft:"[",BracketRight:"]",Backslash:"\\",IntlBackslash:"\\",Backquote:"`",Slash:"/",NumpadMultiply:"* 🔢",NumpadDivide:"/ 🔢",NumpadSubtract:"- 🔢",NumpadAdd:"+ 🔢",NumpadDecimal:". 🔢",NumpadComma:", 🔢",Help:"help",Left:"⇠",Up:"⇡",Right:"⇢",Down:"⇣"}[t]||t;s.length>0&&(s+=e||" or "),s+=o}}return s}var xe={KEYBOARD_SHORTCUTS:pe,INLINE_SHORTCUTS:ue,stringify:be,startsWithString:function(t,e){const s=[];for(let i=0;i<=t.length-1;i++){const a=t.substring(i);e&&e.overrideDefaultInlineShortcuts||Object.keys(ue).forEach(t=>{t.startsWith(a)&&!s.includes(t)&&s.push(t)});const o=e&&e.inlineShortcuts?e.inlineShortcuts:null;o&&Object.keys(o).forEach(t=>{t.startsWith(a)&&s.push(t)})}return s},forString:function(t,e,s,i){let a="";i&&i.overrideDefaultInlineShortcuts||(a=fe(t,e,ue[s]));const o=i&&i.inlineShortcuts?i.inlineShortcuts:null;let n;return o&&(n=fe(t,e,o[s])),n||a},selectorForKeystroke:function(t,e){for(const s of[ge("mac")+":"+t+":"+e,ge("win")+":"+t+":"+e,ge("ios")+":"+t+":"+e,ge("android")+":"+t+":"+e,ge("chromeos")+":"+t+":"+e,ge("other")+":"+t+":"+e,ge("mac")+":"+e,ge("win")+":"+e,ge("ios")+":"+e,ge("android")+":"+e,ge("chromeos")+":"+e,t+":"+e,e])if(pe[s])return pe[s];return""},forCommand:function(t){let e=[];if("string"==typeof t){const s=me[t];Array.isArray(s)?e=s.slice():s&&e.push(s)}t=ye(t);const s=new RegExp("^"+t.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return Object.keys(pe).forEach(t=>{if(s.test(ye(pe[t]))){const s=t.match(/:([^:]*)$/);s&&e.push(s[1])}}),be(e)}};function ke(t,e){this.root=Yt.makeRoot(),this.path=[{relation:"body",offset:0}],this.extent=0,this.config=t?{...t}:{},this.target=e,this.suppressChangeNotifications=!1}function ve(t){const e=Object.assign(new ke(t.config,t.target),t);return e.path=de.clone(t.path),e}function we(t,e){let s=0;for(let i=0;i0;)s.col+=1,(!t[s.row]||s.col>=t[s.row].length)&&(s.col=0,s.row+=1),e-=1;return s}function Ae(t,e){let s;return"object"!=typeof e&&(e=Se(t,e)),Array.isArray(t[e.row])&&(s=t[e.row][e.col]||null),!s||0!==s.length&&"first"===s[0].type||s.unshift(Ie()),s}function Me(t){let e=0,s=0,i=1;for(const a of t)s+=1,a.length>i&&(i=a.length);return e=s*i,e}function Ce(t,e,s){if(!t)return[];e||(e=",");let i,a=[];for(let o of t)o&&o.length>0&&"first"===o[0].type&&(o=o.slice(1)),o&&o.length>0&&(i?a.push(i):i=new Yt.MathAtom("math","mpunct",e,s),a=a.concat(o));return a}function _e(t,e,s){const i={...e};if(i.row+=s,i.row<0){if(i.col+=s,i.row=t.length-1,i.col<0)return null;for(;i.row>=0&&!Ae(t,i);)i.row-=1;if(i.row<0)return null}else if(i.row>=t.length){for(i.col+=s,i.row=0;i.rowt.length-1)return null}return i}function Te(t){return!!t&&("mord"===t.type&&/[0-9.]/.test(t.body)||"mpunct"===t.type&&","===t.body)}function Le(t,e){if(!t)return!1;if(Array.isArray(t)){for(const s of t)if(Le(s,e))return!0}else{if(t===e)return!0;if(["body","numer","denom","index","subscript","superscript","underscript","overscript"].some((function(s){return s===e||Le(t[s],e)})))return!0;if(t.array)for(let s=Me(t.array);s>=0;s--)if(Le(Ae(t.array,s),e))return!0}return!1}function Fe(t){if(t)return 1===t.length&&"leftright"===t[0].type&&"("===t[0].leftDelim&&(t=t[0].body),t}function De(t,e){if(!t)return"";if(t.length<=1)return t;if(!e||"ASCIIMath"!==e.format){if(t.startsWith("$$")&&t.endsWith("$$"))return t.substring(2,t.length-2);if(t.startsWith("$")&&t.endsWith("$"))return t.substring(1,t.length-1);if(t=t.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(t))return t}return ze(t=(t=(t=(t=(t=(t=t.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),e)}function ze(t,e){if(!t)return"";let s,i=!1;if(i||"^"!==t[0]&&"_"!==t[0]||(s=Ee(t.substr(1),{...e,noWrap:!0}),t=t[0]+"{"+s.match+"}",t+=ze(s.rest,e),i=!0),i||(s=t.match(/^(sqrt|\u221a)(.*)/),s&&(s=Ee(s[2],{...e,noWrap:!0}),t="\\sqrt{"+s.match+"}",t+=ze(s.rest,e),i=!0)),i||(s=t.match(/^(\\cbrt|\u221b)(.*)/),s&&(s=Ee(s[2],{...e,noWrap:!0}),t="\\sqrt[3]{"+s.match+"}",t+=ze(s.rest,e),i=!0)),i||(s=t.match(/^abs(.*)/),s&&(s=Ee(s[1],{...e,noWrap:!0}),t="\\left|"+s.match+"\\right|",t+=ze(s.rest,e),i=!0)),i||(s=t.match(/^["”“](.*?)["”“](.*)/),s&&(t="\\text{"+s[1]+"}",t+=ze(s[2],e),i=!0)),i||(s=t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),s&&(t=qe(s[1],e),t+=ze(s[2],e),i=!0)),!i&&/^(f|g|h)[^a-zA-Z]/.test(t)&&(s=Ee(t.substring(1),{...e,noWrap:!0}),t="("===t[1]?t[0]+"\\mleft("+s.match+"\\mright)":t[0]+s.match,t+=ze(s.rest,e),i=!0),i||(s=t.match(/^([a-zA-Z]+)(.*)/),s&&(t=qe(s[1],e),t+=ze(s[2],e),i=!0)),!i)if(s=Ee(t,{...e,noWrap:!0}),s.match&&"/"===s.rest[0]){const a=Ee(s.rest.substr(1),{...e,noWrap:!0});a.match&&(t="\\frac{"+s.match+"}{"+a.match+"}"+ze(a.rest,e)),i=!0}else s.match&&(t="("===t[0]?"\\left("+s.match+"\\right)"+ze(s.rest,e):s.match+ze(s.rest,e),i=!0);return i||(s=t.match(/^(\s+)(.*)$/),s&&(t=" "+ze(s[2],e),i=!0)),t}function Ee(t,e){let s="",i=t=t.trim(),a=t.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let n=1,r=1;for(;r0;)t[r]===a&&n++,t[r]===o&&n--,r++;0===n?(e.noWrap&&"("===a?s=ze(t.substring(1,r-1),e):("{"===a&&"}"===o&&(a="\\{",o="\\}"),s="\\left"+a+ze(t.substring(1,r-1),e)+"\\right"+o),i=t.substring(r)):(s=t.substring(1,r),i="")}else{let a=t.match(/^([a-zA-Z]+)/);if(a){let s=xe.forString("math",null,t,e);if(s)return s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),{match:s,rest:t.substring(s.length)}}if(a=t.match(/^([a-zA-Z])/),a)return{match:a[1],rest:t.substring(1)};if(a=t.match(/^(-)?\d+(\.\d*)?/),a)return{match:a[0],rest:t.substring(a[0].length)};/^\\(left|right)/.test(t)||(a=t.match(/^(\\[a-zA-Z]+)/),a&&(i=t.substring(a[1].length),s=a[1]))}return{match:s,rest:i}}function qe(t,e){let s=xe.forString("math",null,t,e);return s?(s=s.replace("_{#?}",""),s=s.replace("^{#?}",""),s+=" "):s=t,s}function Ie(){return new Yt.MathAtom("","first")}ke.prototype._announce=function(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this.target,t,e,s)},ke.prototype.filter=function(t,e){e=e<0?-1:1;const s=[],i=new ke;i.path=de.clone(this.path),i.extent=this.extent,i.root=this.root,e>=0?i.collapseForward():(i.collapseBackward(),i.move(1));const a=i.anchor();do{t.bind(i)(i.path,i.anchor())&&s.push(i.toString()),e>=0?i.next({iterateAll:!0}):i.previous({iterateAll:!0})}while(a!==i.anchor());return s},ke.prototype.forEach=function(t){this.root.forEach(t)},ke.prototype.forEachSelected=function(t,e){(e=e||{}).recursive=void 0!==e.recursive&&e.recursive;const s=this.siblings(),i=this.startOffset()+1,a=this.endOffset()+1;if(e.recursive)for(let o=i;o0?0:1)},ke.prototype.setRange=function(t,e,s){s=s||{};const i=de.pathDistance(t,e);if(0===i)return s.extendToWordBoundary?(t=this.wordBoundary(t,-1),e=this.wordBoundary(e,1),this.setRange(t,e)):this.setPath(de.clone(t),0);if(1===i){const i=e[e.length-1].offset-t[t.length-1].offset;return s.extendToWordBoundary?(t=this.wordBoundary(t,i<0?1:-1),e=this.wordBoundary(e,i<0?-1:1),this.setRange(t,e)):this.setPath(de.clone(t),i)}let a=de.pathCommonAncestor(t,e);const o=a.length;if(t.length===o||e.length===o||t[o].relation!==e[o].relation)return this.setPath(a,-1);a.push(t[o]),a=de.clone(a);let n=e[o].offset-t[o].offset+1;return n<=0?e.length>o+1?(a[o].relation=e[o].relation,a[o].offset=e[o].offset,a[a.length-1].offset-=1,n=2-n):(a[o].relation=e[o].relation,a[o].offset=e[o].offset,n=1-n):e.length<=t.length?a[a.length-1].offset-=1:e.length>t.length&&(a[o].offset-=1),this.setPath(a,n)},ke.prototype.ancestor=function(t){if(t>this.path.length)return null;let e=this.root;for(let s=0;s0?this.path[this.path.length-1].relation:""},ke.prototype.anchorOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset:0},ke.prototype.focusOffset=function(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0},ke.prototype.startOffset=function(){return Math.min(this.focusOffset(),this.anchorOffset())},ke.prototype.endOffset=function(){return Math.max(this.focusOffset(),this.anchorOffset())},ke.prototype.insertFirstAtom=function(){this.siblings()},ke.prototype.siblings=function(){if(0===this.path.length)return[];let t;return this.parent().array?t=Ae(this.parent().array,this.relation()):(t=this.parent()[this.relation()]||[],"string"==typeof t&&(t=[])),0!==t.length&&"first"===t[0].type||t.unshift(Ie()),t},ke.prototype.sibling=function(t){return this.siblings()[this.startOffset()+t]},ke.prototype.isCollapsed=function(){return 0===this.extent},ke.prototype.setExtent=function(t){this.extent=t},ke.prototype.collapseForward=function(){return 0!==this.extent&&(this.setSelection(this.endOffset()),!0)},ke.prototype.collapseBackward=function(){return 0!==this.extent&&(this.setSelection(this.startOffset()),!0)},ke.prototype.selectGroup_=function(){const t=this.siblings();if("text"===this.anchorMode()){let e=this.startOffset(),s=this.endOffset();for(;t[e]&&"text"===t[e].mode&&wt.LETTER_AND_DIGITS.test(t[e].body);)e-=1;for(;t[s]&&"text"===t[s].mode&&wt.LETTER_AND_DIGITS.test(t[s].body);)s+=1;if(s-=1,e>=s)return void this.setSelection(this.endOffset()-1,1);this.setSelection(e,s-e)}else if("mord"===this.sibling(0).type&&/[0-9,.]/.test(this.sibling(0).body)){let e=this.startOffset(),s=this.endOffset();for(;Te(t[e]);)e-=1;for(;Te(t[s]);)s+=1;s-=1,this.setSelection(e,s-e)}else this.setSelection(0,"end")},ke.prototype.selectAll_=function(){this.path=[{relation:"body",offset:0}],this.setSelection(0,"end")},ke.prototype.deleteAll_=function(){this.selectAll_(),this.delete_()},ke.prototype.contains=function(t){if(this.isCollapsed())return!1;const e=this.siblings(),s=this.startOffset(),i=this.endOffset();for(let a=s;a0&&"command"===t[e].type;)e-=1;let s=this.startOffset()+1;for(;s<=t.length-1&&"command"===t[s].type;)s+=1;return s>e?{start:e+1,end:s}:null},ke.prototype.extractCommandStringAroundInsertionPoint=function(t){let e="";const s=this.commandOffsets();if(s){const i=t?this.anchorOffset()+1:s.end,a=this.siblings();for(let t=s.start;t"placeholder"===t.type));this.setExtent(0),this.path[this.path.length-1].offset=e.start-1,0!==s.length&&this.leap(1,!1)||this.setSelection(e.start+t.length-1)}else this.siblings().splice(e.start,e.end-e.start),this.setSelection(e.start-1,0);this.contentDidChange()}},ke.prototype.removeCommandString=function(){this.contentWillChange();const t=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,function t(e){if(e)if(Array.isArray(e))for(let s=e.length-1;s>=0;s--)"command"===e[s].type?e.splice(s,1):t(e[s]);else if(t(e.body),t(e.superscript),t(e.subscript),t(e.underscript),t(e.overscript),t(e.numer),t(e.denom),t(e.index),e.array)for(let s=Me(e.array);s>=0;s--)t(Ae(e.array,s))}(this.root.body),this.suppressChangeNotifications=t,this.contentDidChange()},ke.prototype.extractArgBeforeInsertionPoint=function(){const t=this.siblings();if(t.length<=1)return[];const e=[];let s=this.startOffset();if("text"===t[s].mode)for(;s>=1&&"text"===t[s].mode;)e.unshift(t[s]),s--;else for(;s>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[s].type);)e.unshift(t[s]),s--;return e},ke.prototype.setSelection=function(t,e,s){t=t||0,e=e||0;const i=this.path[this.path.length-1].relation;s||(s=i);const a=this.parent();if(!a&&"body"!==s)return!1;const o=s.startsWith("cell");if(!o&&!a[s]||o&&!a.array)return!1;const n=s!==i;this.path[this.path.length-1].relation=s;const r=this.siblings().length;this.path[this.path.length-1].relation=i;const l=this.extent;"end"===e?e=r-t-1:"start"===e&&(e=-t),this.setExtent(e);const c=this.extent!==l;this.setExtent(l),t<0&&(t=r+t),t=Math.max(0,Math.min(t,r-1));const h=this.path[this.path.length-1].offset;return(n||h!==t||c)&&(n&&this.adjustPlaceholder(),this.selectionWillChange(),this.path[this.path.length-1].relation=s,this.path[this.path.length-1].offset=t,this.setExtent(e),this.selectionDidChange()),!0},ke.prototype.next=function(t){t=t||{};const e={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(this.anchorOffset()===this.siblings().length-1){this.adjustPlaceholder();let s=e[this.relation()];const i=this.parent();for(;s&&!i[s];)s=e[s];if(s)return void this.setSelection(0,0,s);if(this.parent().array){const t=Me(this.parent().array);let e=parseInt(this.relation().match(/cell([0-9]*)$/)[1])+1;for(;e=0;){if(Ae(this.parent().array,t)&&this.setSelection(-1,0,"cell"+t))return void this.selectionDidChange();t-=1}}return 1===this.path.length?(this.suppressChangeNotifications||!this.config.onMoveOutOf||this.config.onMoveOutOf.bind(this)(-1))&&(this.path[0].offset=this.root.body.length-1):(this.path.pop(),this.setSelection(this.anchorOffset()-1)),void this.selectionDidChange()}const s=this.anchor();if(!s.captureSelection){let t;if(s.array){t="";const e=Me(s.array);let i=e-1;for(;!t&&i0)for(this.collapseForward()&&t--;t>0;)this.next(),t--;else if(t<0)for(this.collapseBackward()&&t++;0!==t;)this.previous(),t++;this._announce("move",e)}},ke.prototype.up=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseBackward();const s=this.relation();if("denom"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"numer"),this._announce("moveUp");else if(this.parent().array){let e=Se(this.parent().array,s);e=_e(this.parent().array,e,-1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveUp")):this.move(-1,t)}else this._announce("line")},ke.prototype.down=function(t){const e=(t=t||{extend:!1}).extend||!1;this.collapseForward();const s=this.relation();if("numer"===s)e?(this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange()):this.setSelection(this.anchorOffset(),0,"denom"),this._announce("moveDown");else if(this.parent().array){let e=Se(this.parent().array,s);e=_e(this.parent().array,e,1),e&&Ae(e)?(this.path[this.path.length-1].relation="cell"+we(this.parent().array,e),this.setSelection(this.anchorOffset()),this._announce("moveDown")):this.move(1,t)}else this._announce("line")},ke.prototype.extend=function(t){let e=this.path[this.path.length-1].offset,s=0;const i=ve(this);s=this.extent+t;const a=e+s;if(a<0&&0!==s){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.setExtent(-1),this.selectionDidChange(),void this._announce("move",i);e=this.path[this.path.length-1].offset,s=this.extent}else if(a>=this.siblings().length){if(this.path.length>1)return this.selectionWillChange(),this.path.pop(),this.path[this.path.length-1].offset-=1,this.setExtent(1),this.selectionDidChange(),void this._announce("move",i);this.isCollapsed()&&(e-=1),s-=1}this.setSelection(e,s),this._announce("move",i)},ke.prototype.skip=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=ve(this),a=this.siblings(),o=this.focusOffset();let n=o+t;if(s&&(n=Math.min(Math.max(0,n),a.length-1)),n<0||n>=a.length)this.move(t,e);else{if(a[n]&&"text"===a[n].mode){if(n=this.wordBoundaryOffset(n,t),n<0&&!s)return void this.setSelection(0);if(n>a.length)return this.setSelection(a.length-1),void this.move(t,e)}else{const e=a[n]?a[n].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let s="mopen"===e?1:-1;for(n+=t>0?1:-1;n>=0&&n0&&(n-=1)}else{for(;a[n]&&"math"===a[n].mode&&a[n].type===e;)n+=t;n-=t>0?1:0}}if(s){const t=this.anchorOffset();this.setSelection(t,n-t)}else this.setSelection(n);this._announce("move",i)}},ke.prototype.jump=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=t<0?-1:1;const i=this.siblings();let a=this.focusOffset();t>0&&(a=Math.min(a+1,i.length-1));const o=t<0?0:i.length-1;s?this.extend(o-a):this.move(o-a)},ke.prototype.jumpToMathFieldBoundary=function(t,e){const s=(e=e||{extend:!1}).extend||!1;t=(t=t||1)<0?-1:1;const i=ve(this),a=[{relation:"body",offset:this.path[0].offset}];let o;s?t<0?a[0].offset>0&&(o=-a[0].offset):a[0].offset"placeholder"===e.type||t.length>1&&1===this.siblings().length,t);if(0===o.length){if(this.setPath(i,a),e)if(this.config.onTabOutOf)this.config.onTabOutOf(this.target,t>0?"forward":"backward");else if(document.activeElement){const e='a[href]:not([disabled]),\n button:not([disabled]),\n textarea:not([disabled]),\n input[type=text]:not([disabled]),\n select:not([disabled]),\n [contentEditable="true"],\n [tabindex]:not([disabled]):not([tabindex="-1"])',s=Array.prototype.filter.call(document.querySelectorAll(e),t=>(t.offsetWidth>0||t.offsetHeight>0)&&!t.contains(document.activeElement)||t===document.activeElement);let i=s.indexOf(document.activeElement)+t;i<0&&(i=s.length-1),i>=s.length&&(i=0),s[i].focus()}return this.suppressChangeNotifications=s,!1}return this.selectionWillChange(),this.setPath(o[0]),"placeholder"===this.anchor().type&&this.setExtent(-1),this._announce("move",i),this.selectionDidChange(),this.suppressChangeNotifications=s,!0},ke.prototype.anchorMode=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t){if("commandliteral"===t.type||"command"===t.type)return"command";e=t.mode}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e=i.mode),s+=1,i=this.ancestor(s);return e},ke.prototype.anchorStyle=function(){const t=this.isCollapsed()?this.anchor():this.sibling(1);let e;if(t&&"first"!==t.type){if("commandliteral"===t.type||"command"===t.type)return{};e={color:t.color,backgroundColor:t.backgroundColor,fontFamily:t.fontFamily,fontShape:t.fontShape,fontSeries:t.fontSeries,fontSize:t.fontSize}}let s=1,i=this.ancestor(s);for(;!e&&i;)i&&(e={color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontShape:i.fontShape,fontSeries:i.fontSeries,fontSize:i.fontSize}),s+=1,i=this.ancestor(s);return e},ke.prototype.simplifyParen=function(t){if(t&&this.config.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&Array.isArray(t[e].body)){let s=0,i=0,a=0;for(let o=0;t[e].body[o];o++)"genfrac"===t[e].body[o].type&&(s++,i=o),"first"!==t[e].body[o].type&&a++;0===a&&1===s&&(t[e]=t[e].body[i])}t.forEach(t=>{if("genfrac"===t.type&&(this.simplifyParen(t.numer),this.simplifyParen(t.denom),t.numer=Fe(t.numer),t.denom=Fe(t.denom)),t.superscript&&(this.simplifyParen(t.superscript),t.superscript=Fe(t.superscript)),t.subscript&&(this.simplifyParen(t.subscript),t.subscript=Fe(t.subscript)),t.underscript&&(this.simplifyParen(t.underscript),t.underscript=Fe(t.underscript)),t.overscript&&(this.simplifyParen(t.overscript),t.overscript=Fe(t.overscript)),t.index&&(this.simplifyParen(t.index),t.index=Fe(t.index)),"surd"===t.type?(this.simplifyParen(t.body),t.body=Fe(t.body)):t.body&&Array.isArray(t.body)&&this.simplifyParen(t.body),t.array)for(let e=Me(t.array);e>=0;e--)this.simplifyParen(Ae(t.array,e))})}},ke.prototype.insert=function(t,e){if((e=e||{}).smartFence&&this._insertSmartFence(t,e.style))return;const s=this.suppressChangeNotifications;e.suppressChangeNotifications&&(this.suppressChangeNotifications=!0),this.contentWillChange();const i=this.suppressChangeNotifications;this.suppressChangeNotifications=!0,e.insertionMode||(e.insertionMode="replaceSelection"),e.selectionMode||(e.selectionMode="placeholder"),e.format||(e.format="auto"),e.macros=e.macros||this.config.macros;const a=e.mode||this.anchorMode();let o;const r=[this.getSelectedAtoms()];void 0!==e.placeholder&&(r["?"]=e.placeholder),"replaceSelection"!==e.insertionMode||this.isCollapsed()?"replaceAll"===e.insertionMode?(this.root.body.splice(1),this.path=[{relation:"body",offset:0}],this.extent=0):"insertBefore"===e.insertionMode?this.collapseBackward():"insertAfter"===e.insertionMode&&this.collapseForward():this.delete_();const l=this.siblings(),c=this.startOffset();if(c+10&&l[c]&&"placeholder"===l[c].type&&this.delete_(-1),"math"===a&&"ASCIIMath"===e.format)t=De(t,{...this.config,format:"ASCIIMath"}),o=le.parseTokens(n(t),"math",null,e.macros,!1),this.simplifyParen(o);else if("text"!==a&&"auto"===e.format)if("command"===a){o=[];for(const e of t)wt.COMMAND_MODE_CHARACTERS.test(e)&&o.push(new Yt.MathAtom("command","command",e))}else""===t?o=[new Yt.MathAtom("command","command","\\")]:(t=De(t,this.config),r[0]?t=t.replace(/(^|[^\\])#@/g,"$1#0"):/(^|[^\\])#@/.test(t)?(t=t.replace(/(^|[^\\])#@/g,"$1#0"),r[0]=this.extractArgBeforeInsertionPoint(),this._deleteAtoms(-r[0].length),Array.isArray(r[0])&&0===r[0].length&&(r[0]=void 0)):t=t.replace(/(^|[^\\])#@/g,"$1#?"),o=le.parseTokens(n(t),a,r,e.macros,e.smartFence),this.simplifyParen(o));else"latex"===e.format?o=le.parseTokens(n(t),a,r,e.macros,e.smartFence):"text"!==a&&"text"!==e.format||(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),o=le.parseTokens(n(t),"text",r,e.macros,!1));!function t(e,s){e&&s&&(Array.isArray(e)?e.forEach(e=>t(e,s)):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(s),t(e.body,s),t(e.numer,s),t(e.denom,s),t(e.index,s),t(e.overscript,s),t(e.underscript,s),t(e.subscript,s),t(e.superscript,s))))}(o,e.style);const h=this.parent();if(this.config.removeExtraneousParentheses&&h&&"leftright"===h.type&&"("===h.leftDelim&&function(t){return 0===t.length||1===t.length&&"first"===t[0].type}(h.body)&&o&&1===o.length&&"genfrac"===o[0].type?(this.path.pop(),this.siblings()[this.anchorOffset()]=o[0]):Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(o)),this.insertFirstAtom(),this.suppressChangeNotifications=i,"placeholder"===e.selectionMode){let t=[];for(const e of o)t=t.concat(e.filter(t=>"placeholder"===t.type));0!==t.length&&this.leap(1,!1)?this._announce("move"):this.setSelection(this.anchorOffset()+o.length)}else"before"===e.selectionMode||("after"===e.selectionMode?this.setSelection(this.anchorOffset()+o.length):"item"===e.selectionMode&&this.setSelection(this.anchorOffset(),o.length));this.contentDidChange(),this.suppressChangeNotifications=s},ke.prototype._insertSmartFence=function(t,e){const s=this.parent();if("leftright"===s.type&&"|"!==s.leftDelim&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return this.insert("\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:e}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["!==t&&"\\["!==t||(t="\\lbrack"),"]"!==t&&"\\]"!==t||(t="\\rbrack");const i=wt.RIGHT_DELIM[t];if(i&&("leftright"!==s.type||"|"!==s.leftDelim)){let s="";const a=this.isCollapsed()||"placeholder"===this.anchor().type;s=this.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",s+=a?"?":i;let o=[];return a&&(o=this.siblings().splice(this.anchorOffset()+1,this.siblings().length)),this.insert(s,{mode:"math",format:"latex",style:e}),a&&(this.sibling(0).body=o,this.move(-1)),!0}let a;if(Object.keys(wt.RIGHT_DELIM).forEach(e=>{t===wt.RIGHT_DELIM[e]&&(a=e)}),a){if(s&&"leftright"===s.type&&this.endOffset()===this.siblings().length-1)return this.contentWillChange(),s.rightDelim=t,this.move(1),this.contentDidChange(),!0;const i=this.siblings();let a;for(a=this.endOffset();a>=0&&("leftright"!==i[a].type||"?"!==i[a].rightDelim);a--);if(a>=0)return this.contentWillChange(),i[a].rightDelim=t,i[a].body=i[a].body.concat(i.slice(a+1,this.endOffset()+1)),i.splice(a+1,this.endOffset()-a),this.setSelection(a),this.contentDidChange(),!0;if(s&&"leftright"===s.type&&"?"===s.rightDelim){this.contentWillChange(),s.rightDelim=t;const e=i.slice(this.endOffset()+1);return i.splice(this.endOffset()+1),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.endOffset()+1,0].concat(e)),this.contentDidChange(),!0}const o=this.ancestor(2);return o&&"leftright"===o.type&&"?"===o.rightDelim&&this.endOffset()===i.length-1?(this.move(1),this._insertSmartFence(t,e)):(this.insert(t,{mode:"math",format:"latex",style:e}),!0)}return!1},ke.prototype.positionInsertionPointAfterCommitedCommand=function(){const t=this.siblings(),e=this.commandOffsets();let s=e.start;for(;s=0;e--)t[e].suggestion&&t.splice(e,1)},ke.prototype.insertSuggestion=function(t,e){this.removeSuggestion();const s=[],i=t.substr(e);for(const a of i){const t=new Yt.MathAtom("command","command",a);t.suggestion=!0,s.push(t)}Array.prototype.splice.apply(this.siblings(),[this.anchorOffset()+1,0].concat(s))},ke.prototype._deleteAtoms=function(t){t>0?this.siblings().splice(this.anchorOffset()+1,t):(this.siblings().splice(this.anchorOffset()+t+1,-t),this.setSelection(this.anchorOffset()+t))},ke.prototype.delete=function(t){if(0===(t=t||0))this.delete_(0);else if(t>0)for(;t>0;)this.delete_(1),t--;else for(;t<0;)this.delete_(-1),t++},ke.prototype.delete_=function(t){this.contentWillChange(),this.selectionWillChange();const e=this.suppressChangeNotifications;if(this.suppressChangeNotifications=!0,t=(t=t||0)<0?-1:t>0?1:t,this.removeSuggestion(),this.parent().array&&t<0&&0===this.startOffset()){const t=this.parent().array;if(function(t){const e={col:0,row:0};for(;e.row0){let t=e.length;"first"===e[0].type&&(t-=1),t>0&&(s+=1)}i.row+=1}return s}(t,e.col)){!function(t,e){let s=0;for(;s"placeholder"!==t.type&&"first"!==t.type);this.parent()[t]=null,this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(e)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: "+t)}else if("denom"===t){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: denominator")}else if("body"===t){const t=this.siblings().filter(t=>"placeholder"!==t.type);this.path.length>1&&(t.shift(),this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(t)),this.setSelection(this.anchorOffset()-1),this._announce("deleted: root"))}else this.move(-1),this.delete(-1)}else if(t>0)if(e!==s.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(this.sibling(1).type)?this.move(1):(this._announce("delete",null,s.slice(e+1,e+2)),s.splice(e+1,1));else if("numer"===this.relation()){const t=this.parent().numer.filter(t=>"placeholder"!==t.type&&"first"!==t.type),e=this.parent().denom.filter(t=>"placeholder"!==t.type&&"first"!==t.type);this.path.pop(),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),1].concat(e)),Array.prototype.splice.apply(this.siblings(),[this.anchorOffset(),0].concat(t)),this.setSelection(this.anchorOffset()+t.length-1),this._announce("deleted: numerator")}else this.move(1),this.delete(-1)}else{const t=this.startOffset()+1,e=this.endOffset()+1;this._announce("deleted",null,s.slice(t,e)),s.splice(t,e-t),this.setSelection(t-1)}this.suppressChangeNotifications=e,this.selectionDidChange(),this.contentDidChange()},ke.prototype.moveToNextPlaceholder_=function(){this.leap(1)},ke.prototype.moveToPreviousPlaceholder_=function(){this.leap(-1)},ke.prototype.moveToNextChar_=function(){this.move(1)},ke.prototype.moveToPreviousChar_=function(){this.move(-1)},ke.prototype.moveUp_=function(){this.up()},ke.prototype.moveDown_=function(){this.down()},ke.prototype.moveToNextWord_=function(){this.skip(1)},ke.prototype.moveToPreviousWord_=function(){this.skip(-1)},ke.prototype.moveToGroupStart_=function(){this.setSelection(0)},ke.prototype.moveToGroupEnd_=function(){this.setSelection(-1)},ke.prototype.moveToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1)},ke.prototype.moveToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1)},ke.prototype.deleteNextChar_=function(){this.delete_(1)},ke.prototype.deletePreviousChar_=function(){this.delete_(-1)},ke.prototype.deleteNextWord_=function(){this.extendToNextBoundary(),this.delete_()},ke.prototype.deletePreviousWord_=function(){this.extendToPreviousBoundary(),this.delete_()},ke.prototype.deleteToGroupStart_=function(){this.extendToGroupStart(),this.delete_()},ke.prototype.deleteToGroupEnd_=function(){this.extendToMathFieldStart(),this.delete_()},ke.prototype.deleteToMathFieldEnd_=function(){this.extendToMathFieldEnd(),this.delete_()},ke.prototype.transpose_=function(){},ke.prototype.extendToNextChar_=function(){this.extend(1)},ke.prototype.extendToPreviousChar_=function(){this.extend(-1)},ke.prototype.extendToNextWord_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousWord_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendUp_=function(){this.up({extend:!0})},ke.prototype.extendDown_=function(){this.down({extend:!0})},ke.prototype.extendToNextBoundary_=function(){this.skip(1,{extend:!0})},ke.prototype.extendToPreviousBoundary_=function(){this.skip(-1,{extend:!0})},ke.prototype.extendToGroupStart_=function(){this.setExtent(-this.anchorOffset())},ke.prototype.extendToGroupEnd_=function(){this.setExtent(this.siblings().length-this.anchorOffset())},ke.prototype.extendToMathFieldStart_=function(){this.jumpToMathFieldBoundary(-1,{extend:!0})},ke.prototype.extendToMathFieldEnd_=function(){this.jumpToMathFieldBoundary(1,{extend:!0})},ke.prototype.moveToSuperscript_=function(){if(this.collapseForward(),!this.anchor().superscript)if(this.anchor().subscript)this.anchor().superscript=[Ie()];else{const t=this.sibling(1);t&&t.superscript?this.path[this.path.length-1].offset+=1:t&&t.subscript?(this.path[this.path.length-1].offset+=1,this.anchor().superscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().superscript=[Ie()])}this.path.push({relation:"superscript",offset:0}),this.selectGroup_()},ke.prototype.moveToSubscript_=function(){if(this.collapseForward(),!this.anchor().subscript)if(this.anchor().superscript)this.anchor().subscript=[Ie()];else{const t=this.sibling(1);t&&t.subscript?this.path[this.path.length-1].offset+=1:t&&t.superscript?(this.path[this.path.length-1].offset+=1,this.anchor().subscript=[Ie()]):("limits"!==this.anchor().limits&&(this.siblings().splice(this.anchorOffset()+1,0,new Yt.MathAtom(this.parent().anchorMode,"msubsup","​",this.anchorStyle())),this.path[this.path.length-1].offset+=1),this.anchor().subscript=[Ie()])}this.path.push({relation:"subscript",offset:0}),this.selectGroup_()},ke.prototype.moveToOpposite_=function(){const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[this.relation()];t||this.moveToSuperscript_(),this.parent()[t]||(this.parent()[t]=[Ie()]),this.setSelection(0,"end",t)},ke.prototype.moveBeforeParent_=function(){this.path.length>1?(this.path.pop(),this.setSelection(this.anchorOffset()-1)):this._announce("plonk")},ke.prototype.moveAfterParent_=function(){if(this.path.length>1){const t=ve(this);this.path.pop(),this.setExtent(0),this._announce("move",t)}else this._announce("plonk")},ke.prototype._addCell=function(t){const e=this.parent();if(e&&"array"===e.type&&Array.isArray(e.array)){const s=this.relation();if(e.array){const i=Se(e.array,s);"after row"===t||"before row"===t?(i.col=0,i.row=i.row+("after row"===t?1:0),e.array.splice(i.row,0,[[]])):(i.col+="after column"===t?1:0,e.array[i.row].splice(i.col,0,[]));const a=we(e.array,i);this.path.pop(),this.path.push({relation:"cell"+a.toString(),offset:0}),this.insertFirstAtom()}}},ke.prototype.convertParentToArray=function(){const t=this.parent();if("leftright"===t.type){t.type="array";const e={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[t.leftDelim]||"matrix",s=wt.getEnvironmentInfo(e),i=[[t.body]];s.parser&&Object.assign(t,s.parser(e,[],i)),t.tabularMode=s.tabular,t.parseMode=this.anchorMode(),t.env={...s},t.env.name=e,t.array=i,t.rowGaps=[0],delete t.body,this.path[this.path.length-1].relation="cell0"}},ke.prototype.addRowAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after row"),this.contentDidChange()},ke.prototype.addRowBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before row"),this.contentDidChange()},ke.prototype.addColumnAfter_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("after column"),this.contentDidChange()},ke.prototype.addColumnBefore_=function(){this.contentWillChange(),this.convertParentToArray(),this._addCell("before column"),this.contentDidChange()},ke.prototype._applyStyle=function(t){if(this.isCollapsed())return;const e=this;function s(t,s){let i=!0;return e.forEachSelected(e=>{i=i&&e[t]===s},{recursive:!0}),i}t.color&&s("color",t.color)&&(t.color="none"),t.backgroundColor&&s("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&s("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&s("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&s("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&s("fontSize",t.fontSize)&&(t.fontSize="size5"),this.contentWillChange(),this.forEachSelected(e=>e.applyStyle(t),{recursive:!0}),this.contentDidChange()};var Pe={EditableMathlist:ke,parseMathString:De};const Be={"#":"#","|":"|","[":"BracketLeft","]":"BracketRight","-":"Minus","+":"Plus","=":"Equal","/":"Slash","\\":"Backslash"},Oe={Space:"Spacebar"," ":"Spacebar",Escape:"Esc",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},$e={q:"KeyQ",w:"KeyW",e:"KeyE",r:"KeyR",t:"KeyT",y:"KeyY",u:"KeyU",i:"KeyI",o:"KeyO",p:"KeyP",a:"KeyA",s:"KeyS",d:"KeyD",f:"KeyF",g:"KeyG",h:"KeyH",j:"KeyJ",k:"KeyK",l:"KeyL",z:"KeyZ",x:"KeyX",c:"KeyC",v:"KeyV",b:"KeyB",n:"KeyN",m:"KeyM",1:"Digit1",2:"Digit2",3:"Digit3",4:"Digit4",5:"Digit5",6:"Digit6",7:"Digit7",8:"Digit8",9:"Digit9",0:"Digit0","!":"Shift-Digit1","@":"Shift-Digit2","#":"Shift-Digit3",$:"Shift-Digit4","%":"Shift-Digit5","^":"Shift-Digit6","&":"Shift-Digit7","*":"Shift-Digit8","(":"Shift-Digit9",")":"Shift-Digit0","-":"Minus",_:"Shift-Minus","/":"Slash","\\":"Backslash","|":"Shift-Backslash","?":"Shift-Slash"," ":"Spacebar"};function Re(t){let e,s=!0;"Unidentified"===t.key&&t.target&&(e=$e[t.target.value]||t.target.value),e||(Be[t.key]?(e=Be[t.key],s=!1):e=Oe[t.key],e||(e=$e[t.key.toLowerCase()])),!e&&t.code&&(e=Oe[t.code]||t.code);const i=[];return t.ctrlKey&&i.push("Ctrl"),t.metaKey&&i.push("Meta"),s&&t.altKey&&i.push("Alt"),s&&t.shiftKey&&i.push("Shift"),0===i.length?e:(i.push(e),i.join("-"))}function Ke(t,e){let s,i=null,a=null,o=!1,n=!1;function r(t){clearTimeout(s),s=setTimeout((function(){clearTimeout(s),t()}))}function l(){if(function(t){return t.selectionStart!==t.selectionEnd}(t))return;const s=t.value;t.value="",s.length>0&&e.typedText(s)}const c=t||e.container;c.addEventListener("keydown",(function(s){if("function"==typeof e.allowDeadKey&&e.allowDeadKey()||"Dead"!==s.key&&"Unidentified"!==s.key&&229!==s.keyCode)n=!1;else{n=!0,o=!1;const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i}return!(!o&&"CapsLock"!==s.code&&!/(Control|Meta|Alt|Shift)(Right|Left)/.test(s.code))||(i=s,a=null,e.keystroke(Re(s),s))}),!0),c.addEventListener("keypress",(function(t){o||(i&&a&&e.keystroke(Re(i),i),a=t,r(l))}),!0),c.addEventListener("keyup",(function(){o||!i||a||l()}),!0),c.addEventListener("paste",(function(){t.focus();const s=t.value;t.value="",s.length>0&&e.paste(s)}),!0),c.addEventListener("copy",(function(t){e.copy&&e.copy(t)}),!0),c.addEventListener("cut",(function(t){e.cut&&e.cut(t)}),!0),c.addEventListener("blur",(function(){i=null,a=null,e.blur&&e.blur()}),!0),c.addEventListener("focus",(function(){e.focus&&e.focus()}),!0),c.addEventListener("compositionstart",()=>{o=!0},!0),c.addEventListener("compositionend",()=>{o=!1,r(l)},!0),c.addEventListener("input",()=>{if(n){const s=e.blur,i=e.focus;e.blur=null,e.focus=null,t.blur(),t.focus(),e.blur=s,e.focus=i,n=!1,o=!1,r(l)}else o||r(l)})}var Ne={delegateKeyboardEvents:Ke,select:Ke.select,keyboardEventToString:Re,eventToChar:function(t){if(!t)return"";let e;return"Unidentified"===t.key&&t.target&&(e=t.target.value),e=e||t.key||t.code,/^(Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(e)&&(e=""),e},charToEvent:function(t){return{key:t,metaKey:!1,ctrlKey:!1,altKey:!1,shiftKey:!1}}};const We={"\\mathrm":"\\mathrm{x=+3.14, x\\in A}","\\mathbf":"\\mathbf{x=+3.14, x\\in A}","\\bf":"\\bf{x=+3.14, x\\in A}","\\bm":"\\bm{x=+3.14, x\\in A}","\\bold":"\\bold{x=+3.14, x\\in A}","\\mathit":"\\mathbb{x=+3.14}","\\mathbb":"\\mathbb{ABCD}","\\Bbb":"\\mathbb{ABCD}","\\frak":"\\frak{ABCD}","\\mathfrak":"\\mathfrak{ABCD}","\\mathscr":"\\mathscr{ABCD}","\\mathsf":"\\mathsf{ABab01}","\\mathtt":"\\mathtt{x=+3.14, x\\in A}","\\mathcal":"\\mathcal{ABCD}","\\boldsymbol":"\\boldsymbol{ABab01+=}","\\text":"\\text{ABC abc}","\\textrm":"\\textrm{ABC abc}","\\textnormal":"\\textnormal{ABC abc}","\\textit":"\\textit{ABC abc}","\\textbf":"\\textbf{ABC abc}","\\texttt":"\\texttt{ABC abc}","\\textsf":"\\textsf{ABC abc}","\\textcolor":"{\\textcolor{m0}A}{\\textcolor{m1}B}{\\textcolor{m2}C }{\\textcolor{m3}a}{\\textcolor{m4}b}{\\textcolor{m5}c}{\\textcolor{m6}8}","\\color":"{\\color{m0}A}{\\color{m1}B}{\\color{m2}C}{\\color{m3}a}{\\color{m4}b}{\\color{m5}c}{\\color{m6}8}","\\underline":'\\underline{\\unicode{"2B1A}}',"\\overline":'\\overline{\\unicode{"2B1A}}',"\\vec":'\\vec{\\unicode{"25CC}}',"\\check":'\\check{\\unicode{"25CC}}',"\\acute":'\\acute{\\unicode{"25CC}}',"\\breve":'\\breve{\\unicode{"25CC}}',"\\tilde":'\\tilde{\\unicode{"25CC}}',"\\hat":'\\hat{\\unicode{"25CC}}',"\\ddot":'\\ddot{\\unicode{"25CC}}',"\\dot":'\\dot{\\unicode{"25CC}}',"\\bar":'\\bar{\\unicode{"25CC}}',"\\!":'\\unicode{"203A}\\!\\unicode{"2039}',"\\,":'\\unicode{"203A}\\,\\unicode{"2039}',"\\:":'\\unicode{"203A}\\:\\unicode{"2039}',"\\;":'\\unicode{"203A}\\;\\unicode{"2039}',"\\quad":'\\unicode{"203A}\\quad\\unicode{"2039}',"\\qquad":'\\unicode{"203A}\\qquad\\unicode{"2039}',"\\enskip":'\\unicode{"203A}\\enskip\\unicode{"2039}',"\\space":'\\unicode{"203A}\\space\\unicode{"2039}',"\\frac":'\\frac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dfrac":'\\dfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\cfrac":'\\cfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tfrac":'\\tfrac{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\dbinom":'\\dbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\tbinom":'\\tbinom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\binom":'\\binom{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\pdiff":'\\pdiff{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\in":"n\\in\\N","\\notin":"n\\notin\\N","\\not":"B \\not A","\\ni":"N\\in n","\\owns":"N\\owns n","\\subset":"A\\subset B","\\supset":"B\\supset A","\\subseteq":"A\\subseteq B","\\supseteq":"B\\supseteq A","\\nsubseteq":"A\\nsubseteq B","\\nsupseteq":"B\\nsupseteq A","\\subsetneq":"A\\subsetneq B","\\supsetneq":"B\\supsetneq A","\\varsubsetneq":"A\\varsubsetneq B","\\varsupsetneq":"B\\varsupsetneq A","\\nsubseteqq":"A\\varsupsetneq B","\\subsetneqq":"A\\subsetneqq B","\\varsubsetneqq":"A\\varsubsetneqq B","\\nsubset":"A\\nsubset B","\\nsupset":"B\\nsupset A","\\complement":"A^\\complement","\\bigcup":'\\bigcup_{\\unicode{"2B1A}}',"\\bigcap":'\\bigcap_{\\unicode{"2B1A}}',"\\sqrt":'\\sqrt{\\unicode{"2B1A}}',"\\prod":'\\prod_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\sum":'\\sum_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\int":'\\int_{\\unicode{"2B1A}}^{\\unicode{"2B1A}}',"\\stackrel":'\\stackrel{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\stackbin":'\\stackbin{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\underset":'\\underset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\overset":'\\overset{\\unicode{"2B1A}}{\\unicode{"2B1A}}',"\\prime":'\\unicode{"2B1A}^{\\prime}',"\\boxed":'\\boxed{\\unicode{"2B1A}}',"\\colorbox":'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}',"\\bbox":'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}',"\\enclose":'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{23+45}',"\\fcolorbox":'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}',"\\ ":'\\char"2423',"\\top":"{\\color{red}P}\\top","\\bot":"{\\color{#0F0}P}\\bot","\\mid":"P(p\\mid q)","\\rlap":"\\rlap{x}o","\\llap":"o\\llap{/}"},He={"\\text":"roman text","\\textrm":"roman text","\\textnormal":"roman text","\\textit":"italic text","\\textbf":"bold text","\\texttt":"monospaced text","\\textsf":"sans-serif text","\\mathrm":["roman","(upright)"],"\\mathbf":"bold","\\bf":"bold","\\bold":"bold","\\mathit":"italic","\\mathbb":"blackboard","\\Bbb":"blackboard","\\mathscr":"script","\\mathtt":["typewriter","(monospaced)"],"\\mathsf":"sans-serif","\\mathcal":"caligraphic","\\frak":["fraktur","(gothic)"],"\\mathfrak":["fraktur","(gothic)"],"\\textcolor":"text color","\\color":"color","\\forall":"for all","\\exists":"there exists","\\nexists":"there does not exist","\\frac":"fraction","\\dfrac":"display fraction","\\cfrac":"continuous fraction","\\tfrac":"text fraction","\\binom":"binomial coefficient","\\dbinom":"display binomial coefficient","\\tbinom":"text binomial coefficient","\\pdiff":"partial differential","\\vec":"vector","\\check":"caron","\\acute":"acute","\\breve":"breve","\\tilde":"tilde","\\dot":"dot","\\hat":["hat","circumflex"],"\\ddot":"double dot","\\bar":"bar","\\prime":"prime","\\doubleprime":"double prime","\\varnothing":"empty set","\\emptyset":"empty set","\\subseteq":"subset of or
    equal to","\\supseteq":"superset of or
    equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
    similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
    natural numbers","\\Z":"set of
    integers","\\Q":"set of
    rational numbers","\\C":"set of
    complex numbers","\\R":"set of
    real numbers","\\P":"set of
    prime numbers","\\lesseqqgtr":"less than, equal to or
    greater than","\\gnapprox":"greater than and
    not approximately","\\lnapprox":"lesser than and
    not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function Ve(t){let e=He[t]||"";return Array.isArray(e)&&(e=e.join("
    ")),e}function Ue(t,e){t.popover.innerHTML=e;const s=t._getCaretPosition();s&&je(t,s),t.popover.classList.add("is-visible")}function je(t,e){const s=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerWidth-document.documentElement.clientWidth,o=window.innerHeight-document.documentElement.clientHeight,n=t.virtualKeyboardVisible?t.virtualKeyboard.offsetHeight:0;e.x+t.popover.offsetWidth/2>i-a?t.popover.style.left=i-t.popover.offsetWidth-a+"px":e.x-t.popover.offsetWidth/2<0?t.popover.style.left=0:t.popover.style.left=e.x-t.popover.offsetWidth/2+"px",e.y+t.popover.offsetHeight+5>s-o-n?(t.popover.classList.add("reverse-direction"),t.popover.style.top=e.y-e.height-t.popover.offsetHeight-5+"px"):(t.popover.classList.remove("reverse-direction"),t.popover.style.top=e.y+5+"px")}function Ge(t){t.popover.classList.remove("is-visible")}var Ze={getNote:Ve,SAMPLES:We,NOTES:He,showPopoverWithLatex:function(t,e,s){if(!e||0===e.length)return void Ge(t);const i=e,a=function(t,e){const s=le.parseTokens(n(t),"math",null,e.config.macros),i=Yt.decompose({mathstyle:"displaystyle",macros:e.config.macros},s),a=N.makeSpan(i,"ML__base"),o=N.makeSpan("","ML__strut");o.setStyle("height",a.height,"em");const r=N.makeSpan("","ML__strut--bottom");return r.setStyle("height",a.height+a.depth,"em"),r.setStyle("vertical-align",-a.depth,"em"),N.makeSpan([o,r,a],"ML__mathlive").toMarkup()}(We[i]||e,t),o=Ve(i),r=xe.forCommand(i);let l=s?'
    ':"";l+='',l+='
    '+a+"
    ",o&&(l+='
    '+o+"
    "),r&&(l+='
    '+r+"
    "),l+="
    ",l+=s?'
    ':"",Ue(t,l);let c=t.popover.getElementsByClassName("ML__popover__content");c&&c.length>0&&t._attachButtonHandlers(c[0],["complete",{acceptSuggestion:!0}]),c=t.popover.getElementsByClassName("ML__popover__prev-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"previousSuggestion"),c=t.popover.getElementsByClassName("ML__popover__next-shortcut"),c&&c.length>0&&t._attachButtonHandlers(c[0],"nextSuggestion")},showPopover:Ue,hidePopover:Ge,updatePopoverPosition:function t(e,s){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(s&&s.deferred)window.requestAnimationFrame(()=>t(e));else if(e.mathlist.anchor()&&"command"===e.mathlist.anchor().type){const t=e._getCaretPosition();t&&je(e,t)}else Ge(e)}};function Xe(t,e,s){let i="";if(Array.isArray(e)&&e.length>0){if("first"===e[0].type&&0===(e=e.slice(1)).length)return"";i=function t(e,s,i,a){if(0===i.length)return"";if(0===s.length)return i.map(t=>t.toLatex(a)).join("");let o="",n="",r="";const l=s[0];let c=i[0][l];"fontFamily"===l&&(c=i[0].fontFamily||i[0].baseFontFamily);const h=function(t,e,s){let i=0;if("fontFamily"===e)for(;t[i]&&("mop"===t[i].type||(t[i].fontFamily||t[i].baseFontFamily)===s);)i++;else if("mode"===e)for(;t[i]&&t[i][e]===s;)i++;else for(;t[i]&&("mop"===t[i].type||t[i][e]===s);)i++;return i}(i,l,c);if("text"===i[0].mode){if("fontShape"===l&&i[0].fontShape)"it"===i[0].fontShape?(n="\\textit{",r="}"):"sl"===i[0].fontShape?(n="\\textsl{",r="}"):"sc"===i[0].fontShape?(n="\\textsc{",r="}"):"n"===i[0].fontShape?(n="\\textup{",r="}"):(n="\\text{\\fontshape{"+i[0].fontShape+"}",r="}");else if("fontSeries"===l&&i[0].fontSeries)"b"===i[0].fontSeries?(n="\\textbf{",r="}"):"l"===i[0].fontSeries?(n="\\textlf{",r="}"):"m"===i[0].fontSeries?(n="\\textmd{",r="}"):(n="\\text{\\fontseries{"+i[0].fontSeries+"}",r="}");else if("mode"===l){let t=!0;for(let e=0;e0&&(s+=" & "),s+=Xe(this,this.array[i][e],t);i1&&(s+=" "),s+=Xe(this,this.body,t),s+="\\right"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" ")):t&&"("===this.leftDelim&&")"===this.rightDelim?s+="("+Xe(this,this.body,t)+")":(s+="\\mleft"+(this.leftDelim||"."),this.leftDelim&&this.leftDelim.length>1&&(s+=" "),s+=Xe(this,this.body,t),s+="\\mright"+(this.rightDelim||"."),this.rightDelim&&this.rightDelim.length>1&&(s+=" "));break;case"delim":case"sizeddelim":s+=n+"{"+this.delim+"}";break;case"rule":s+=n,this.shift&&(s+=`[${Xe(this,this.shift,t)}em]`),s+=`{${Xe(this,this.width,t)}em}{${Xe(this,this.height,t)}em}`;break;case"line":case"overlap":case"accent":s+=`${n}{${Xe(this,this.body,t)}}`;break;case"overunder":s+=`${n}{${Xe(this,this.overscript||this.underscript,t)}}{${Xe(parent,this.body,t)}}`;break;case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":case"":/^\\(mathbin|mathrel|mathopen|mathclose|mathpunct|mathord|mathinner)/.test(n)?s+=n+"{"+Xe(this,this.body,t)+"}":'\\char"'===n?s+=this.latex+" ":"\\unicode"===n?(s+='\\unicode{"',s+=("000000"+this.body.charCodeAt(0).toString(16)).toUpperCase().substr(-6),s+="}"):(this.latex||"string"==typeof this.body)&&(this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:""));break;case"mop":"​"!==this.body&&("\\mathop"===n?s+=n+"{"+Xe(this,this.body,t)+"}":"\\operatorname"===n?s+=n+"{"+Xe(this,this.body,t)+"}":this.latex&&"\\"===this.latex[0]?(s+=this.latex,/[a-zA-Z0-9]$/.test(this.latex)&&(s+=" ")):s+=n||("​"!==this.body?this.latex||this.body:"")),this.explicitLimits&&("limits"===this.limits&&(s+="\\limits "),"nolimits"===this.limits&&(s+="\\nolimits "));break;case"box":if("\\bbox"===n){if(s+=n,isFinite(this.padding)||void 0!==this.border||void 0!==this.backgroundcolor){const t=[];isFinite(this.padding)&&t.push(Math.floor(100*this.padding)/100+"em"),this.border&&t.push("border:"+this.border),this.backgroundcolor&&t.push(se(this.backgroundcolor)),s+=`[${t.join(",")}]`}s+=`{${Xe(this,this.body,t)}}`}else"\\boxed"===n?s+=`\\boxed{${Xe(this,this.body,t)}}`:(s+=n,this.framecolor&&(s+=`{${se(this.framecolor)}}`),this.backgroundcolor&&(s+=`{${se(this.backgroundcolor)}}`),s+=`{${Xe(this,this.body,t)}}`);break;case"spacing":s+=n,"\\hspace"===n||"\\hspace*"===n?(s+="{",this.width?s+=this.width+"em":s+="0em",s+="}"):(s+=" ",this.width&&(s+=this.width+"em "));break;case"enclose":if(s+=n,"\\enclose"===n){s+="{";let t="";for(const i in this.notation)Object.prototype.hasOwnProperty.call(this.notation,i)&&this.notation[i]&&(s+=t+i,t=" ");s+="}";let e="";t="",this.backgroundcolor&&"transparent"!==this.backgroundcolor&&(e+=t+'mathbackground="'+se(this.backgroundcolor)+'"',t=","),this.shadow&&"auto"!==this.shadow&&(e+=t+'shadow="'+this.shadow+'"',t=","),1!==this.strokeWidth||"solid"!==this.strokeStyle?(e+=t+this.borderStyle,t=","):this.strokeColor&&"currentColor"!==this.strokeColor&&(e+=t+'mathcolor="'+se(this.strokeColor)+'"',t=","),e&&(s+=`[${e}]`)}s+=`{${Xe(this,this.body,t)}}`;break;case"mathstyle":s+="\\"+this.mathstyle+" ";break;case"space":s+=this.latex;break;case"placeholder":s+="\\placeholder{"+(this.value||"")+"}";break;case"first":case"command":case"msubsup":break;case"error":s+=this.latex}if(this.superscript){let e=Xe(this,this.superscript,t);1===e.length?("′"===e?e="\\prime ":"″"===e&&(e="\\doubleprime "),s+="^"+e):s+="^{"+e+"}"}if(this.subscript){const e=Xe(this,this.subscript,t);1===e.length?s+="_"+e:s+="_{"+e+"}"}return s},Je.plural=function(t,e,s){(s=s||{}).type=s.type||"cardinal";const i=Je.locale.substring(0,2),a="ordinal"===s.type?Je.ordinal:Je.cardinal;let o,n="ordinal"===s.type?Je._ordinalPluralCategories.indexOf(a.select(t)):Je._cardinalPluralCategories.indexOf(a.select(t));return Je.strings[Je.locale]&&(o=Je.strings[Je.locale][e]),!o&&Je.strings[i]&&(o=Je.strings[i][e]),o||(o=Je.strings.en[e],o||(o=e),n="ordinal"===s.type?Je._ordinalPluralCategories.indexOf(Je._ordinalEnglish.select(t)):Je._cardinalPluralCategories.indexOf(Je._cardinalEnglish.select(t))),o.split(";")[n]||o.split(";")[0]},Je.merge=function(t,e){if(t&&e){const s=Je._locale;Je.locale=t,Je.strings[t]={...Je.strings[t],...e},Je.locale=s}else t&&!e&&(e=t,Object.keys(e).forEach(t=>Je.merge(t,e[t])))},Object.defineProperty(Je,"locale",{set(t){Je._locale=t,Je._ordinal=null,Je._cardinal=null},get:()=>(Je._locale||(Je._locale="undefined"==typeof navigator?"en":navigator.language.slice(0,5)),Je._locale)}),Object.defineProperty(Je,"ordinal",{get:()=>(Je._ordinal||(Je._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),Je._ordinalEnglishPluralCategories=Je._ordinalEnglish.resolvedOptions().pluralCategories,Je._ordinal=new Intl.PluralRules(Je.locale,{type:"ordinal"}),Je._ordinalPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._ordinal)}),Object.defineProperty(Je,"cardinal",{get:()=>(Je._cardinal||(Je._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),Je._cardinalEnglishPluralCategories=Je._cardinalEnglish.resolvedOptions().pluralCategories,Je._cardinal=new Intl.PluralRules(Je.locale,{type:"cardinal"}),Je._cardinaPluralCategories=Je._ordinal.resolvedOptions().pluralCategories),Je._cardinal)}),Je.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Symbols and Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Symbole und römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Σύμβολα και ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Símbolos y letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"علائم و حروف لاتین","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres et symboles romains","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Simboli e lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"記号とローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Symbole i litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Символы и римские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}};const Ye={numeric:{tooltip:"keyboard.tooltip.numeric",layer:"math",label:"123",layers:["math"]},roman:{tooltip:"keyboard.tooltip.roman",layer:"lower-roman",label:"ABC",layers:["lower-roman","upper-roman","symbols"]},greek:{tooltip:"keyboard.tooltip.greek",layer:"lower-greek",label:"αβγ",classes:"tex-math",layers:["lower-greek","upper-greek"]},functions:{tooltip:"keyboard.tooltip.functions",layer:"functions",label:"f ()",classes:"tex",layers:["functions"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},Qe={"\\varphi ":{label:"Φ",insert:"\\Phi "},"\\varsigma ":{label:"Σ",insert:"\\Sigma "},"\\epsilon ":{label:"Ɛ",insert:'{\\char"0190}'},"\\rho ":{label:"Ρ",insert:'{\\char"3A1}'},"\\tau ":{label:"Τ",insert:'{\\char"3A4}'},"\\upsilon ":{label:"Υ",insert:"\\Upsilon "},"\\theta ":{label:"Θ",insert:"\\Theta "},"\\iota ":{label:"Ι",insert:'{\\char"399}'},"\\omicron ":{label:"Ο",insert:'{\\char"39F}'},"\\pi ":{label:"Π",insert:"\\Pi "},"\\alpha ":{label:"Α",insert:'{\\char"391}'},"\\sigma ":{label:"Σ",insert:"\\Sigma "},"\\delta ":{label:"Δ",insert:"\\Delta "},"\\phi ":{label:"Φ",insert:"\\Phi "},"\\gamma ":{label:"Γ",insert:"\\Gamma "},"\\eta ":{label:"Η",insert:'{\\char"397}'},"\\xi ":{label:"Ξ",insert:"\\Xi "},"\\kappa ":{label:"Κ",insert:'{\\char"39A}'},"\\lambda ":{label:"Λ",insert:"\\Lambda "},"\\zeta ":{label:"Ζ",insert:'{\\char"396}'},"\\chi ":{label:"Χ",insert:'{\\char"3A7}'},"\\psi ":{label:"Ψ",insert:"\\Psi "},"\\omega ":{label:"Ω",insert:"\\Omega "},"\\beta ":{label:"Β",insert:'{\\char"392}'},"\\nu ":{label:"Ν",insert:'{\\char"39D}'},"\\mu ":{label:"Μ",insert:'{\\char"39C}'}},ts={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
    ⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
    ³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
    ⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
    ⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let es={};const ss={math:"\n
    \n
      \n
    • x
    • \n
    • n
    • \n
    • \n \n
    • \n
    • e
    • \n
    • i
    • \n
    • \n
    \n
      \n
    • <
    • \n
    • >
    • \n
    • \n \n
    • \n
    • x ²
    • \n
    • x
    • \n
    • \n
    \n
      \n
    • (
    • \n
    • )
    • \n
    • \n \n
    • \n
    • \n
    • \n
    \n \n
      \n
    • \n
    • \n
    • \n \n
    • \n \n
    \n
    \n ","lower-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ,
    • \n
    •  
    • \n \n
    \n
    ","upper-roman":"\n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n \n
    \n
      \n \n
    • ∞≠
    • \n
    • ;
    • \n
    •  
    • \n \n
    \n
    ",symbols:"\n
    \n
      \n \n
    • {
    • \n
    • }
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • [
    • \n
    • ]
    • \n
    • \n
    • \n
    • \n
    • !
    • \n
    • o
    • \n
    • o
    • \n
    • \n
    • \n\n
    \n
      \n \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n\n
    • \n
    \n
      \n \n
    • abc
    • \n
    • \n
    • :
    • \n
    • \n
    • \n
    • \n
    • ±
    • \n \n
    \n
    ","lower-greek":"\n
    \n
    • φ
    • \n
    • ς
    • \n
    • ϵ
    • \n
    • ρ
    • \n
    • τ
    • \n
    • υ
    • \n
    • θ
    • \n
    • ι
    • \n
    • ο
    • \n
    • π
    • \n
    \n
    • α
    • \n
    • σ
    • \n
    • δ
    • \n
    • ϕ
    • \n
    • γ
    • \n
    • η
    • \n
    • ξ
    • \n
    • κ
    • \n
    • λ
    • \n
    \n
    • \n
    • ζ
    • \n
    • χ
    • \n
    • ψ
    • \n
    • ω
    • \n
    • β
    • \n
    • ν
    • \n
    • μ
    • \n
    • \n
    \n
      \n
    •  
    • \n
    • ,
    • \n
    • ε
    • \n
    • ϑ
    • \n
    • ϰ
    • \n
    • ϖ
    • \n
    • ϱ
    • \n \n
    \n
    ","upper-greek":"\n
    \n
    • Φ
    • \n
    • Σ
    • \n
    • Ɛ
    • \n
    • Ρ
    • \n
    • Τ
    • \n
    • Υ
    • \n
    • Θ
    • \n
    • Ι
    • \n
    • Ο
    • \n
    • Π
    \n
    • Α
    • \n
    • Σ
    • \n
    • Δ
    • \n
    • Φ
    • \n
    • Γ
    • \n
    • Η
    • \n
    • Ξ
    • \n
    • Κ
    • \n
    • Λ
    \n
    • \n
    • Ζ
    • \n
    • Χ
    • \n
    • Ψ
    • \n
    • Ω
    • \n
    • Β
    • \n
    • Ν
    • \n
    • Μ
    • \n
    \n
      \n
    •  
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ","lower-command":"\n
    \n
    \n
    \n
    \n
      \n
    • 01#
    • \n
    • {
    • \n
    • }
    • \n
    • ^
    • \n
    • _
    • \n
    •  
    • \n \n
    \n
    ","upper-command":"\n
    \n
    \n
    \n
    \n
      \n
    • \n
    • [
    • \n
    • ]
    • \n
    • (
    • \n
    • )
    • \n
    •  
    • \n \n
    \n
    ","symbols-command":"\n
    \n
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 0
    \n
    • !
    • @
    • #
    • $
    • %
    • ^
    • &
    • *
    • +
    • =
    \n
      \n
    • \\
    • \n
    • |
    • \n
    • /
    • \n
    • `
    • \n
    • ;
    • \n
    • :
    • \n
    • ?
    • \n
    • '
    • \n
    • \"
    • \n
    • \n
    \n
      \n
    • abc
    • \n
    • <
    • \n
    • >
    • \n
    • ~
    • \n
    • ,
    • \n
    • .
    • \n
    •  
    • \n \n
    \n
    ",functions:"\n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
    • \n
    • (
    • \n
    • )
    • \n
    • \n
    • \n
    •  
    • \n \n
    \n
    ",style:"\n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n
    • \n
    • \n
    • \n
    \n
      \n
    • \n
    • \n
    • \n\n
    • \n
    • \n
    • \n
    • \n
    \n
    "};function is(t,e,s){t=t.replace(/(^|[^\\])#@/g,"$1#?");const i=le.parseTokens(n(t),"math",e,s.config.macros),a=Yt.decompose({mathstyle:"displaystyle",macros:s.config.macros},i),o=N.makeSpan(a,"ML__base"),r=N.makeSpan("","ML__strut");r.setStyle("height",o.height,"em");const l=N.makeSpan("","ML__strut--bottom");return l.setStyle("height",o.height+o.depth,"em"),l.setStyle("vertical-align",-o.depth,"em"),N.makeSpan([r,l,o],"ML__mathlive").toMarkup()}function as(t,e,s){let i="
    ";const a=e.replace(/\s+/g," ").split(" ");if(a.length>1){const e=Object.assign({},Ye,t.config.customVirtualKeyboards||{});for(const t of a){if(!e[t])break;i+="
    "+e[t].label+"
    "}}return i+="
    ",i+=`\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n `,""}function os(t,e,s){for(let i=0;i"+a.getAttribute("data-aside").replace(/"/g,'"')+""),a.getAttribute("data-classes")&&a.classList.add(a.getAttribute("data-classes"));let o,n=a.getAttribute("data-insert");if(n&&(n=n.replace(/"/g,'"')),n&&Qe[n]&&(a.setAttribute("data-shifted",Qe[n].label),a.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",Qe[n].insert]))),o=a.getAttribute("data-command")?JSON.parse(a.getAttribute("data-command")):a.getAttribute("data-insert")?["insert",a.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:a.getAttribute("data-latex")?["insert",a.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"auto",resetStyle:!0}]:["typedText",a.getAttribute("data-key")||a.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],s&&(o=[s,o]),a.getAttribute("data-alt-keys")){const t=es[a.getAttribute("data-alt-keys")];t&&(o={default:o,pressAndHoldStart:["showAlternateKeys",a.getAttribute("data-alt-keys"),t],pressAndHoldEnd:"hideAlternateKeys"})}t._attachButtonHandlers(a,o)}}function ns(t,e){const s={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},i=s[t.config.virtualKeyboardLayout]?s[t.config.virtualKeyboardLayout]:s.qwerty;let a,o=e;o=o.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let n=o.match(/()/);for(;n;){a="";const t=n[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),e={};for(const s of t){const t=s.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);e[t[1]]=t[3]}let r=i[e.name];if(r||(r=s.qwerty[e.name]),r)for(const s of r){let t=e.class||"";t&&(t=" "+t),"~"===s?(a+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===s?a+="
  • ":"^"===s?a+="
  • ":"/"===s?a+="
  • ÷
  • ":"*"===s?a+="
  • ×
  • ":"-"===s?a+="
  • ":/tt/.test(t)?a+="
  • '+s+"
  • ":a+="
  • "+s+"
  • "}o=o.replace(new RegExp(n[1]+n[2]+n[3]),a),n=o.match(/()/)}return o}var rs={make:function(t,e){let s='\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ';ts["foreground-color"]=[];for(const d of ae)ts["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+d+'"}]'});ts["background-color"]=[];for(const d of ie)ts["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+d+'"}]'});es={...ts},Object.keys(es).forEach(t=>{es[t]=es[t].slice()});const i="abcdefghijklmnopqrstuvwxyz";for(let d=0;d<26;d++){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[d];es[t]||(es[t]=[]),es[t].unshift({latex:"\\mathbb{"+t+"}",aside:"blackboard",insert:"\\mathbb{"+t+"}"}),es[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),es[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),es[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),es[t].unshift({latex:"\\mathcal{"+t+"}",aside:"script",insert:"\\mathcal{"+t+"}"}),es[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"}),es[t].unshift({latex:"\\mathbb{"+i[d]+"}",aside:"blackboard",insert:"\\mathbb{"+i[d]+"}"}),es[t].unshift({latex:"\\mathbf{"+i[d]+"}",aside:"bold",insert:"\\mathbf{"+i[d]+"}"}),es[t].unshift({latex:"\\mathsf{"+i[d]+"}",aside:"sans",insert:"\\mathsf{"+i[d]+"}"}),es[t].unshift({latex:"\\mathcal{"+i[d]+"}",aside:"script",insert:"\\mathcal{"+i[d]+"}"}),es[t].unshift({latex:"\\mathfrak{"+i[d]+"}",aside:"fraktur",insert:"\\mathfrak{"+i[d]+"}"})}for(let d=0;d<=26;d++){const t=i[d];es[t]||(es[t]=[]),es[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathbb{"+t+"}"}),es[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),es[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),es[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}for(let d=0;d<10;d++){const t="0123456789"[d];es[t]||(es[t]=[]),es[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),es[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),es[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),es[t].unshift({latex:"\\mathcal{"+t+"}",aside:"script",insert:"\\mathcal{"+t+"}"}),es[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}let a=t.config.virtualKeyboards;a||(a="all"),a=a.replace(/\ball\b/i,"numeric roman greek functions command");const o=Object.assign({},ss,t.config.customVirtualKeyboardLayers||{}),n=Object.assign({},Ye,t.config.customVirtualKeyboards||{}),r=a.replace(/\s+/g," ").split(" ");for(const d of r){if(!n[d])break;let e=n[d].layers||[];n[d].layer&&e.push(n[d].layer),e=Array.from(new Set(e));for(const i of e){if(!o[i])break;if("object"==typeof o[i]){let t="";if(o[i].styles&&(t+=``),o[i].backdrop&&(t+=`
    `),o[i].container&&(t+=`
    `),o[i].rows){t+="
    ";for(const e of o[i].rows){t+="
      ";for(const s of e)t+="${s.label?s.label:""}`;t+="
    "}t+="
    ",o[i].container&&(t+=""),o[i].backdrop&&(t+="")}o[i]=t}s+="
    ",s+=as(t,a,d);const e="function"==typeof o[i]?o[i]():o[i];s+=ns(t,e),s+="
    "}}const l=document.createElement("div");l.className="ML__keyboard",e?l.classList.add(e):t.config.virtualKeyboardTheme?l.classList.add(t.config.virtualKeyboardTheme):/android|cros/i.test(navigator.userAgent)&&l.classList.add("material"),l.innerHTML=s,os(t,l.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton"));const c=l.getElementsByClassName("layer-switch");for(let d=0;d{t.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),t.addEventListener("touchstart",t=>{t.preventDefault(),t.stopPropagation()})}),h[0].classList.add("is-visible"),window.addEventListener("mouseup",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("blur",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchend",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),window.addEventListener("touchcancel",(function(){t.hideAlternateKeys_(),t.unshiftKeyboardLayer_()})),l},makeKeycap:os};const ls={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},cs={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"},hs={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function ds(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ps(t,e){return t&&e.generateID?' extid="'+t+'"':""}function ms(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="",n=-1,r=-1;const l=t.atoms[t.index];if(t.index0){if(i=!0,us(t)&&(n=t.index,t.index+=1),fs(t)&&(r=t.index,t.index+=1),n>=0&&r>=0)a=""+o,a+=vs(t.atoms[r].subscript,0,0,s).mathML,a+=vs(t.atoms[n].superscript,0,0,s).mathML,a+="";else if(n>=0){if(a=""+o,us(t)){const e=vs(t.atoms[n].superscript,0,0,s).mathML,i=vs(t.atoms[n+1].superscript,0,0,s).mathML;a+=""!==e&&""!==e||""!==i&&""!==i?""===e||""===e?"":e:""}else a+=vs(t.atoms[n].superscript,0,0,s).mathML;a+=""}else r>=0?(a=""+o,a+=vs(t.atoms[r].subscript,0,0,s).mathML,a+=""):a=o;"mi"!==t.lastType&&"mn"!==t.lastType&&"mtext"!==t.lastType&&"fence"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),o.endsWith(">f")||o.endsWith(">g")?(a+="",t.lastType="applyfunction"):t.lastType=/^(.*)<\/mo>$/.test(a)?"mo":"mi",t.mathML+=a}return i}function us(t){return t.index"+t,a+=vs(o.subscript,0,0,s).mathML,a+=vs(o.superscript,0,0,s).mathML,a+=""):o.superscript?(a=""+t,a+=vs(o.superscript,0,0,s).mathML,a+=""):o.subscript&&(a=""+t,a+=vs(o.subscript,0,0,s).mathML,a+=""),a.length>0&&(i=!0,e.mathML+=a,e.lastType=""),i))}function ys(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="";for(;t.index0&&(i=!0,o=""+o+"",t.mathML+=o,t.lastType="mtext"),i}function bs(t,e,s){let i=!1;e=e||t.atoms.length;const a=t.index;let o="",n=function(t){let e=-1,s=t.index,i=!1,a=!1;for(;s=0&&n=0;)o+=t.atoms[t.index].body,t.index+=1;return o.length>0&&(i=!0,o=""+o+"",n<0&&us(t)&&(n=t.index,t.index+=1),n>=0&&(o=""+o,o+=vs(t.atoms[n].superscript,0,0,s).mathML,o+=""),t.mathML+=o,t.lastType="mn"),i}function xs(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";if(t.index",a+=ws(t.atoms[l],s),a+=vs(t.atoms,l+1,c,s).mathML,a+=ws(t.atoms[c],s),a+="","mi"!==t.lastType&&"mn"!==t.lastType&&"mfrac"!==t.lastType&&"fence"!==t.lastType||(a=""+a),t.index=c+1,gs(a,t,s)&&(i=!0,t.lastType="",a=""),o="fence")}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function ks(t,e,s){let i=!1;e=e||t.atoms.length;let a="",o="";const n=t.atoms[t.index];if(t.index":"")+t,a+=vs(n.subscript,0,0,s).mathML,a+=vs(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):n.superscript?(a+=("nolimits"!==n.limits?"":"")+t,a+=vs(n.superscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""):(a+=("nolimits"!==n.limits?"":"")+t,a+=vs(n.subscript,0,0,s).mathML,a+="nolimits"!==n.limits?"":""),o="mo"}else{const e=t.atoms[t.index],n=0===e.latex.indexOf("\\operatorname"),r=n?'"+Ss(e.body)+"":ws(e,s);a+=r,t.index+=1,gs(a,t,s)&&(i=!0,t.lastType="",a=""),t.index-=1,n||/^(.*)<\/mo>$/.test(r)?o=n?"mi":"mo":(a+="",o="applyfunction")}"mi"!==t.lastType&&"mn"!==t.lastType||/^(.*)<\/mo>$/.test(a)||(a=""+a),t.index+=1}return a.length>0&&(i=!0,t.mathML+=a,t.lastType=o),i}function vs(t,e,s,i){const a={atoms:t,index:e||0,mathML:"",lastType:""};if(s=s||(t?t.length:0),"number"==typeof t||"boolean"==typeof t)a.mathML=t.toString();else if("string"==typeof t)a.mathML=t;else if(t&&"function"==typeof t.toMathML)a.mathML=t.toMathML(i);else if(Array.isArray(t)){let t=0;for(;a.index0&&"genfrac"===a.atoms[a.index].type&&(e=""+e),"genfrac"===a.atoms[a.index].type?a.lastType="mfrac":a.lastType="",e.length>0&&(a.mathML+=e,t+=1),a.index+=1}t>1&&(a.mathML=""+a.mathML+"")}return a}function ws(t,e){let s="";const i=Ss(t.body);return i&&(s=""+i+""),s}function Ss(t){if(!t)return"";if("string"==typeof t)return ds(t);if(!Array.isArray(t)&&"string"==typeof t.body)return ds(t.body);let e="";for(const s of t)"string"==typeof s.body&&(e+=s.body);return ds(e)}Yt.MathAtom.prototype.toMathML=function(t){const e={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let i,a,o,n,r,l,c="",h="",d={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[this.fontFamily||this.font]||"";d&&(d=' mathvariant="'+d+'"');const p=this.latex?this.latex.trim():null;if("text"===this.mode)c=""+this.body+"";else switch(this.type){case"first":break;case"group":case"root":c=vs(this.body,0,0,t).mathML;break;case"array":if((this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(c+="",this.lFence&&"."!==this.lFence&&(c+=""+(hs[this.lFence]||this.lFence)+"")),c+="",i=0;i"+vs(this.array[a][i],0,0,t).mathML+"";c+=""}c+="",(this.lFence&&"."!==this.lFence||this.rFence&&"."!==this.rFence)&&(this.rFence&&"."!==this.rFence&&(c+=""+(hs[this.lFence]||this.rFence)+""),c+="");break;case"genfrac":(this.leftDelim||this.rightDelim)&&(c+=""),this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hs[this.leftDelim]||this.leftDelim)+""),this.hasBarLine?(c+="",c+=vs(this.numer,0,0,t).mathML||" ",c+=vs(this.denom,0,0,t).mathML||" ",c+=""):(c+="",c+=""+vs(this.numer,0,0,t).mathML+"",c+=""+vs(this.denom,0,0,t).mathML+"",c+=""),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hs[this.rightDelim]||this.rightDelim)+""),(this.leftDelim||this.rightDelim)&&(c+="");break;case"surd":this.index?(c+="",c+=vs(this.body,0,0,t).mathML,c+=vs(this.index,0,0,t).mathML,c+=""):(c+="",c+=vs(this.body,0,0,t).mathML,c+="");break;case"leftright":c="",this.leftDelim&&"."!==this.leftDelim&&(c+=""+(hs[this.leftDelim]||this.leftDelim)+""),this.body&&(c+=vs(this.body,0,0,t).mathML),this.rightDelim&&"."!==this.rightDelim&&(c+=""+(hs[this.rightDelim]||this.rightDelim)+""),c+="";break;case"sizeddelim":case"delim":c+='"+(hs[this.delim]||this.delim)+"";break;case"accent":c+='",c+=vs(this.body,0,0,t).mathML,c+=""+(hs[p]||this.accent)+"",c+="";break;case"line":case"overlap":break;case"overunder":r=this.overscript,n=this.underscript,r&&n?l=this.body:r?(l=this.body,this.body[0]&&this.body[0].underscript?(n=this.body[0].underscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].underscript&&(n=this.body[1].underscript,l=this.body[1].body)):n&&(l=this.body,this.body[0]&&this.body[0].overscript?(r=this.body[0].overscript,l=this.body[0].body):this.body[0]&&"first"===this.body[0].type&&this.body[1]&&this.body[1].overscript&&(r=this.body[1].overscript,l=this.body[1].body)),r&&n?(c+=""+vs(l,0,0,t).mathML,c+=vs(n,0,0,t).mathML,c+=vs(r,0,0,t).mathML,c+=""):r?(c+=""+vs(l,0,0,t).mathML,c+=vs(r,0,0,t).mathML,c+=""):n&&(c+=""+vs(l,0,0,t).mathML,c+=vs(n,0,0,t).mathML,c+="");break;case"placeholder":case"mord":{c=e[p]||p||("string"==typeof this.body?this.body:"");const s=p?p.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;s?c="&#x"+s[1]+";":c.length>0&&"\\"===c.charAt(0)&&(c="string"==typeof this.body&&this.body.charCodeAt(0)>255?"&#x"+("000000"+this.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof this.body?this.body.charAt(0):this.body);const i=/\d/.test(c)?"mn":"mi";c="<"+i+d+ps(this.id,t)+">"+ds(c)+"";break}case"mbin":case"mrel":case"textord":case"minner":c=p&&e[p]?""+e[p]+"":p&&hs[p]?""+hs[p]+"":ws(this,t);break;case"mpunct":c='"+(hs[p]||p)+"";break;case"mop":"​"!==this.body&&(c="",c+="\\operatorname"===p?this.body:p||this.body,c+="");break;case"mathstyle":break;case"box":c='"+vs(this.body,0,0,t).mathML+"";break;case"spacing":c+='';break;case"enclose":c=''+vs(this.body,0,0,t).mathML+"";break;case"space":c+=" "}return c},Yt.toMathML=function(t,e){return vs(t,0,0,e).mathML};const As={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},Ms={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Cs={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},_s={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function Ts(t,e){return Array.isArray(t.arg)?t.arg[e]:void 0}function Ls(t){return t&&_s[t]||-1}function Fs(t){return/=|=>/.test(t)?"right":"left"}function Ds(t){if("f"===t||"g"===t)return!0;const e=Cs[t];return!!e&&!!/%[^01_^]?/.test(e)}function zs(t){t=(t||"").trim();let e=As[t];if(!e)if(/^\\[^{}]+$/.test(t)){const s=wt.getInfo(t,"math",{});e=s&&s.value||t.slice(1)}else e=t;return e}function Es(t){if(!t)return null;const e=zs($s(t)),s=[Ls(e),Fs(e)];return s[0]<=0?null:s}function qs(t){return null!==Es(t)}const Is={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},Ps={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},Bs={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},Os={",":"list",";":"list2"};function $s(t){if("string"==typeof t)return t;if(Array.isArray(t)){let e="";for(const s of t)e+=$s(s);return e}if(t.latex&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(t.latex))return t.latex.trim();if("leftright"===t.type)return"";if("string"==typeof t.body)return t.body;if(Array.isArray(t.body)){let e="";for(const s of t.body)e+=$s(s);return e}return""}function Rs(t){return"string"==typeof t.sym?function(t){let e=Cs[t];if(e)return e.replace("%1","").replace("%0","").replace("%","");if(t.length>1){const s=wt.getInfo("\\"+t,"math");!s||s.fontFamily&&"cmr"!==s.fontFamily&&"ams"!==s.fontFamily||(e="\\"+t)}return e||(e=wt.unicodeStringToLatex("math",t)),e}(t.sym)||t.sym:""}function Ks(t){return parseFloat(t.num)}function Ns(t){return"object"==typeof t&&void 0!==t.num}function Ws(t){let e=0;return Ns(t)&&(e="object"==typeof t.num?void 0!==t.num.re?li(t.num.re):0:parseFloat(t.num)),e}function Hs(t){let e=0;return Ns(t)&&"object"==typeof t.num&&(e=void 0!==t.num.im?li(t.num.im):0),e}function Vs(t){return t&&void 0!==t.sup}function Us(t){return t&&void 0!==t.sub}function js(t,e,s){let i=!1;const a=t.atoms[t.index];return a&&a.type===e&&(i=void 0===s||$s(a)===s),i}function Gs(t,...e){const s={fn:t};if(e){const t=[];for(const s of e)s&&t.push(s);t.length>0&&(s.arg=t)}return s}function Zs(t){return"number"==typeof t?{num:t.toString()}:"string"==typeof t?{num:t}:"object"==typeof t?{num:t}:void 0}function Xs(t){if(Ns(t)){const e=Ws(t),s=Hs(t);return 0!==s?(0!==e&&(t.num.re=(-e).toString()),t.num.im=(-s).toString()):t.num=(-e).toString(),t}return Gs("negate",t)}function Js(t){const e=t.atoms[t.index+1];return e&&"msubsup"===e.type}function Ys(t,e){let s=t.atoms[t.index];return!s||void 0===s.superscript&&void 0===s.subscript?s=null:t.index+=1,s||(s=t.atoms[t.index+1],s&&"msubsup"===s.type&&(s.superscript||s.subscript)?t.index+=2:s=null),s?(void 0!==s.subscript&&(t.ast.sub=oi(s.subscript,e)),void 0!==s.superscript&&("msubsup"===s.type?/['\u2032]|\\prime/.test($s(s.superscript))?(t.index+=1,s=t.atoms[t.index+1],s&&"msubsup"===s.type&&/['\u2032]|\\prime/.test($s(s.superscript))?t.ast.sup={sym:"″"}:(t.ast.sup={sym:"′"},t.index-=1)):/['\u2033]|\\doubleprime/.test($s(s.superscript))?t.ast.sup={sym:"″"}:t.ast&&(t.ast.sup=oi(s.superscript,e)):t.ast.sup=oi(s.superscript,e))):t.index+=1,t}function Qs(t,e){const s=t.ast;if(ei(t,"!!"))return t.index+=1,t.ast=Gs("factorial2",s),Qs(t=Ys(t,e),e);if(ei(t,"++"))return t.index+=1,t.ast=Gs("increment",s),Qs(t=Ys(t,e),e);if(ei(t,"--"))return t.index+=1,t.ast=Gs("decrement",s),Qs(t=Ys(t,e),e);const i=t.atoms[t.index];return i&&i.latex&&Ps[i.latex.trim()]&&(t.ast=Gs(Ps[i.latex.trim()],s),t=Qs(t=Ys(t,e),e)),t}function ti(t,e,s,i){if(t.index=t.index||0,0===t.atoms.length||t.index>=t.atoms.length)return t.ast=void 0,t;const a=t.minPrec;t.minPrec=0;let o=t.atoms[t.index];if(e){if("mopen"===o.type&&$s(o)===e)t.index+=1,o=(t=ii(t,i)).atoms[t.index],o&&"mclose"===o.type&&$s(o)===s&&(Js(t)&&(t.ast={group:t.ast}),t=Qs(t=Ys(t,i),i));else if("textord"===o.type&&$s(o)===e)t.index+=1,o=(t=ii(t,i)).atoms[t.index],o&&"textord"===o.type&&$s(o)===s&&(t.index+=1,t=Qs(t=Ys(t,i),i));else if("\\lVert"===e&&"textord"===o.type&&"|"===o.latex){if(o=t.atoms[t.index+1],o&&"textord"===o.type&&"|"===o.latex){t.index+=2,o=(t=ii(t,i)).atoms[t.index];const e=t.atoms[t.index+1];o&&"textord"===o.type&&"|"===o.latex&&e&&"textord"===e.type&&"|"===e.latex&&(t.index+=2,t=Qs(t=Ys(t,i),i))}}else if("sizeddelim"===o.type&&o.delim===e)t.index+=1,o=(t=ii(t,i)).atoms[t.index],o&&"sizeddelim"===o.type&&o.delim===s&&(t.index+=1,t=Qs(t=Ys(t,i),i));else{if("leftright"!==o.type||o.leftDelim!==e||"?"!==o.rightDelim&&o.rightDelim!==s)return;t.ast=oi(o.body,i),Js(t)&&(t.ast={group:t.ast}),t=Qs(t=Ys(t,i),i)}return t.minPrec=a,t}{let i=!0;if("mopen"===o.type?(e=o.latex.trim(),s=wt.RIGHT_DELIM[e]):"sizeddelim"===o.type?(e=o.delim,s=wt.RIGHT_DELIM[e]):"leftright"===o.type?(i=!1,e=o.leftDelim,"?"===(s=o.rightDelim)&&(s=wt.RIGHT_DELIM[e])):"textord"===o.type&&(e=o.latex.trim(),s=wt.RIGHT_DELIM[e]),e&&s){if("|"===e&&"|"===s){const i=t.atoms[t.index+1];i&&"textord"===i.type&&"|"===i.latex&&(e="\\lVert",s="\\rVert")}if(t=ti(t,e,s))return i&&(t.index+=1),t.ast={fn:Is[e+s]||e+s,arg:[t.ast]},t.minPrec=a,t}}}function ei(t,e){return t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)&&e===$s(t.atoms[t.index])+$s(t.atoms[t.index+1])}function si(t){if(t.index=t.index||0,!(t.atoms.length<=1||t.index>=t.atoms.length-1)){if(!js(t,"textord","\\nabla")){const e=t.atoms[t.index].latex+t.atoms[t.index+1].latex,s=/^(>=|<=|>>|<<|:=|!=)$/.test(e)?e:"";return s&&(t.index+=1),s}return t.index+=1,js(t,"mbin","\\times")?(t.index+=1,t.ast="curl",t):js(t,"mbin","\\cdot")?(t.index+=1,t.ast="div",t):void(t.index-=1)}}function ii(t,e){if(t.index=t.index||0,t.ast=void 0,0===t.atoms.length||t.index>=t.atoms.length)return t;t.minPrec=t.minPrec||0;let s=function t(e,s){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let i=e.atoms[e.index];if("text"===i.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const a=zs($s(i));if(si(e))e.ast=Gs(e.ast,t(e,s).ast);else{if("root"===i.type)return e.index=0,e.atoms=i.body,t(e,s);if("mbin"===i.type&&"-"===a)e.index+=1,(e=t(e,s)).ast=Xs(e.ast);else if("mbin"===i.type&&"+"===a)e.index+=1,(e=t(e,s)).ast=Gs("add",e.ast);else if("mord"===i.type&&/^[0-9.]$/.test(i.latex)){let a="",o=!1,n=/^[0-9.eEdD]$/;for(;e.indext.map(t=>ai(t)))),e=[t])}return e}function oi(t,e){return function(t,e){t.index=t.index||0,t.ast=void 0;const s=[];for(;t.atoms[t.index];)if("text"===t.atoms[t.index].mode){let e="";for(;t.atoms[t.index]&&"text"===t.atoms[t.index].mode;)e+=t.atoms[t.index].body,t.index+=1;s.push(e)}else{const i=ii(t,e).ast;if(!i)return;s.push(i)}return s.length>1?Gs("text",...s):s[0]||void 0}({atoms:ai(t)},e)}function ni(t){const e=Array.prototype.slice.call(arguments);e.shift(),t=t||".. ";let s="";if(e.length>0){"."!==t[0]&&(s+=t[0]);let i="";for(const a of e)s+=i+a,i=t[2];"."!==t[1]&&(s+=t[1])}return s}function ri(t,e){const s=t.length;t=t.substr(0,e.precision-2);for(let i=0;i1&&(s+o.repeat(n+1)).startsWith(t))return"0"===o?s.replace(/(\d{3})/g,"$1"+e.groupSeparator):s.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.beginRepeatingDigits+o.replace(/(\d{3})/g,"$1"+e.groupSeparator)+e.endRepeatingDigits}}return s!==t.length&&(t+="\\ldots"),t.replace(/(\d{3})/g,"$1"+e.groupSeparator)}function li(t){return parseFloat(parseFloat(t).toPrecision(15))}function ci(t,e){let s="";if("number"==typeof e.precision){if("number"!=typeof t){let s="",i="";if("-"===t[0]?(s="-",t=t.substr(1)):"+"===t[0]&&(t=t.substr(1)),t.indexOf(".")>=0){const a=t.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),o=a[1],n=a[2].substring(0,Math.min(e.precision-o.length,a[2].length));if(i=a[4]||"","0"===o){let i=0;for(;"0"===n[i]&&i=e.precision)a="0",s="";else{a=t[i];const s=ri(t.substr(i+1),e);s&&(a+=e.decimalMarker+s)}"0"!==a&&(t.length-1>e.precision&&!a.endsWith("}")&&!a.endsWith("\\ldots")&&(a+="\\ldots"),i>4&&(a+=e.exponentProduct,e.exponentMarker?a+=e.exponentMarker+(1-i).toString():a+="10^{"+(1-i).toString()+"}")),t=a}else{t=o.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);const s=ri(n,e);s&&(t+=e.decimalMarker+s)}}else if(t.length>e.precision){const s=t.length;let i=t[0];const a=ri(t.substr(2),e);a&&(i+=e.decimalMarker+a,"}"!==i[i.length-1]&&(i+="\\ldots")),"1"!==i?i+=e.exponentProduct:i="",e.exponentMarker?i+=e.exponentMarker+(s-2).toString():i+="10^{"+(s-2).toString()+"}",t=i}else t=t.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator);return i&&(i=e.exponentMarker?e.exponentMarker+i:e.exponentProduct+" 10^{"+i+"}"),s+t+i}t=li(t)}if("engineering"===e.scientificNotation)if(0===t)s="0";else{const i=Math.abs(t);let a=Math.round(Math.log10(i));a-=a%3,i<1e3&&(a=0);let o=i/Math.pow(10,a);const n=o.toString().match(/^(.*)\.(.*)$/);n&&n[1]&&n[2]&&(o=n[1]+e.decimalMarker+n[2]),e.groupSeparator&&(o=ri(o.toExponential(),e)),a=0===a?"":e.exponentMarker?e.exponentMarker+a:e.exponentProduct+" 10^{"+a+"}",s=(t<0?"-":"")+o+a}else{const i="string"==typeof t?t:t.toString();let a,o,n,r=i.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);a=i,n="",r&&r[1]&&r[2]&&(a=r[1],o=e.exponentMarker?e.exponentMarker+r[2]:e.exponentProduct+" 10^{"+r[2]+"}"),r=a.match(/^(.*)\.(.*)$/),r&&r[1]&&r[2]&&(a=r[1],n=r[2]),e.groupSeparator&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,e.groupSeparator),n=ri(n,e)),n&&(n=e.decimalMarker+n),s=a+n+(o||"")}return s}Yt.MathAtom.prototype.toAST=function(t){let e,s,i,a,o={},r="",l={bb:"double-struck",cal:"script",scr:"script",frak:"fraktur",cmrss:"sans-serif",cmrtt:"monospace"}[this.baseFontFamily||this.fontFamily],c="";"b"===this.fontSeries&&(c+="bold"),"it"===this.fontShape&&(c+="italic");const h=this.latex?this.latex.trim():null;switch(this.type){case"root":case"group":this.latex&&this.latex.startsWith("\\nicefrac")?(e=this.latex.slice(9).match(/({.*}|[^}])({.*}|[^}])/),e?(s=1===e[1].length?e[1]:e[1].substr(1,e[1].length-2),s=le.parseTokens(n(s),"math",null,t.macros),i=1===e[2].length?e[2]:e[2].substr(1,e[2].length-2),i=le.parseTokens(n(i),"math",null,t.macros),o=Gs("divide",oi(s,t),oi(i,t))):o.fn="divide"):o.group=oi(this.body,t);break;case"genfrac":o=Gs("divide",oi(this.numer,t),this.denom&&this.denom[0]&&"placeholder"===this.denom[0].type?Zs(1):oi(this.denom,t));break;case"surd":o=this.index?Gs("pow",oi(this.body,t),Gs("divide",Zs(1),oi(this.index,t))):Gs("sqrt",oi(this.body,t));break;case"rule":break;case"line":case"overlap":case"accent":case"overunder":break;case"mord":case"textord":case"mbin":e=h?h.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):void 0,e?r=String.fromCodePoint(parseInt(e[1],16)):(r=zs($s(this)),r.length>0&&"\\"===r.charAt(0)&&"string"==typeof this.body&&(r=this.body)),a=wt.mathVariantToUnicode(r,l,c).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),a!==r?(o={sym:a},l="normal"):o={sym:r};break;case"minner":case"mop":break;case"box":o=oi(this.body,t);break;case"enclose":break;case"array":if("cardinality"===this.env.name)o=Gs("card",oi(this.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(this.env.name)){o={fn:"array",args:[]};for(const e of this.array)o.args.push(e.map(e=>oi(e,t)))}else if("cases"===this.env.name){o={fn:"cases",args:[]};for(const e of this.array)if(e[0]){const s=[];s.push(oi(e[0],t));let i=oi(e[1],t);i&&"text"===i.fn&&i.arg&&/^(if|when|for)$/i.test(i.arg[0].trim())&&(i=i.arg.filter(t=>"string"!=typeof t)),s.push(i||{}),o.args.push(s)}}break;case"spacing":case"space":case"mathstyle":break;default:o=void 0}return o&&l&&"normal"!==l&&(o.variant=l),o&&"string"==typeof this.cssClass&&(o.class=this.cssClass),o&&"string"==typeof this.cssId&&(o.id=this.cssId),o},Yt.toAST=function(t,e){return oi(t,e)};var hi=function t(e,s){const i=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},s);let a="";if(void 0===e)return"";if("string"==typeof e&&(e=JSON.parse(e)),e.latex)a=e.latex;else if(Ns(e)){const s=Ks(e);if(s===-1/0)a="-\\infty ";else if(s===1/0)a="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)a=isNaN(s)?"\\text{NaN}":ci(e.num,i);else{const t=Ws(e),s=Hs(e);isNaN(t)||isNaN(s)?a="\\text{NaN}":Math.abs(s)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?a="0":(Math.abs(t)>Number.EPSILON&&(a=ci(t,i)),Math.abs(s)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(a+=s>0?"+":""),a+=(1!==Math.abs(s)?ci(s,i):"")+"\\imaginaryI "))}Vs(e)&&(a+="^{"+t(e.sup,i)+"}"),Us(e)&&(a+="_{"+t(e.sub,i)+"}")}else if(e.group)a=t(e.group,i),Ns(e.group)||Rs(e.group)?0!==Hs(e.group)&&(a=ni(e.fence||"(),",a)):a=ni(e.fence||"(),",a),Vs(e)&&(a+="^{"+t(e.sup,i)+"}"),Us(e)&&(a+="_{"+t(e.sub,i)+"}");else if(e.fn)if("bind"===e.fn){if(a=t(Ts(e,0),i)+"|_{",e.arg&&2===e.arg.length)a+=t(Ts(e,1));else{let s="";for(let i=1;i=2)a=t(Ts(e,0),i),Ns(Ts(e,0))||Rs(Ts(e,0))||(a=ni(e.fence||"(),",a)),a+="^{"+t(Ts(e,1),i)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)a=e.arg.map(e=>t(e,i)).join(" = ");else{const s=function(t){let e=Cs[t];return e||(e=t.length>1?"\\operatorname{"+t+"}%^%_ %":t+"%^%_ %"),e}(e.fn);a=s;let o="";if(/%(?![01_^])/.test(s)&&Array.isArray(e.arg)&&e.arg.length>1)a+=ni(e.fence||"(),",...e.arg.map(e=>t(e,i)));else if(Array.isArray(e.arg)&&e.arg.length>0){const n=t(Ts(e,0),i),r=t(Ts(e,1),i),l=[...e.arg];/%0/.test(s)&&(a=a.replace("%0",n),l.shift()),/%1/.test(s)&&(a=a.replace("%1",r),l.shift()),l.length>0&&(o=ni(e.fence||"(),",...l.map(e=>t(e,i))))}else o=ni(e.fence||"(),","");a=Vs(e)?a.replace("%^","^{"+t(e.sup,i)+"}"):a.replace("%^",""),a=Us(e)?a.replace("%_","_{"+t(e.sub,i)+"}"):a.replace("%_",""),a=a.replace(/%(?![01_^])/,o),a=a.replace("%0","").replace("%1","")}else{const s=[];for(const a of e.arg)"add"===a.fn||"subtract"===a.fn?s.push(ni("() ",t(a,i))):0!==Ws(o=a)&&0!==Hs(o)?s.push(ni("() ",t(a,i))):Vs(e)&&0!==Hs(a)&&1!==Hs(a)?s.push(ni("() ",t(a,i))):s.push(t(a,i));if("multiply"===e.fn)a=!e.arg||2!==e.arg.length||!Ns(e.arg[0])&&"divide"!==e.arg[0].fn||Ns(e.arg[1])&&(0!==Ws(e.arg[1])||1!==Hs(e.arg[1]))?s.join(" \\times "):s[0]+s[1];else if(e.arg&&1===e.arg.length)a="negate"===e.arg[0].fn||Ns(e.arg[0])&&Ks(e.arg[0])<0?s[0]:"+"+s[0];else{a=s[0];for(let t=1;ta',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function pi(t){let e=0;if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&(e+=1);return 1===e}function mi(t){let e="";if(t&&Array.isArray(t))for(const s of t)"first"!==s.type&&"string"==typeof s.body&&(e+=s.body);return e}function ui(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.addEventListener(e[1],s,a)}else t.addEventListener(a,s,i)}}function fi(t,e,s,i){e=e.split(" ");for(const a of e){const e=a.match(/(.*):(.*)/);if(e){const a=i||{};"active"===e[2]?a.passive=!1:a[e[2]]=!0,t.removeEventListener(e[1],s,a)}else t.removeEventListener(a,s,i)}}function gi(t,e){let s=document.getElementById(t);return s?s.setAttribute("data-refcount",parseInt(s.getAttribute("data-refcount"))+1):(s=document.createElement("div"),s.setAttribute("aria-hidden","true"),s.setAttribute("data-refcount","1"),s.className=e,s.id=t,document.body.appendChild(s)),s}function yi(t){if(!t)return null;const e=parseInt(t.getAttribute("data-refcount"));return e&&1!==e?t.setAttribute("data-refcount",e-1):t.remove(),t}function bi(t){return t.element&&t.element.mathfield===t}Yt.toSpeakableFragment=function(t,e){function s(t){return""+t+""}if(!t)return"";let i="";if(t.id&&"math"===e.speechMode&&(i+=''),Array.isArray(t)){let a=!1,o=!1;for(let n=0;n'+o+'. End fraction.';break;case"surd":if(n=Yt.toSpeakableFragment(t.body,e),t.index){let s=Yt.toSpeakableFragment(t.index,e);s=s.trim();const a=s.replace(//g,"");i+="3"===a?' the cube root of '+n+'. End cube root':"n"===a?' the nth root of '+n+'. End root':' the root with index: '+s+', of '+n+'. End root'}else pi(t.body)?i+=" the square root of "+n+" , ":i+=' the square root of '+n+'. End square root';break;case"accent":break;case"leftright":i+=di[t.leftDelim]||t.leftDelim,i+=Yt.toSpeakableFragment(t.body,e),i+=di[t.rightDelim]||t.rightDelim;break;case"line":case"rule":case"overunder":case"overlap":break;case"placeholder":i+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const s=t.latex?t.latex.trim():"";if("\\mathbin"===s||"\\mathrel"===s||"\\mathopen"===s||"\\mathclose"===s||"\\mathpunct"===s||"\\mathord"===s||"\\mathinner"===s){i=Yt.toSpeakableFragment(t.body,e);break}let a=t.body,o=t.latex;if("delim"!==t.type&&"sizeddelim"!==t.type||(a=o=t.delim),"text"===e.speechMode)i+=a;else{if("mbin"===t.type&&(i+=''),a){const t=di[a]||(o?di[o.trim()]:"");if(t)i+=" "+t;else{const t=o?function(t){let e=Ze.NOTES[t];return e||"\\"!==t.charAt(0)||(e=" "+t.replace("\\","")+" "),Array.isArray(e)&&(e=e[0]),e}(o.trim()):"";i+=t||function(t){let s="";return e.textToSpeechMarkup?/[a-z]/.test(t)?s+=' '+t+"":/[A-Z]/.test(t)?s+="capital "+t.toLowerCase():s+=t:/[a-z]/.test(t)?s+=" '"+t.toUpperCase()+"'":/[A-Z]/.test(t)?s+=" 'capital "+t.toUpperCase()+"'":s+=t,s}(a)}}else i+=Yt.toSpeakableFragment(t.body,e);"mbin"===t.type&&(i+='')}break}case"mop":if("​"!==t.body){const a=t.latex?t.latex.trim():"";if("\\sum"===a)if(t.superscript&&t.subscript){let s=Yt.toSpeakableFragment(t.superscript,e);s=s.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the summation from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=Yt.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the summation from '+s+' of ',r=!0}else i+=" the summation of";else if("\\prod"===a)if(t.superscript&&t.subscript){let s=Yt.toSpeakableFragment(t.superscript,e);s=s.trim();let a=Yt.toSpeakableFragment(t.subscript,e);a=a.trim(),i+=' the product from '+a+' to '+s+' of ',r=!0}else if(t.subscript){let s=Yt.toSpeakableFragment(t.subscript,e);s=s.trim(),i+=' the product from '+s+' of ',r=!0}else i+=" the product of ";else if("\\int"===a)if(t.superscript&&t.subscript){let a=Yt.toSpeakableFragment(t.superscript,e);a=a.trim();let o=Yt.toSpeakableFragment(t.subscript,e);o=o.trim(),i+=' the integral from '+s(o)+' to '+s(a)+' of ',r=!0}else i+=' the integral of ';else if("string"==typeof t.body){i+=di[t.body]||di[t.latex.trim()]||" "+t.body}else t.latex&&t.latex.length>0&&("\\"===t.latex[0]?i+=" "+t.latex.substr(1):i+=" "+t.latex)}break;case"enclose":n=Yt.toSpeakableFragment(t.body,e),pi(t.body)?i+=" crossed out "+n+" , ":i+=" crossed out "+n+". End cross out"}if(!r&&t.superscript){let s=Yt.toSpeakableFragment(t.superscript,e);s=s.trim();const a=s.replace(/<[^>]*>/g,"");if(pi(t.superscript)){if("math"===e.speechMode){const e=function(t){if(t&&Array.isArray(t))for(const e of t)if("first"!==e.type&&e.id)return e.id.toString();return""}(t.superscript);e&&(i+='')}"′"===a?i+=" prime ":"2"===a?i+=" squared ":"3"===a?i+=" cubed ":isNaN(parseInt(a))?i+=" to the "+s+"; ":i+=' to the '+a+" power; "}else isNaN(parseInt(a))?i+=" raised to the "+s+"; ":i+=' raised to the '+a+" power; "}if(!r&&t.subscript){let s=Yt.toSpeakableFragment(t.subscript,e);s=s.trim(),pi(t.subscript)?i+=" sub "+s:i+=" subscript "+s+". End subscript. "}}return i},Yt.toSpeakableText=function(t,e){const s=e?JSON.parse(JSON.stringify(e)):{textToSpeechMarkup:"",textToSpeechRules:"mathlive"};if(s.speechMode="math",window.sre&&"sre"===s.textToSpeechRules){s.generateID=!0;const e=Yt.toMathML(t,s);return e?(s.textToSpeechMarkup&&(s.textToSpeechRulesOptions=s.textToSpeechRulesOptions||{},s.textToSpeechRulesOptions.markup=s.textToSpeechMarkup,"ssml"===s.textToSpeechRulesOptions.markup&&(s.textToSpeechRulesOptions.markup="ssml_step"),s.textToSpeechRulesOptions.rate=s.speechEngineRate),s.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(s.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(e)):""}let i=Yt.toSpeakableFragment(t,s);if("ssml"===s.textToSpeechMarkup){let t="";s.speechEngineRate&&(t=''),i=''+t+"

    "+i+"

    "+(t?"
    ":"")+""}else i="mac"===s.textToSpeechMarkup&&"mac"===function(t){let e="other";return navigator&&navigator.platform&&navigator.userAgent&&(/^(mac)/i.test(navigator.platform)?e="mac":/^(win)/i.test(navigator.platform)?e="win":/(android)/i.test(navigator.userAgent)?e="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(e="chromeos")),e===t?t:"!"+t}("mac")?i.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):i.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return i};class xi{constructor(t,e){this.$setConfig(e||{}),this.element=t,t.mathfield=this,this.originalContent=t.innerHTML;let s=this.element.textContent;s&&(s=s.trim());let i="";this.config.substituteTextArea?"string"==typeof this.config.substituteTextArea?i+=this.config.substituteTextArea:i+="":/android|ipad|ipod|iphone/i.test(navigator.userAgent)?i+="\n \n \n ":i+='',i+='',this.config.virtualKeyboardMode||(this.config.virtualKeyboardMode=window.matchMedia&&window.matchMedia("(any-pointer: coarse)").matches?"onfocus":"off"),"manual"===this.config.virtualKeyboardMode?(i+=`"):i+="",i+="",i+='\n
    \n \n \n
    \n ',this.element.innerHTML=i;let a=0;"function"==typeof this.config.substituteTextArea?this.textarea=this.config.substituteTextArea():this.textarea=this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",t=>{t.preventDefault(),t.stopPropagation();let e=void 0===t.deltaX?t.detail:-t.deltaX;isFinite(e)||(e=t.wheelDelta/10),this.field.scroll({top:0,left:this.field.scrollLeft-5*e})},{passive:!1}),this.virtualKeyboardToggleDOMNode=this.element.children[a++].children[1],this._attachButtonHandlers(this.virtualKeyboardToggleDOMNode,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=gi("mathlive-popover-panel","ML__popover"),this.keystrokeCaption=gi("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=e.defaultMode||"math",this.smartModeSuppressed=!1,this.style={},this.blurred=!0,ui(this.element,"focus",this),ui(this.element,"blur",this),ui(this.textarea,"cut",this),ui(this.textarea,"copy",this),ui(this.textarea,"paste",this),Ne.delegateKeyboardEvents(this.textarea,{container:this.element,allowDeadKey:()=>"text"===this.mode,typedText:this._onTypedText.bind(this),paste:this._onPaste.bind(this),keystroke:this._onKeystroke.bind(this),focus:this._onFocus.bind(this),blur:this._onBlur.bind(this)}),window.PointerEvent?ui(this.field,"pointerdown",this):ui(this.field,"touchstart:active mousedown",this),ui(window,"resize",this);const o={...e};o.onSelectionDidChange=xi.prototype._onSelectionDidChange.bind(this),o.onContentDidChange=xi.prototype._onContentDidChange.bind(this),o.onAnnounce=this.config.onAnnounce,o.macros=this.config.macros,o.removeExtraneousParentheses=this.config.removeExtraneousParentheses,this.mathlist=new Pe.EditableMathlist(o,this),this.undoManager=new class{constructor(t){this.mathlist=t,this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(t){this.canUndo()&&(t&&"function"==typeof t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"undo"),this.restore(this.stack[this.index-1],t),this.index-=1,t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"undo"),this.canCoalesce=!1)}redo(t){this.canRedo()&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"redo"),this.index+=1,this.restore(this.stack[this.index],t),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(t){this.record&&(t&&"function"===t.onUndoStateWillChange&&t.onUndoStateWillChange(this.mathlist.target,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),t&&"function"==typeof t.onUndoStateDidChange&&t.onUndoStateDidChange(this.mathlist.target,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(t){this.canCoalesce&&this.pop(),this.snapshot(t),this.canCoalesce=!0}save(){return{latex:this.mathlist.root.toLatex(),selection:this.mathlist.toString()}}restore(t,e){const s=this.mathlist.suppressChangeNotifications;void 0!==e.suppressChangeNotifications&&(this.mathlist.suppressChangeNotifications=e.suppressChangeNotifications),this.mathlist.insert(t?t.latex:"",{mode:"math",insertionMode:"replaceAll",selectionMode:"after",format:"latex",...e}),this.mathlist.setPath(t?t.selection:[{relation:"body",offset:0}]),this.mathlist.suppressChangeNotifications=s}}(this.mathlist),s.length>0&&this.$latex(s),this.undoManager.startRecording(),this.undoManager.snapshot(this.config)}handleEvent(t){switch(t.type){case"focus":this._onFocus(t);break;case"blur":this._onBlur(t);break;case"touchstart":case"mousedown":case"pointerdown":this._onPointerDown(t);break;case"resize":this._resizeTimer&&window.cancelAnimationFrame(this._resizeTimer),this._resizeTimer=window.requestAnimationFrame(()=>bi(this)&&this._onResize());break;case"cut":this._onCut(t);break;case"copy":this._onCopy(t);break;case"paste":this._onPaste(t)}}$revertToOriginalContent(){this.element.innerHTML=this.originalContent,this.element.mathfield=null,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,fi(this.textarea,"cut",this),fi(this.textarea,"copy",this),fi(this.textarea,"paste",this),this.textarea.remove(),delete this.textarea,this.virtualKeyboardToggleDOMNode.remove(),delete this.virtualKeyboardToggleDOMNode,yi(this.popover),yi(this.keystrokeCaption),yi(this.virtualKeyboard),yi(document.getElementById("mathlive-alternate-keys-panel")),fi(this.element,"pointerdown",this),fi(this.element,"touchstart:active mousedown",this),fi(this.element,"focus",this),fi(this.element,"blur",this),fi(window,"resize",this),delete this.element}_resetKeystrokeBuffer(){this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer)}_getCaretPosition(){const t=function t(e){if(e.classList.contains("ML__caret")||e.classList.contains("ML__text-caret")||e.classList.contains("ML__command-caret"))return e;let s;return Array.from(e.children).forEach((function(e){s=s||t(e)})),s}(this.field);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}_getSelectionBounds(){const t=this.field.querySelectorAll(".ML__selected");if(t&&t.length>0){const e={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach(t=>{const s=t.getBoundingClientRect();s.lefte.right&&(e.right=s.right),s.bottom>e.bottom&&(e.bottom=s.bottom),s.top=t.left&&s<=t.right}return o&&e.children&&Array.from(e.children).forEach((function(e){const o=t(e,s,i);o.element&&o.distance<=a.distance&&(a=o)})),a}(this.field,t,e).element,o=a?a.getAttribute("data-atom-id"):null;if(o){const e=this.mathlist.filter((function(t,e){return e.captureSelection?e.filter(t=>t.id===o).length>0:e.id===o}));if(e&&e.length>0)if(i=de.pathFromString(e[0]).path,0===s.bias){const e=a.getBoundingClientRect();tt.parentNode.removeChild(t)),t.preventDefault(),t.stopPropagation()}let r=!1,l=!1;const c=setInterval(()=>{r?e.field.scroll({top:0,left:e.field.scrollLeft-16}):l&&e.field.scroll({top:0,left:e.field.scrollLeft+16})},32);function h(t){const i=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY,n="touch"===t.pointerType?20:5;if(Date.now()c.right,r=i=u.left&&d<=u.right&&p>=u.top&&p<=u.bottom){this.$hasFocus()||(o=!0,this.textarea.focus&&this.textarea.focus()),this._resetKeystrokeBuffer(),this.smartModeSuppressed=!1;const r=this.field.querySelector(".ML__mathlive").getBoundingClientRect();if(s=d>r.right?[{relation:"body",offset:this.mathlist.root.body.length-1}]:this._pathFromPoint(d,p,{bias:0}),s){let r=document.createElement("div");r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.left-200+"px",r=document.createElement("div"),r.className="ML__scroller",this.element.appendChild(r),r.style.left=u.right+"px",t.shiftKey?(this.mathlist.setRange(this.mathlist.path,s),s=de.clone(this.mathlist.path),s[s.length-1].offset-=1):this.mathlist.setPath(s,0),o=!0,this.style={},3===t.detail||vi>2?(n(t),3!==t.detail&&3!==vi||this.mathlist.selectAll_()):i||(i=!0,window.PointerEvent?(ui(e.field,"pointermove",h),ui(e.field,"pointerend pointercancel pointerup",n),e.field.setPointerCapture(t.pointerId)):(ui(window,"blur",n),t.touches?(ui(t.target,"touchmove",h),ui(t.target,"touchend",n)):(ui(window,"mousemove",h),ui(window,"mouseup",n))),2!==t.detail&&2!==vi||(a=!0,this.mathlist.selectGroup_()))}}else ki=null;o&&this._requestUpdate(),t.preventDefault()}_onSelectionDidChange(){this.mathlist.commitCommandStringBeforeInsertionPoint();let t="";this.mathlist.forEachSelected(e=>{t+=e.toLatex()}),t?(this.textarea.value=t,this.$hasFocus()&&this.textarea.select&&this.textarea.select()):(this.textarea.value="",this.textarea.setAttribute("aria-label",""));{const t=this.mode;this.mode=this.mathlist.anchorMode()||this.config.defaultMode,this.mode!==t&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),"command"===t&&"command"!==this.mode&&(Ze.hidePopover(this),this.mathlist.removeCommandString())}Ze.updatePopoverPosition(this,{deferred:!0}),"function"==typeof this.config.onSelectionDidChange&&this.config.onSelectionDidChange(this)}_onContentDidChange(){this.undoManager.canRedo()?this.element.classList.add("can-redo"):this.element.classList.remove("can-redo"),this.undoManager.canUndo()?this.element.classList.add("can-undo"):this.element.classList.remove("can-undo"),"function"==typeof this.config.onContentDidChange&&this.config.onContentDidChange(this)}_nextAtomSpeechText(t){function e(t,e){return"body"===e.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[t.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[e.relation]}const s=t?t.path:[],i=this.mathlist.path,a=i[i.length-1];let o="";for(;s.length>i.length;)o+="out of "+e(t.parent(),s[s.length-1])+"; ",s.pop();if(!this.mathlist.isCollapsed())return wi(this,"",this.mathlist.getSelectedAtoms());const n=e(this.mathlist.parent(),a);0===a.offset&&(o+=(n?"start of "+n:"unknown")+": ");const r=this.mathlist.sibling(Math.max(1,this.mathlist.extent));return r?o+=wi(this,"",r):0!==a.offset&&(o+=n?"end of "+n:"unknown"),o}_announce(t,e,s){"function"==typeof this.config.onAnnounce&&this.config.onAnnounce(this,t,e,s)}_onFocus(){this.config.readOnly||this.blurred&&(this.blurred=!1,this.textarea.focus&&this.textarea.focus(),"onfocus"===this.config.virtualKeyboardMode&&this.showVirtualKeyboard_(),Ze.updatePopoverPosition(this),this.config.onFocus&&this.config.onFocus(this),this._requestUpdate())}_onBlur(){this.blurred||(this.blurred=!0,this.ariaLiveText.textContent="","onfocus"===this.config.virtualKeyboardMode&&this.hideVirtualKeyboard_(),this.complete_({discard:!0}),this._requestUpdate(),this.config.onBlur&&this.config.onBlur(this))}_onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),Ze.updatePopoverPosition(this)}toggleKeystrokeCaption_(){this.keystrokeCaptionVisible=!this.keystrokeCaptionVisible,this.keystrokeCaption.innerHTML="",this.keystrokeCaptionVisible||(this.keystrokeCaption.style.visibility="hidden")}_showKeystroke(t){const e=this.keystrokeCaption;if(e&&this.keystrokeCaptionVisible){const s=this.element.getBoundingClientRect();e.style.left=s.left+"px",e.style.top=s.top-64+"px",e.innerHTML=""+(xe.stringify(t)||t)+""+e.innerHTML,e.style.visibility="visible",setTimeout((function(){e.childNodes.length>0&&e.removeChild(e.childNodes[e.childNodes.length-1]),0===e.childNodes.length&&(e.style.visibility="hidden")}),3e3)}}$perform(t){if(!t)return!1;let e,s=!1,i=[],a=!1;if(Array.isArray(t)?(e=t[0],i=t.slice(1)):e=t,e=e.replace(/-\w/g,t=>t[1].toUpperCase()),e+="_","function"==typeof this.mathlist[e]){if(/^(delete|transpose|add)/.test(e)&&this._resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&(this.undoManager.pop(),this.undoManager.snapshot(this.config)),this.mathlist[e](...i),/^(delete|transpose|add)/.test(e)&&"command"!==this.mode&&this.undoManager.snapshot(this.config),/^(delete)/.test(e)&&"command"===this.mode){const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);0===e.length?Ze.hidePopover(this):Ze.showPopoverWithLatex(this,e[0].match,e.length>1)}a=!0,s=!0}else"function"==typeof this[e]&&(a=this[e](...i),s=!0);return this.mathlist.isCollapsed()&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(e)||(this._resetKeystrokeBuffer(),this.style={}),a&&this._requestUpdate(),s}performWithFeedback_(t){return this.$focus(),this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,t=>t[1].toUpperCase()))||"moveToPreviousPlaceholder"===t||"complete"===t?this.returnKeypressSound?(this.returnKeypressSound.load(),this.returnKeypressSound.play().catch(t=>{})):this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!this.deleteKeypressSound?this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{})):(this.deleteKeypressSound.load(),this.deleteKeypressSound.play().catch(t=>{})),this.$perform(t)}convertLastAtomsToText_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0);let s=0,i=!1;for(this.mathlist.contentWillChange();!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"math"!==a.mode||!(/mord|textord|mpunct/.test(a.type)||"mop"===a.type&&/[a-zA-Z]+/.test(a.body))||a.superscript||a.subscript||e&&!e(a),i||(a.applyStyle({mode:"text"}),a.latex=a.body),s-=1,t-=1}this.mathlist.contentDidChange()}convertLastAtomsToMath_(t,e){"function"==typeof t&&(e=t,t=1/0),void 0===t&&(t=1/0),this.mathlist.contentWillChange();let s=0,i=!1;for(;!i;){const a=this.mathlist.sibling(s);i=0===t||!a||"text"!==a.mode||" "===a.body||e&&!e(a),i||a.applyStyle({mode:"math",type:"mord"}),s-=1,t-=1}this.removeIsolatedSpace_(),this.mathlist.contentDidChange()}removeIsolatedSpace_(){let t=0;for(;this.mathlist.sibling(t)&&"math"===this.mathlist.sibling(t).mode;)t-=1;if(this.mathlist.sibling(t)&&"text"===this.mathlist.sibling(t).mode&&" "===this.mathlist.sibling(t).body&&(!this.mathlist.sibling(t-1)||"math"===this.mathlist.sibling(t-1).mode)){this.mathlist.contentWillChange(),this.mathlist.siblings().splice(t-1,1),this.mathlist.contentDidChange();const e=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0,this.mathlist.setSelection(this.mathlist.anchorOffset()-1),this.mathlist.suppressChangeNotifications=e}}getTextBeforeAnchor_(){let t="",e=0,s=!1;for(;!s;){const i=this.mathlist.sibling(e);s=!(i&&("text"===i.mode&&!i.type||"math"===i.mode&&/mord|textord|mpunct/.test(i.type))),s||(t=i.body+t),e-=1}return t}smartMode_(t,e){if(this.smartModeSuppressed)return!1;if(this.mathlist.endOffset()1)return!1;if(!this.mathlist.isCollapsed())return!("text"!==this.mode||!/[/_^]/.test(s));const i=this.getTextBeforeAnchor_()+s;if("text"===this.mode){if("Esc"===t||/[/\\]/.test(s))return!0;if(/[\^_]/.test(s))return/(^|\s)[a-zA-Z][^_]$/.test(i)&&this.convertLastAtomsToMath_(1),!0;const e={")":"(","}":"{","]":"["}[s];if(e&&this.mathlist.parent()&&"leftright"===this.mathlist.parent().type&&this.mathlist.parent().leftDelim===e)return!0;if(/(^|[^a-zA-Z])(a|I)[ ]$/.test(i))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(s))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z][ ]$/.test(i))return this.convertLastAtomsToMath_(1),!1;if(/[^0-9]\.[^0-9\s]$/.test(i)){this.convertLastAtomsToMath_(1);const t=this.mathlist.sibling(0);return t.body="⋅",t.autoFontFamily="cmr",t.latex="\\cdot",!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/\.[0-9]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][0-9+\-.]$/.test(i))return this.convertLastAtomsToMath_(1),!0;if(/[(][a-z][,;]$/.test(i))return this.convertLastAtomsToMath_(2),!0;if(/[0-9+\-=><*|]$/.test(s))return this.removeIsolatedSpace_(),!0}else{if("Spacebar"===t)return this.convertLastAtomsToText_(t=>/[a-z][:,;.]$/.test(t.body)),!0;if(/[a-zA-Z]{3,}$/.test(i)&&!/(dxd|abc|xyz|uvw)$/.test(i))return this.convertLastAtomsToText_(t=>/[a-zA-Z:,;.]/.test(t.body)),!0;if(/(^|\W)(if|If)$/i.test(i))return this.convertLastAtomsToText_(1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(i)&&!/(αβγ)$/.test(i))return this.convertLastAtomsToText_(t=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(t.body)),!0;if(/\?|\./.test(s))return!0}return!1}_onKeystroke(t,e){if(this._showKeystroke(t),clearTimeout(this.keystrokeBufferResetTimer),this.config.onKeystroke&&!this.config.onKeystroke(this,t,e))return e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1;let s,i,a,o=!1;if("command"!==this.mode&&(!e||!e.ctrlKey&&!e.metaKey)){const t=Ne.eventToChar(e);if("Backspace"!==t)if(!t||t.length>1)this._resetKeystrokeBuffer();else{const e=this.keystrokeBuffer+t;let a=0;for(;!s&&a{this._resetKeystrokeBuffer()},this.config.inlineShortcutTimeout))}}if(this.config.smartMode){const i=this.mode;s?this.mode="math":this.smartMode_(t,e)&&(this.mode={math:"text",text:"math"}[this.mode],a=""),this.mode!==i&&"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode)}if(s||a||(a=xe.selectorForKeystroke(this.mode,t)),!s&&!a)return!0;if(this.config.readOnly&&"insert"===a[0])return!0;this.mathlist.decorateCommandStringAroundInsertionPoint(!1);const r=this.mathlist.parent();if("moveAfterParent"===a&&r&&"leftright"===r.type&&this.mathlist.endOffset()===this.mathlist.siblings().length-1&&this.config.smartFence&&this.mathlist._insertSmartFence(".")&&(a="",this._requestUpdate()),"math"===this.mode&&"Spacebar"===t&&!s){const t=this.mathlist.sibling(1),e=this.mathlist.sibling(-1);(t&&"text"===t.mode||e&&"text"===e.mode)&&this.mathlist.insert(" ",{mode:"text"})}if((a&&!this.$perform(a)||s)&&s){if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(s)){const t={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(Ne.eventToChar(e),{suppressChangeNotifications:!0,mode:this.mode,style:t});const s=this.mode;this.undoManager.snapshotAndCoalesce(this.config),this.undoManager.restore(this.keystrokeBufferStates[i],{...this.config,suppressChangeNotifications:!0}),this.mode=s}this.mathlist.contentWillChange();const t=this.mathlist.suppressChangeNotifications;this.mathlist.suppressChangeNotifications=!0;const a={...this.mathlist.anchorStyle(),...this.style};this.mathlist.insert(s,{format:"latex",mode:this.mode,style:a,smartFence:!0}),this.removeIsolatedSpace_(),s.endsWith(" ")&&(this.mode="text",this.mathlist.insert(" ",{mode:"text",style:a})),this.mathlist.suppressChangeNotifications=t,this.mathlist.contentDidChange(),this.undoManager.snapshot(this.config),this._requestUpdate(),this._announce("replacement"),o&&this._resetKeystrokeBuffer()}return this.scrollIntoView(),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!1}_onTypedText(t,e){if(this.config.readOnly)return void this._announce("plonk");if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play().catch(t=>{}))),e.commandMode&&"command"!==this.mode&&this.switchMode_("command"),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),e.simulateKeystroke){const e=t.charAt(0),s=Ne.charToEvent(e);if(!this.$keystroke(Ne.keyboardEventToString(s),s))return}let s="",a=!1;if(this.pasteInProgress)this.pasteInProgress=!1,this.mathlist.insert(t,{smartFence:this.config.smartFence,mode:"math"});else{const e={...this.mathlist.anchorStyle(),...this.style},o=i(t);for(const t of o)if("command"===this.mode){this.mathlist.removeSuggestion(),this.suggestionIndex=0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(),i=wt.suggest(e+t);a=i.length>1,0===i.length?(this.mathlist.insert(t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(e+t)&&this.mathlist.decorateCommandStringAroundInsertionPoint(!0),Ze.hidePopover(this)):(this.mathlist.insert(t,{mode:"command"}),i[0].match!==e+t&&this.mathlist.insertSuggestion(i[0].match,-i[0].match.length+e.length+1),s=i[0].match)}else if("math"===this.mode){const s={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(s){if("moveToSuperscript"===s){if(this._superscriptDepth()>=this.config.scriptDepth[1])return void this._announce("plonk")}else if("moveToSubscript"===s&&this._subscriptDepth()>=this.config.scriptDepth[0])return void this._announce("plonk");this.$perform(s)}else this.config.smartSuperscript&&"superscript"===this.mathlist.relation()&&/[0-9]/.test(t)&&0===this.mathlist.siblings().filter(t=>"first"!==t.type).length?(this.mathlist.insert(t,{mode:"math",style:e}),this.mathlist.moveAfterParent_()):this.mathlist.insert(t,{mode:"math",style:e,smartFence:this.config.smartFence})}else"text"===this.mode&&this.mathlist.insert(t,{mode:"text",style:e})}"command"!==this.mode&&this.undoManager.snapshotAndCoalesce(this.config),this._requestUpdate(),this.scrollIntoView(),Ze.showPopoverWithLatex(this,s,a)}_hash(){let t=0;const e=this.mathlist.root.toLatex(!1);for(let s=0;sbi(this)&&this._render()))}_render(t){t=t||{},this.dirty=!1,window.mathlive||(window.mathlive={}),this.mathlist.anchor()||(this.mathlist.path=[{relation:"body",offset:0}]),this.mathlist.forEach(t=>{t.caret="",t.isSelected=!1,t.containsCaret=!1});const e=this.$hasFocus();if(this.mathlist.isCollapsed()?this.mathlist.anchor().caret=e&&!this.config.readOnly?this.mode:"":this.mathlist.forEachSelected(t=>{t.isSelected=!0}),e&&!this.config.readOnly){let t=this.mathlist.ancestor(1),e=1,s=!1;for(;t&&!s;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,s=!0),e+=1,t=this.mathlist.ancestor(e)}const s=Yt.decompose({mathstyle:"displaystyle",generateID:{seed:this._hash(),groupNumbers:t.forHighlighting},macros:this.config.macros},this.mathlist.root),i=N.makeSpan(s,"ML__base");i.attributes={translate:"no","aria-hidden":"true"};const a=N.makeSpan("","ML__strut");a.setStyle("height",i.height,"em");const o=[a];if(0!==i.depth){const t=N.makeSpan("","ML__strut--bottom");t.setStyle("height",i.height+i.depth,"em"),t.setStyle("vertical-align",-i.depth,"em"),o.push(t)}o.push(i);const n=N.makeSpan(o,"ML__mathlive");this.field.innerHTML=n.toMarkup(0,this.config.horizontalSpacingScale),this.field.classList.toggle("ML__focused",e&&!this.config.readOnly),this.accessibleNode.innerHTML=""+Yt.toMathML(this.mathlist.root,this.config)+"";const r=this._getSelectionBounds();if(r){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.width=Math.ceil(r.right-r.left)+"px",t.style.height=Math.ceil(r.bottom-r.top-1)+"px",this.field.insertBefore(t,this.field.childNodes[0])}}_onPaste(){return this.pasteInProgress=!0,!0}_onCut(){return setTimeout(function(){this.$clearSelection(),this._requestUpdate()}.bind(this),0),!0}_onCopy(t){this.mathlist.isCollapsed()?(t.clipboardData.setData("text/plain","$$"+this.$text("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$text("json")),t.clipboardData.setData("application/xml",this.$text("mathML"))):(t.clipboardData.setData("text/plain","$$"+this.$selectedText("latex-expanded")+"$$"),t.clipboardData.setData("application/json",this.$selectedText("json")),t.clipboardData.setData("application/xml",this.$selectedText("mathML"))),t.preventDefault()}formatMathlist(t,e){let s="";if("latex"===(e=e||"latex")||"latex-expanded"===e)s=t.toLatex("latex-expanded"===e);else if("mathML"===e)s=t.toMathML(this.config);else if("spoken"===e)s=Yt.toSpeakableText(t,this.config);else if("spoken-text"===e){const e=this.config.textToSpeechMarkup;this.config.textToSpeechMarkup="",s=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=e}else if("spoken-ssml"===e||"spoken-ssml-withHighlighting"===e){const i=this.config.textToSpeechMarkup,a=this.config.generateID;this.config.textToSpeechMarkup="ssml","spoken-ssml-withHighlighting"===e&&(this.config.generateID=!0),s=Yt.toSpeakableText(t,this.config),this.config.textToSpeechMarkup=i,this.config.generateID=a}else if("json"===e){const e=Yt.toAST(t,this.config);s=JSON.stringify(e)}else"ASCIIMath"===e&&(s=function t(e,s){if(!e)return"";if(Array.isArray(e)){let s="";if(0===e.length)return"";if("first"===e[0].type&&e.shift(),"text"===e[0].mode){let i=0;for(s='"';e[i]&&"text"===e[i].mode;)s+=e[i].body,i++;s+='"'+t(e.slice(i))}else{let i=0;for(;e[i]&&"math"===e[i].mode;)s+=t(e[i]),i++;s+=t(e.slice(i))}return s.trim()}if("text"===e.mode)return'"'+e.body+'"';let i="";const a=e.latex?e.latex.trim():null;let o;switch(e.type){case"group":case"root":i=t(e.body);break;case"array":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(i+="(",i+=t(e.numer),i+=")/(",i+=t(e.denom),i+=")"):(i+="("+t(e.numer)+"),",i+="("+t(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?i+="root("+t(e.index)+")("+t(e.body)+")":i+="sqrt("+t(e.body)+")";break;case"leftright":i+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",i+=t(e.body),i+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:";break;case"sizeddelim":case"delim":case"accent":break;case"line":case"overlap":case"overunder":break;case"mord":i=ls[a]||a||("string"==typeof e.body?e.body:""),"\\"===i[0]&&(i+=""),o=a?a.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,o?i=String.fromCharCode(parseInt("0x"+o[1])):i.length>0&&"\\"===i.charAt(0)&&(i="string"==typeof e.body?e.body.charAt(0):e.latex);break;case"mbin":case"mrel":case"textord":case"minner":i=a&&ls[a]?ls[a]:a&&cs[a]?cs[a]:e.body;break;case"mopen":case"mclose":i+=e.body;break;case"mpunct":i=cs[a]||a;break;case"mop":"​"!==e.body&&(i="",i+="\\operatorname"===a?t(e.body):e.body||a,i+=" ");break;case"mathstyle":case"box":case"spacing":case"enclose":break;case"space":i=" "}if(e.subscript){i+="_";const s=t(e.subscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}if(e.superscript){i+="^";const s=t(e.superscript);s.length>1&&!/^(-)?\d+(\.\d*)?$/.test(s)?i+="("+s+")":i+=s}return i}(t,this.config));return s}$text(t){return this.formatMathlist(this.mathlist.root,t)}$selectedText(t){const e=this.mathlist.getSelectedAtoms();if(!e)return"";const s=Yt.makeRoot("math",e);return this.formatMathlist(s,t)}$selectionIsCollapsed(){return this.mathlist.isCollapsed()}$selectionDepth(){return this.mathlist.path.length}_superscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!0:s.subscript&&(i=!1),e+=1,s=this.mathlist.ancestor(e);return i?t:0}_subscriptDepth(){let t=0,e=0,s=this.mathlist.ancestor(e),i=!1;for(;s;)(s.superscript||s.subscript)&&(t+=1),s.superscript?i=!1:s.subscript&&(i=!0),e+=1,s=this.mathlist.ancestor(e);return i?t:0}$selectionAtStart(){return 0===this.mathlist.startOffset()}$selectionAtEnd(){return this.mathlist.endOffset()>=this.mathlist.siblings().length-1}groupIsSelected(){return 0===this.mathlist.startOffset()&&this.mathlist.endOffset()>=this.mathlist.siblings().length-1}$latex(t,e){return t?(t!==this.mathlist.root.toLatex()&&(e=e||{},this.mathlist.insert(t,Object.assign({},this.config,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:e.suppressChangeNotifications})),this.undoManager.snapshot(this.config),this._requestUpdate()),t):this.mathlist.root.toLatex()}$el(){return this.element}undo(){return this.complete_(),this.undoManager.undo(this.config),!0}redo(){return this.complete_(),this.undoManager.redo(this.config),!0}scrollIntoView(){this.dirty&&this._render();let t=this._getCaretPosition();const e=this.field.getBoundingClientRect();if(!t){const s=this._getSelectionBounds();s&&(t={x:s.right+e.left-this.field.scrollLeft,y:s.top+e.top-this.field.scrollTop})}if(t){const s=t.x-window.scrollX;se.right&&this.field.scroll({top:0,left:s-e.right+this.field.scrollLeft+20,behavior:"smooth"})}}scrollToStart(){this.field.scroll(0,0)}scrollToEnd(){const t=this.field.getBoundingClientRect();this.field.scroll(t.left-window.scrollX,0)}enterCommandMode_(){this.switchMode_("command")}copyToClipboard_(){return this.$focus(),this.mathlist.isCollapsed()&&this.$select(),document.execCommand("copy"),!1}cutToClipboard_(){return this.$focus(),document.execCommand("cut"),!0}pasteFromClipboard_(){return this.$focus(),document.execCommand("paste"),!0}$insert(t,e){if("string"==typeof t&&t.length>0){if((e=e||{}).focus&&this.$focus(),e.feedback&&(this.config.keypressVibration&&navigator.vibrate&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===t)this.mathlist.addRowAfter_();else if("&"===t)this.mathlist.addColumnAfter_();else{const s=this.style;this.mathlist.insert(t,{mode:this.mode,style:this.mathlist.anchorStyle(),...e}),e.resetStyle&&(this.style=s)}return this.undoManager.snapshot(this.config),this._requestUpdate(),!0}return!1}switchMode_(t,e,s){this._resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(t),e&&this.$insert(e,{format:"latex",mode:{math:"text",text:"math"}[t]}),this.mathlist.decorateCommandStringAroundInsertionPoint(!1),"command"===t?(this.mathlist.removeSuggestion(),Ze.hidePopover(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&this.switchKeyboardLayer_("lower-command"),this.mathlist.insert("",{mode:"math"})):this.mode=t,s&&this.$insert(s,{format:"latex",mode:t}),"function"==typeof this.config.onModeChange&&this.config.onModeChange(this,this.mode),this._requestUpdate()}complete_(t){if(t=t||{},Ze.hidePopover(this),t.discard)return this.mathlist.spliceCommandStringAroundInsertionPoint(null),this.switchMode_("math"),!0;const e=this.mathlist.extractCommandStringAroundInsertionPoint(!t.acceptSuggestion);if(e){if("\\("===e||"\\)"===e)this.mathlist.spliceCommandStringAroundInsertionPoint([]),this.mathlist.insert(e.slice(1),{mode:this.mode});else{const t="math";if(wt.commandAllowed(t,e)){const s=le.parseTokens(n(e),t,null,this.config.macros);this.mathlist.spliceCommandStringAroundInsertionPoint(s)}else{const s=le.parseTokens(n(e),t,null,this.config.macros);s?this.mathlist.spliceCommandStringAroundInsertionPoint(s):this.mathlist.decorateCommandStringAroundInsertionPoint(!0)}}return this.undoManager.snapshot(this.config),this._announce("replacement"),!0}return!1}_updateSuggestion(){this.mathlist.positionInsertionPointAfterCommitedCommand(),this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);if(0===e.length)Ze.hidePopover(this),this.mathlist.decorateCommandStringAroundInsertionPoint(!0);else{const s=this.suggestionIndex%e.length,i=t.length-e[s].match.length;0!==i&&this.mathlist.insertSuggestion(e[s].match,i),Ze.showPopoverWithLatex(this,e[s].match,e.length>1)}this._requestUpdate()}nextSuggestion_(){return this.suggestionIndex+=1,this._updateSuggestion(),!1}previousSuggestion_(){if(this.suggestionIndex-=1,this.suggestionIndex<0){this.mathlist.removeSuggestion();const t=this.mathlist.extractCommandStringAroundInsertionPoint(),e=wt.suggest(t);this.suggestionIndex=e.length-1}return this._updateSuggestion(),!1}_attachButtonHandlers(t,e){const s=this;let i,a,o,n,r;"object"==typeof e&&(e.default||e.pressed)?(e.default&&t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e.default)),e.alt&&t.setAttribute("data-"+this.config.namespace+"command-alt",JSON.stringify(e.alt)),e.altshift&&t.setAttribute("data-"+this.config.namespace+"command-altshift",JSON.stringify(e.altshift)),e.shift&&t.setAttribute("data-"+this.config.namespace+"command-shift",JSON.stringify(e.shift)),e.pressed&&t.setAttribute("data-"+this.config.namespace+"command-pressed",JSON.stringify(e.pressed)),e.pressAndHoldStart&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldStart",JSON.stringify(e.pressAndHoldStart)),e.pressAndHoldEnd&&t.setAttribute("data-"+this.config.namespace+"command-pressAndHoldEnd",JSON.stringify(e.pressAndHoldEnd))):t.setAttribute("data-"+this.config.namespace+"command",JSON.stringify(e)),ui(t,"mousedown touchstart:passive",(function(e){if("mousedown"!==e.type||1===e.buttons){e.stopPropagation(),e.preventDefault(),t.classList.add("pressed"),i=Date.now(),"touchstart"===e.type&&(o=e.changedTouches[0].identifier);const n=t.getAttribute("data-"+s.config.namespace+"command-pressed");n&&s.$perform(JSON.parse(n));const l=t.getAttribute("data-"+s.config.namespace+"command-pressAndHoldStart");l&&(a=t,r&&clearTimeout(r),r=window.setTimeout((function(){t.classList.contains("pressed")&&s.$perform(JSON.parse(l))}),300))}})),ui(t,"mouseleave touchcancel",(function(){t.classList.remove("pressed")})),ui(t,"touchmove:passive",(function(t){t.preventDefault();for(let e=0;e=7?s.style.width="286px":4===e.length||2===e.length?s.style.width="146px":1===e.length?s.style.width="86px":s.style.width="146px",s.style.height="auto";let i="";for(const o of e)i+="";i="
      "+i+"
    ",s.innerHTML=i,rs.makeKeycap(this,s.getElementsByTagName("li"),"performAlternateKeys");const a=this.virtualKeyboard.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]').getBoundingClientRect();if(a){a.top-s.clientHeight<0&&(s.style.width="auto",e.length<=6?s.style.height="56px":e.length<=12?s.style.height="108px":s.style.height="205px");const t=(a.top-s.clientHeight+5).toString()+"px",i=Math.max(0,Math.min(window.innerWidth-s.offsetWidth,(a.left+a.right-s.offsetWidth)/2))+"px";s.style.transform="translate("+i+","+t+")",s.classList.add("is-visible")}return!1}hideAlternateKeys_(){const t=document.getElementById("mathlive-alternate-keys-panel");return t&&(t.classList.remove("is-visible"),t.innerHTML="",yi(t)),!1}performAlternateKeys_(t){return this.hideAlternateKeys_(),this.$perform(t)}switchKeyboardLayer_(t){if("off"!==this.config.virtualKeyboardMode){"lower-command"!==t&&"upper-command"!==t&&"symbols-command"!==t&&this.complete_(),this.showVirtualKeyboard_(),this.hideAlternateKeys_(),this.unshiftKeyboardLayer_();const e=this.virtualKeyboard.getElementsByClassName("keyboard-layer");let s=!1;for(let i=0;i=1){s=[];for(let t=1;t<=i;t++)s.push(e[t])}break}case"right":{const e=t.mathlist.siblings(),i=t.mathlist.endOffset()+1;if(i<=e.length-1){s=[];for(let t=i;t<=e.length-1;t++)s.push(e[t])}break}case"start":case"end":break;case"group":s=t.mathlist.siblings();break;case"parent":{const e=t.mathlist.parent();e&&"root"!==e.type&&(s=t.mathlist.parent());break}}return s}(this,t);if(null===s)return this.config.handleSpeak(function(t){let e="";switch(t){case"all":break;case"selection":e="no selection";break;case"left":e="at start";break;case"right":e="at end";break;case"group":break;case"parent":e="no parent"}return e}(t)),!1;const i={...this.config};(e.withHighlighting||"amazon"===i.speechEngine)&&(i.textToSpeechMarkup=window.sre&&"sre"===i.textToSpeechRules?"ssml_step":"ssml",e.withHighlighting&&(i.generateID=!0));const a=Yt.toSpeakableText(s,i);return e.withHighlighting?(window.mathlive.readAloudMathField=this,this._render({forHighlighting:!0}),this.config.handleReadAloud&&this.config.handleReadAloud(this.field,a,this.config)):this.config.handleSpeak&&this.config.handleSpeak(a,i),!1}}let ki,vi=0;function wi(t,e,s){const i=Object.assign({},t.config);return i.textToSpeechMarkup="",i.textToSpeechRulesOptions=i.textToSpeechRulesOptions||{},i.textToSpeechRulesOptions.markup="none",e+Yt.toSpeakableText(s,i)}function Si(t,e,s,i){let a="";"plonk"===e?(t.plonkSound&&(t.plonkSound.load(),t.plonkSound.play().catch(t=>{})),t._resetKeystrokeBuffer()):"delete"===e?a=wi(t,"deleted: ",i):"focus"===e||/move/.test(e)?a=(t.mathlist.isCollapsed()?"":"selected: ")+t._nextAtomSpeechText(s):"replacement"===e?a=wi(t,"",t.mathlist.sibling(0)):"line"===e?(a=wi(t,"",t.mathlist.root),t.accessibleNode.innerHTML=''+Yt.toMathML(t.mathlist.root,t.config)+"",t.textarea.setAttribute("aria-label","after: "+a)):a=i?wi(t,e+" ",i):e;const o=/\u00a0/.test(t.ariaLiveText.textContent)?"   ":"   ";t.ariaLiveText.textContent=a+o}xi.prototype.undo_=xi.prototype.undo,xi.prototype.redo_=xi.prototype.redo,xi.prototype.scrollIntoView_=xi.prototype.scrollIntoView,xi.prototype.scrollToStart_=xi.prototype.scrollToStart,xi.prototype.scrollToEnd_=xi.prototype.scrollToEnd,xi.prototype.insert_=xi.prototype.$insert;var Ai={isValidMathfield:bi,MathField:xi};function Mi(t,e,s){let i=s,a=0;const o=t.length;for(;i0&&a.push({type:"text",data:n.slice(0,c)}),l=!1);let h=!1;for(;!h;){if(l){if(r=n.indexOf(e,c),-1===r){h=!0;break}c!==r&&a.push({type:"text",data:n.slice(c,r)}),c=r}else{if(r=Mi(s,n,c+e.length),-1===r){h=!0;break}a.push({type:"math",data:n.slice(c+e.length,r),rawData:n.slice(c,r+s.length),mathstyle:i}),c=r+s.length}l=!l}c"+e.renderToMathML(t,e)+""}catch(i){s.textContent=t}return s.className="sr-only",s}(t,s)),/\bspeakable-text\b/i.test(s.renderAccessibleContent)&&s.renderToSpeakableText){const i=document.createElement("span");i.innerHTML=s.renderToSpeakableText(t,s),i.className="sr-only",e.appendChild(i)}return e.appendChild(a),e}return a}function Li(t,e){let s=null;if(e.TeX.processEnvironments&&/^\s*\\begin/.test(t))s=document.createDocumentFragment(),s.appendChild(Ti(t,void 0,e,!0));else{const i=_i(t,e.TeX.delimiters);if(1===i.length&&"text"===i[0].type)return null;s=document.createDocumentFragment();for(let t=0;t{})}}))}}else e.speechEngine;else{const e=new SpeechSynthesisUtterance(t);window&&window.speechSynthesis.speak(e)}}function Pi(t,e,s){if(!window)return;if(!s&&window.mathlive&&(s=window.mathlive.config),"amazon"!==(s=s||{}).speechEngine)return void(s.handleSpeak&&s.handleSpeak(e));if(!window.AWS)return;const i=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:s.speechEngineVoice||"Joanna",Text:e,TextType:"ssml",SpeechMarkTypes:["ssml"]};window.mathlive=window.mathlive||{},window.mathlive.readAloudElement=t;const o=s.onReadAloudStatus||window.mathlive.onReadAloudStatus;i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new TextDecoder("utf-8").decode(new Uint8Array(e.AudioStream));window.mathlive.readAloudMarks=t.split("\n").map(t=>t?JSON.parse(t):{}),window.mathlive.readAloudTokens=[];for(const e of window.mathlive.readAloudMarks)e.value&&window.mathlive.readAloudTokens.push(e.value);window.mathlive.readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],i.synthesizeSpeech(a,(function(t,e){if(t);else if(e&&e.AudioStream){const t=new Uint8Array(e.AudioStream),s=new Blob([t.buffer],{type:"audio/mpeg"}),i=URL.createObjectURL(s);window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.pause():(window.mathlive.readAloudAudio=new Audio,window.mathlive.readAloudAudio.addEventListener("ended",()=>{o&&o(window.mathlive.readAloudMathField,"ended"),window.mathlive.readAloudMathField?(window.mathlive.readAloudMathField._render(),window.mathlive.readAloudElement=null,window.mathlive.readAloudMathField=null,window.mathlive.readAloudTokens=[],window.mathlive.readAloudMarks=[],window.mathlive.readAloudCurrentMark=""):function t(e){e.classList.remove("highlight"),e.children&&Array.from(e.children).forEach(e=>{t(e)})}(window.mathlive.readAloudElement)}),window.mathlive.readAloudAudio.addEventListener("timeupdate",()=>{let t="";const e=1e3*window.mathlive.readAloudAudio.currentTime+100;for(const s of window.mathlive.readAloudMarks)s.time0&&Array.from(e.children).forEach(e=>{t(e,s)})):(e.classList.add("highlight"),e.children&&e.children.length>0&&Array.from(e.children).forEach(e=>{t(e)}))}(window.mathlive.readAloudElement,window.mathlive.readAloudCurrentMark)))})),window.mathlive.readAloudAudio.src=i,o&&o(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()}}))}}))}function Bi(t){let e=t;if("string"==typeof t&&(e=document.getElementById(t),!e))throw Error(`The element with ID "${t}" could not be found.`);return e}function Oi(t,e){Di&&((e=e||{}).renderToMarkup=e.renderToMarkup||zi,e.renderToMathML=e.renderToMathML||Ei,e.renderToSpeakableText=e.renderToSpeakableText||qi,e.macros=e.macros||wt.MACROS,Di.renderMathInElement(Bi(t),e))}function $i(t){if(t.namespace){if(!/^[a-z]+[-]?$/.test(t.namespace))throw Error("options.namespace must be a string of lowercase characters only");/-$/.test(t.namespace)||(t.namespace+="-")}}const Ri={latexToMarkup:zi,latexToMathML:Ei,latexToSpeakableText:qi,latexToAST:function(t,e){if(!Yt.toAST)return{};(e=e||{}).macros=e.macros||{},Object.assign(e.macros,wt.MACROS);const s=le.parseTokens(n(t),"math",null,e.macros);return Yt.toAST(s,e)},astToLatex:function(t,e){return hi(t,e)},makeMathField:function(t,e){if(!Ai)throw Error("The MathField module is not loaded.");return(e=e||{}).handleSpeak=e.handleSpeak||Ii,e.handleReadAloud=e.handleReadAloud||Pi,new Ai.MathField(Bi(t),e)},renderMathInDocument:function(t){Oi(document.body,t)},renderMathInElement:Oi,revertToOriginalContent:function(t,e){(t=(t=Bi(t)).children[1])instanceof Ai.MathField?t.revertToOriginalContent():($i(e=e||{}),t.innerHTML=t.getAttribute("data-"+(e.namespace||"")+"original-content"))},getOriginalContent:function(t,e){return(t=(t=Bi(t)).children[1])instanceof Ai.MathField?t.originalContent:($i(e=e||{}),t.getAttribute("data-"+(e.namespace||"")+"original-content"))},readAloud:Pi,readAloudStatus:function(){return window?(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio?window.mathlive.readAloudAudio.paused?"paused":window.mathlive.readAloudAudio.ended?"ready":"playing":"ready"):"unavailable"},pauseReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"paused"),window.mathlive.readAloudAudio.pause()))},resumeReadAloud:function(){window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio&&(window.mathlive.onReadAloudStatus&&window.mathlive.onReadAloudStatus(window.mathlive.readAloudMathField,"playing"),window.mathlive.readAloudAudio.play()))},playReadAloud:function(t,e){if(window&&(window.mathlive=window.mathlive||{},window.mathlive.readAloudAudio)){let s=0;if(window.mathlive.readAloudFinalToken=null,t){window.mathlive.readAloudMarks=window.mathlive.readAloudMarks||[];for(const e of window.mathlive.readAloudMarks)e.value===t&&(s=e.time/1e3);let i=window.mathlive.readAloudTokens.indexOf(t);i>=0&&(i+=e,i`|'$%#&^_" ] // but Firefox doesn't support it // (https://bugzilla.mozilla.org/show_bug.cgi?id=1361876). Booo... // See also https://stackoverflow.com/questions/26133593/using-regex-to-match-international-unicode-alphanumeric-characters-in-javascript + +// Edit : https://github.com/arnog/mathlive/issues/195#issuecomment-493741744 const LETTER = - // typeof navigator !== 'undefined' && - // /firefox|edge/i.test(navigator.userAgent) ? - /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/; -// : new RegExp('\\p{Letter}', 'u'); + // typeof navigator !== 'undefined' && /firefox/i.test(navigator.userAgent) ? + /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/; // : + // new RegExp("\\p{Letter}", 'u'); const LETTER_AND_DIGITS = - // typeof navigator !== 'undefined' && - // /firefox|edge/i.test(navigator.userAgent) ? - /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/; -// : new RegExp('[0-9\\p{Letter}]', 'u'); + // typeof navigator !== 'undefined' && /firefox/i.test(navigator.userAgent) ? + /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/; // : + // new RegExp("[0-9\\p{Letter}]", 'u'); export default { matchCodepoint, diff --git a/dist/src/editor/editor-mathfield.js b/dist/src/editor/editor-mathfield.js index f7fb359fc..2b59fc7c5 100644 --- a/dist/src/editor/editor-mathfield.js +++ b/dist/src/editor/editor-mathfield.js @@ -1000,8 +1000,6 @@ class MathField { if (typeof this.config.onSelectionDidChange === 'function') { this.config.onSelectionDidChange(this); } - this.removeIsolatedSpace_(); - this.mathlist.contentDidChange(); } _onContentDidChange() { if (this.undoManager.canRedo()) { @@ -2715,18 +2713,18 @@ class MathField { * is used (default) * * @param {object} options.style - * + * * @param {boolean} options.resetStyle - If true, the style after the insertion * is the same as the style before. If false, the style after the * insertion is the style of the last inserted atom. * * @param {boolean} options.smartFence - If true, promote plain fences, e.g. `(`, * as `\left...\right` or `\mleft...\mright` - * + * * @param {boolean} options.suppressChangeNotifications - If true, the * handlers for the contentWillChange, contentDidChange, selectionWillChange and * selectionDidChange notifications will not be invoked. Default `false`. - * + * * @category Changing the Content * @method MathField#$insert */ diff --git a/examples/basic/index.esm.html b/examples/basic/index.esm.html index 753b66c31..60aee5a89 100644 --- a/examples/basic/index.esm.html +++ b/examples/basic/index.esm.html @@ -25,7 +25,7 @@

    MathLive Basic Example

    Return to the homepage  -
    - The popover panel - A Virtual Keyboard
    - The Loop Equation